Re: [PATCH net-next 1/2] ifb: support ethtools driver info
From: Tonghao Zhang <hidden>
Date: 2021-11-25 07:32:17
On Thu, Nov 25, 2021 at 10:19 AM Jakub Kicinski [off-list ref] wrote:
On Thu, 25 Nov 2021 10:01:54 +0800 xiangxia.m.yue@gmail.com wrote:quoted
+#define DRV_NAME "ifb" +#define DRV_VERSION "1.0"Let's not invent meaningless driver versions.
Ok
quoted
+#define TX_Q_LIMIT 32 + struct ifb_q_private { struct net_device *dev; struct tasklet_struct ifb_tasklet;@@ -181,6 +185,12 @@ static int ifb_dev_init(struct net_device *dev) return 0; } +static void ifb_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) +{ + strlcpy(info->driver, DRV_NAME, sizeof(info->driver));Can we make core fill in driver name from rtnl_link_ops so we don't need to do it in each driver?
Good idea! v2 is sent out, please review. https://patchwork.kernel.org/project/netdevbpf/patch/20211125072544.32578-1-xiangxia.m.yue@gmail.com/
quoted
+ strlcpy(info->version, DRV_VERSION, sizeof(info->version));Leave this field as is, core should fill it with the kernel release.
Ok
quoted
+}
-- Best regards, Tonghao