[PATCH 3/3] net: ntb_netdev: Expose queue pair count via ethtool -l
Koichiro Den <[email protected]> Wed, 25 Feb 2026 00:28:09 +0900
| Newsgroups | dev.linux.lists.ntb,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
Implement the read-only get_channels ethtool callback so the active number of queue pairs is visible via ethtool -l. Report dev->num_queues as the combined channel count and maximum. The driver does not support changing the channel count at runtime, so no set_channels implementation is provided. Signed-off-by: Koichiro Den <[email protected]> --- drivers/net/ntb_netdev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c index 837a2e95f06e..185cc9ddfce7 100644 --- a/drivers/net/ntb_netdev.c +++ b/drivers/net/ntb_netdev.c @@ -470,10 +470,20 @@ static int ntb_get_link_ksettings(struct net_device *dev, return 0; } +static void ntb_get_channels(struct net_device *ndev, + struct ethtool_channels *channels) +{ + struct ntb_netdev *dev = netdev_priv(ndev); + + channels->max_combined = dev->num_queues; + channels->combined_count = dev->num_queues; +} + static const struct ethtool_ops ntb_ethtool_ops = { .get_drvinfo = ntb_get_drvinfo, .get_link = ethtool_op_get_link, .get_link_ksettings = ntb_get_link_ksettings, + .get_channels = ntb_get_channels, }; static const struct ntb_queue_handlers ntb_netdev_handlers = { -- 2.51.0