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

enic: add ethtool get_channel support

Add .get_channel to enic_ethtool_ops to enable basic ethtool -l
support to get the current channel configuration.

Note that the driver does not support dynamically changing queue
configuration, so .set_channel is intentionally unused. Instead, users
should use Cisco's hardware management tools (UCSM/IMC) to modify
virtual interface card configuration out of band.

Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://patch.msgid.link/20240627202013.2398217-1-jon@nutanix.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jon Kohler and committed by
Jakub Kicinski
bf7bb7b4 db2dede2

+23
+23
drivers/net/ethernet/cisco/enic/enic_ethtool.c
··· 608 608 return 0; 609 609 } 610 610 611 + static void enic_get_channels(struct net_device *netdev, 612 + struct ethtool_channels *channels) 613 + { 614 + struct enic *enic = netdev_priv(netdev); 615 + 616 + switch (vnic_dev_get_intr_mode(enic->vdev)) { 617 + case VNIC_DEV_INTR_MODE_MSIX: 618 + channels->max_rx = ENIC_RQ_MAX; 619 + channels->max_tx = ENIC_WQ_MAX; 620 + channels->rx_count = enic->rq_count; 621 + channels->tx_count = enic->wq_count; 622 + break; 623 + case VNIC_DEV_INTR_MODE_MSI: 624 + case VNIC_DEV_INTR_MODE_INTX: 625 + channels->max_combined = 1; 626 + channels->combined_count = 1; 627 + break; 628 + default: 629 + break; 630 + } 631 + } 632 + 611 633 static const struct ethtool_ops enic_ethtool_ops = { 612 634 .supported_coalesce_params = ETHTOOL_COALESCE_USECS | 613 635 ETHTOOL_COALESCE_USE_ADAPTIVE_RX | ··· 654 632 .set_rxfh = enic_set_rxfh, 655 633 .get_link_ksettings = enic_get_ksettings, 656 634 .get_ts_info = enic_get_ts_info, 635 + .get_channels = enic_get_channels, 657 636 }; 658 637 659 638 void enic_set_ethtool_ops(struct net_device *netdev)