lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-Id: <20220717022050.822766-1-andrey.turkin@gmail.com> Date: Sun, 17 Jul 2022 02:20:49 +0000 From: Andrey Turkin <andrey.turkin@...il.com> To: netdev@...r.kernel.org Cc: Ronak Doshi <doshir@...are.com>, VMware PV-Drivers Reviewers <pv-drivers@...are.com>, Andrey Turkin <andrey.turkin@...il.com> Subject: [PATCH] vmxnet3: Implement ethtool's get_channels command Some tools (e.g. libxdp) use that information. Signed-off-by: Andrey Turkin <andrey.turkin@...il.com> --- drivers/net/vmxnet3/vmxnet3_ethtool.c | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c index 3172d46c0335..d1a7ec975b87 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethtool.c +++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c @@ -1188,6 +1188,43 @@ static int vmxnet3_set_coalesce(struct net_device *netdev, return 0; } +void vmxnet3_get_channels(struct net_device *netdev, + struct ethtool_channels *ec) +{ + struct vmxnet3_adapter *adapter = netdev_priv(netdev); + +#if defined(CONFIG_PCI_MSI) + if (adapter->intr.type == VMXNET3_IT_MSIX) { + if (adapter->share_intr == VMXNET3_INTR_BUDDYSHARE) { + ec->combined_count = adapter->num_tx_queues; + ec->rx_count = 0; + ec->tx_count = 0; + } else { + ec->combined_count = 0; + ec->rx_count = adapter->num_rx_queues; + ec->tx_count = + adapter->share_intr == VMXNET3_INTR_TXSHARE ? + 1 : adapter->num_tx_queues; + } + } else { +#endif + ec->rx_count = 0; + ec->tx_count = 0; + ec->combined_count = 1; +#if defined(CONFIG_PCI_MSI) + } +#endif + + ec->other_count = 1; + + /* Number of interrupts cannot be changed on the fly */ + /* Just set maximums to actual values */ + ec->max_rx = ec->rx_count; + ec->max_tx = ec->tx_count; + ec->max_combined = ec->combined_count; + ec->max_other = ec->other_count; +} + static const struct ethtool_ops vmxnet3_ethtool_ops = { .supported_coalesce_params = ETHTOOL_COALESCE_RX_USECS | ETHTOOL_COALESCE_MAX_FRAMES | @@ -1213,6 +1250,7 @@ static const struct ethtool_ops vmxnet3_ethtool_ops = { .set_rxfh = vmxnet3_set_rss, #endif .get_link_ksettings = vmxnet3_get_link_ksettings, + .get_channels = vmxnet3_get_channels, }; void vmxnet3_set_ethtool_ops(struct net_device *netdev) base-commit: 972a278fe60c361eb8f37619f562f092e8786d7c -- 2.25.1
Powered by blists - more mailing lists