Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Wangxun: vf: Implement some ethtool apis for get_xxx

Implement some ethtool interfaces for obtaining the status of
Wangxun Virtual Function Ethernet.
Just like connection status, version information, queue depth and so on.

Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250924082140.41612-1-mengyuanlou@net-swift.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Mengyuan Lou and committed by
Jakub Kicinski
e556f011 55f5a5a7

+42
+33
drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
··· 546 546 } 547 547 } 548 548 EXPORT_SYMBOL(wx_get_ptp_stats); 549 + 550 + static int wx_get_link_ksettings_vf(struct net_device *netdev, 551 + struct ethtool_link_ksettings *cmd) 552 + { 553 + struct wx *wx = netdev_priv(netdev); 554 + 555 + ethtool_link_ksettings_zero_link_mode(cmd, supported); 556 + cmd->base.autoneg = AUTONEG_DISABLE; 557 + cmd->base.port = PORT_NONE; 558 + cmd->base.duplex = DUPLEX_FULL; 559 + cmd->base.speed = wx->speed; 560 + 561 + return 0; 562 + } 563 + 564 + static const struct ethtool_ops wx_ethtool_ops_vf = { 565 + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | 566 + ETHTOOL_COALESCE_TX_MAX_FRAMES_IRQ | 567 + ETHTOOL_COALESCE_USE_ADAPTIVE, 568 + .get_drvinfo = wx_get_drvinfo, 569 + .get_link = ethtool_op_get_link, 570 + .get_ringparam = wx_get_ringparam, 571 + .get_msglevel = wx_get_msglevel, 572 + .get_coalesce = wx_get_coalesce, 573 + .get_ts_info = ethtool_op_get_ts_info, 574 + .get_link_ksettings = wx_get_link_ksettings_vf, 575 + }; 576 + 577 + void wx_set_ethtool_ops_vf(struct net_device *netdev) 578 + { 579 + netdev->ethtool_ops = &wx_ethtool_ops_vf; 580 + } 581 + EXPORT_SYMBOL(wx_set_ethtool_ops_vf);
+1
drivers/net/ethernet/wangxun/libwx/wx_ethtool.h
··· 44 44 struct kernel_ethtool_ts_info *info); 45 45 void wx_get_ptp_stats(struct net_device *dev, 46 46 struct ethtool_ts_stats *ts_stats); 47 + void wx_set_ethtool_ops_vf(struct net_device *netdev); 47 48 #endif /* _WX_ETHTOOL_H_ */
+4
drivers/net/ethernet/wangxun/ngbevf/ngbevf_main.c
··· 14 14 #include "../libwx/wx_mbx.h" 15 15 #include "../libwx/wx_vf.h" 16 16 #include "../libwx/wx_vf_common.h" 17 + #include "../libwx/wx_ethtool.h" 17 18 #include "ngbevf_type.h" 18 19 19 20 /* ngbevf_pci_tbl - PCI Device ID Table ··· 187 186 goto err_pci_release_regions; 188 187 } 189 188 189 + wx->driver_name = KBUILD_MODNAME; 190 + wx_set_ethtool_ops_vf(netdev); 190 191 netdev->netdev_ops = &ngbevf_netdev_ops; 191 192 192 193 /* setup the private structure */ ··· 206 203 if (err) 207 204 goto err_free_sw_init; 208 205 206 + wx_get_fw_version_vf(wx); 209 207 err = register_netdev(netdev); 210 208 if (err) 211 209 goto err_register;
+4
drivers/net/ethernet/wangxun/txgbevf/txgbevf_main.c
··· 14 14 #include "../libwx/wx_mbx.h" 15 15 #include "../libwx/wx_vf.h" 16 16 #include "../libwx/wx_vf_common.h" 17 + #include "../libwx/wx_ethtool.h" 17 18 #include "txgbevf_type.h" 18 19 19 20 /* txgbevf_pci_tbl - PCI Device ID Table ··· 240 239 goto err_pci_release_regions; 241 240 } 242 241 242 + wx->driver_name = KBUILD_MODNAME; 243 + wx_set_ethtool_ops_vf(netdev); 243 244 netdev->netdev_ops = &txgbevf_netdev_ops; 244 245 245 246 /* setup the private structure */ ··· 259 256 if (err) 260 257 goto err_free_sw_init; 261 258 259 + wx_get_fw_version_vf(wx); 262 260 err = register_netdev(netdev); 263 261 if (err) 264 262 goto err_register;