OSDN Git Service

net: ethtool: self_test: Mark interface in testing operative status
authorAndrew Lunn <andrew@lunn.ch>
Sun, 19 Apr 2020 22:11:52 +0000 (00:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Apr 2020 19:43:24 +0000 (12:43 -0700)
When an interface is executing a self test, put the interface into
operative status testing.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/ioctl.c

index 89d0b18..593fa66 100644 (file)
@@ -1746,7 +1746,9 @@ static int ethtool_self_test(struct net_device *dev, char __user *useraddr)
        if (!data)
                return -ENOMEM;
 
+       netif_testing_on(dev);
        ops->self_test(dev, &test, data);
+       netif_testing_off(dev);
 
        ret = -EFAULT;
        if (copy_to_user(useraddr, &test, sizeof(test)))