From: "Björn Töpel" <bjorn@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>, Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemb@google.com>,
netdev@vger.kernel.org
Cc: "Stanislav Fomichev" <sdf@fomichev.me>,
"Björn Töpel" <bjorn@kernel.org>,
"Simon Horman" <horms@kernel.org>,
"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
"Mina Almasry" <almasrymina@google.com>,
"Kaiyuan Zhang" <kaiyuanz@google.com>,
"Simona Vetter" <simona.vetter@ffwll.ch>
Subject: [PATCH net] ethtool: Allow the channel count that a memory provider needs
Date: Tue, 1 Dec 2026 12:54:56 +0100 [thread overview]
Message-ID: <20261201115458.1254880-1-bjorn@kernel.org> (raw)
dev_get_min_mp_channel_count() returns the lowest channel count that
keeps every queue with a memory provider. One more than the highest
such queue. ethtool_check_max_channel() refuses a count that is lower
than or equal to it, as it does for the highest queue of the RSS
indirection table and of the ntuple filters, which are queue indices.
With a provider on queue 42, going down to 43 channels then fails with
"requested channel counts are too low for existing memory provider
setting (43)", though queue 42 stays.
Refuse only counts below the minimum, and name the variable after what
it holds, as the queue indices next to it led to the comparison.
Counts below the minimum fail as before, and the message reports the
minimum. Callers that only ask whether any queue has a provider, as
the XDP and tcp-data-split checks do, see no change.
Found while testing an AF_XDP memory provider on mlx5, where going
from 47 to 43 channels with the provider on queue 42 failed. devmem
shows it too. Here, a dmabuf bound to queue 42 of a ConnectX-7,
"ethtool -L eth0 combined 43" fails the same way. With a provider on
queue 2 of the fbnic QEMU model, 3 channels were refused before this
patch and are taken after it, and 2 are still refused.
Tested on a ConnectX-7 (firmware 28.48.1000) with a devmem dmabuf
bound to queue 42. With this patch, going from 47 to 43 channels is
accepted, and going from 43 to 42 is refused.
Fixes: 170aafe35cb9 ("netdev: support binding dma-buf to netdevice")
Signed-off-by: Björn Töpel <bjorn@kernel.org>
---
net/ethtool/common.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index ec67fbd6bb86..eb3a4bc67654 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -801,7 +801,7 @@ int ethtool_check_max_channel(struct net_device *dev,
{
u64 max_rxnfc_in_use;
u32 max_rxfh_in_use;
- int max_mp_in_use;
+ u32 min_mp_channels;
/* ensure the new Rx count fits within the configured Rx flow
* indirection table/rxnfc settings
@@ -820,10 +820,10 @@ int ethtool_check_max_channel(struct net_device *dev,
return -EINVAL;
}
- max_mp_in_use = dev_get_min_mp_channel_count(dev);
- if (channels.combined_count + channels.rx_count <= max_mp_in_use) {
+ min_mp_channels = dev_get_min_mp_channel_count(dev);
+ if (channels.combined_count + channels.rx_count < min_mp_channels) {
if (info)
- GENL_SET_ERR_MSG_FMT(info, "requested channel counts are too low for existing memory provider setting (%d)", max_mp_in_use);
+ GENL_SET_ERR_MSG_FMT(info, "requested channel counts are too low for existing memory provider setting (%u)", min_mp_channels);
return -EINVAL;
}
base-commit: e2fb9368a41662bc54624f9be87ea8989b109306
--
2.56.1
reply other threads:[~2026-12-01 11:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261201115458.1254880-1-bjorn@kernel.org \
--to=bjorn@kernel.org \
--cc=almasrymina@google.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kaiyuanz@google.com \
--cc=kuba@kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=simona.vetter@ffwll.ch \
--cc=willemb@google.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