Skip to contentSkip to conversation

net: ethtool: set a default driver name

PATCH Applied [email protected] 2 participants 2 messages Nov 25, 2021 – Nov 27, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: ethtool: set a default driver name

From: Tonghao Zhang <[email protected]>

The netdev (e.g. ifb, bareudp), which not support ethtool ops (e.g. .get_drvinfo), we can use the rtnl kind as a default name.

ifb netdev may be created by others prefix, not ifbX.

Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Leon Romanovsky <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Hao Chen <[email protected]>
Cc Heiner Kallweit <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>
Cc Danielle Ratson <[email protected]>
Cc Andrew Lunn <[email protected]>

---
v2: remove unnecessary white line
v1: https://lore.kernel.org/all/20211124181858.6c4668db@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/

---
 net/ethtool/ioctl.c | 3 +++
 1 file changed, 3 insertions(+)
net/ethtool/ioctl.c +3 -0
index af2d4e022076..3d7bff407580 100644
@@ -734,6 +734,9 @@ ethtool_get_drvinfo(struct net_device *dev, struct ethtool_devlink_compat *rsp)
 			sizeof(rsp->info.bus_info));
 		strlcpy(rsp->info.driver, dev->dev.parent->driver->name,
 			sizeof(rsp->info.driver));
+	} else if (dev->rtnl_link_ops) {
+		strlcpy(rsp->info.driver, dev->rtnl_link_ops->kind,
+			sizeof(rsp->info.driver));
 	} else {
 		return -EOPNOTSUPP;
 	}
Signature · 1 line
2.27.0
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 26 Nov 2021 00:30:49 +0800 you wrote:

From: Tonghao Zhang <[email protected]>

The netdev (e.g. ifb, bareudp), which not support ethtool ops (e.g. .get_drvinfo), we can use the rtnl kind as a default name.

ifb netdev may be created by others prefix, not ifbX.

[...]

Here is the summary with links:
- [net-next,v3] net: ethtool: set a default driver name

    https://git.kernel.org/netdev/net-next/c/bde3b0fd8055

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html