From: Koichiro Den <den@valinux.co.jp>
To: Jon Mason <jdmason@kudzu.us>, Dave Jiang <dave.jiang@intel.com>,
Allen Hubbe <allenbh@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: ntb@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] net: ntb_netdev: Expose queue pair count via ethtool -l
Date: Wed, 25 Feb 2026 00:28:09 +0900 [thread overview]
Message-ID: <20260224152809.1799199-4-den@valinux.co.jp> (raw)
In-Reply-To: <20260224152809.1799199-1-den@valinux.co.jp>
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 <den@valinux.co.jp>
---
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
next prev parent reply other threads:[~2026-02-24 15:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 15:28 [PATCH 0/3] net: ntb_netdev: Add Multi-queue support Koichiro Den
2026-02-24 15:28 ` [PATCH 1/3] net: ntb_netdev: Introduce per-queue context Koichiro Den
2026-02-24 15:28 ` [PATCH 2/3] net: ntb_netdev: Make queue pair count configurable Koichiro Den
2026-02-24 15:28 ` Koichiro Den [this message]
2026-02-24 16:20 ` [PATCH 0/3] net: ntb_netdev: Add Multi-queue support Dave Jiang
2026-02-25 3:36 ` Koichiro Den
2026-02-25 15:07 ` Dave Jiang
2026-02-26 3:50 ` Jakub Kicinski
2026-02-26 8:01 ` Koichiro Den
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260224152809.1799199-4-den@valinux.co.jp \
--to=den@valinux.co.jp \
--cc=allenbh@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=dave.jiang@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jdmason@kudzu.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ntb@lists.linux.dev \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox