🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25199

[PATCH net] ethtool: Allow the channel count that a memory provider needs

#25199
From: Björn Töpel
Date: Tue, 01 Dec 2026 11:54
65 lines
10425 bytes
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
Technical Details
Message-ID: <20261201115458.1254880-1-bjorn@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374985-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374985-linux-kernel-netdev=dewy.ru
From: bjorn@kernel.org (Björn Töpel)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] ethtool: Allow the channel count that a memory provider needs
Date: Tue,  1 Dec 2026 12:54:56 +0100
Organization: Usenet Network
Message-ID: <20261201115458.1254880-1-bjorn@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1701835"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:9kDVxkCYHi0MQ69+jKToIgvH+Ao= sha256:fGOMSOgTgscIiHteBzas4zsW0VfJ+np8wKSQmwkGT5M=
	sha1:QbOEJ422Vmm8toZ4gHF9PfYb2yI= sha256:1ZVL+raRDkW39ApFM+PuX6o3g5MV9z66IunsZw5HwRI=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 23536117352; Tue,  1 Dec 2026 14:55:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Ntinr1dQKW_c;
	Tue,  1 Dec 2026 14:55:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374985-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 6B65711734A; Tue,  1 Dec 2026 14:55:15 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 7F65827240; Tue,  1 Dec 2026 11:55:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796126113;
	b=KTH/KIdk57nThxXiOmVgaPOmL0Q0Sh526EVK6/cd4kCfJVbT3Kfz6Q0KorOCoPvUH11x
	 W+CoV5uRTA5Qz6ov83r7muesIyCe2U/BmV1XckT4eI8qZYC9V7fxo+3Z1qWOm3uJNVh9R
	 2SiSfiKkgWZqZ1f2oAu5SbgWTrIwAi/hP84sO1ztqB42WmEuX2AFth5REzB0MylhEDQwT
	 p/utGO+44ldkBVf9fJey9V9FsYwtFPR+F3MmoIRqVlfVu4jLHm5PH7bx6l99I77BjADCz
	 ca83TagxwSJTNeVjlsVrE72YQ8aB7/kS4eX6OBJL8u6Aql2v4ciBFfBNdaTN+bEkTgw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796126113;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding;
	bh=5Y51v+K211v+HYls5WxKGPXSdkBk/qkhNM5ZMu6V518=;
	b=19pinbCQ2I3ELtqwn80Ss0btjZUIWkjGH1jUPIDRqDJZ/Eph6GQfRVDkU6tqmZxehFPm
	 XWoAZVhcxr3TI+5jlxMNVeH/M6DRoQmvYoFrkUDDtMx+a3RdNgbDkSsD689CTOqZ06eA3
	 rAJLexNAWOjaQL5VEhcB0TIJT1XmczAWCTlJIEF6GIuafyWYWTr8Nu+mLXPZyrbku7+wZ
	 VpiQEQUNr6wuw0y0eX4oOXr9T4bOva7m14Nl86sNFANH/yH6Nz5DyJaDFUNBxT+TJXYS/
	 trdvu/b2gd4c09uZmGaEe0BYHJB8IWptc3G2G+cxLx6BK1wVey70AI80ETgxv1toA0A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y9fqD7SA;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 3491A606A32C;
	Tue,  1 Dec 2026 11:55:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y9fqD7SA
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796126112;
	b=4K6NP4RQdAu5AzIHxO3nhmvRNzTet633M0NMAYzPn/CzbNEwEGKT5PN1rU+eHhoSCPO4
	 joSlee1vHgSONK+OP5V1oYlA/8E7GlQ6eZWMtufd9Nv80tHUojefn6rh99Mbp5JrGMUNK
	 IhYiTEYqGJcj9X1BbptxBJ06iC7kB+d82fRW/6r51tYAjn25pUSXp06LYxQBU8Hb7nYli
	 9uqi6g8O9mqOVwbsJfYFOC4U/cC4HzLssHdtB/X5JcICIlfCmcTudDBJnFjfHTbT4LgSu
	 SMJtWPiUHGT7a5U0RNbaTUYFEvpLA6rBaI5QUe29y2+4nFNHkd3E4TWYjHsWRHDNlJg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796126112;
	h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
	 MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=5Y51v+K211v+HYls5WxKGPXSdkBk/qkhNM5ZMu6V518=;
	b=Q0Hm3KsI0YJLnw99BV+BLs05O9ySgQ3HSbDnqKxpoyRASPRToK+aDHKoZAdG1aOVtN94
	 n7azH4ddyc4p33w3wsuulleqRUfM/y6jrnOSVVXODDVDV8dMnZ/43CDHaNyBL7k2GWTIS
	 KmAnDiZhD5grjy4d4ccxHl3b4pnPp9V0rCXfSt7ueCFselG+49v3mzGzUQYecYlRLTsJO
	 DBez1YzUvUJ3WVIf+lyelOFgeNfL9zc0gMbHWI6RylrDneCQ77jVVU0s7YjnSkZBRSozM
	 pl4yHYQerY7yBY0Bn2lmkYL4+PZdIWvkcoqkfhZ2JH0ctbM9rBv/Bz4u+2eX7L681BQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y9fqD7SA;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52CDD606A31A
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 11:55:12 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E2831F000C1;
	Tue,  1 Dec 2026 11:55:09 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796126112;
	bh=5Y51v+K211v+HYls5WxKGPXSdkBk/qkhNM5ZMu6V518=;
	h=From:To:Cc:Subject:Date;
	b=Y9fqD7SAmY0AcIPcctT4xvSokPdEjNVxoar1FnjrTLYR2BAYU9kwL2sjyLBFEyiOg
	 aZcyUyCKDSSzYYyFzXgplB5wcA349R7JxUnqjpiq4EEQiKGly22V8S3gnoEd9acqLO
	 +lylAJnJc2tw8RmhkAzfF0PAL0j+RHAvZkLwT6YuuLdEHt/wR5F8ZUj7COiGk5eZ39
	 2ERD3NF0wHn4WOyHGNyOKwv/wEuxzOYe0eRx/NbKe/ai1EW9yUvS6fmTGfXA2q1DFi
	 Ll9T4NNuzIkC3GEZazEBfz3ZojnPJRY6cPTg2yfO2VbYy1xbhOtEKYdae1x8t8B4um
	 37Kui/aCjP7Tg==
X-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>
X-Mailer: git-send-email 2.56.1
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list