diff mbox series

[net-next,3/3] net: ethtool: self_test: Mark interface in testing operative status

Message ID 20200417230350.802675-4-andrew@lunn.ch
State Changes Requested
Delegated to: David Miller
Headers show
Series RFC 2863 Testing Oper status | expand

Commit Message

Andrew Lunn April 17, 2020, 11:03 p.m. UTC
When an interface is executing a self test, put the interface into
operative status testing.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 net/ethtool/ioctl.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Florian Fainelli April 17, 2020, 11:53 p.m. UTC | #1
On 4/17/2020 4:03 PM, Andrew Lunn wrote:
> 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>
diff mbox series

Patch

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 89d0b1827aaf..593fa665f820 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -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)))