๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27489

Re: [PATCH net-next v9 13/13] ibmveth: Allow changing the RX queue count

#27489
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 19:42
105 lines
11793 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message says "A queue count change is logged with the
  old and new counts", but the code only logs when the RX count changes.

--

ibmveth: Allow changing the RX queue count

This commit lets ethtool -L change the RX queue count on multi-queue
firmware (1 to 16 queues). A running device is closed and reopened to
apply the new counts, with a fallback to the old counts and the reset
work if the reopen fails. Queue count changes are also logged.

> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index 20cb9202b7d3f..87ce6bcda4721 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c

[ ... ]

> @@ -2144,11 +2147,90 @@ static void ibmveth_get_ethtool_stats(struct net_device *dev,
>  static void ibmveth_get_channels(struct net_device *netdev,
>  				 struct ethtool_channels *channels)
>  {
> +	struct ibmveth_adapter *adapter = netdev_priv(netdev);
> +
>  	channels->max_tx = ibmveth_real_max_tx_queues();
>  	channels->tx_count = netdev->real_num_tx_queues;
>  
> -	channels->max_rx = netdev->real_num_rx_queues;
>  	channels->rx_count = netdev->real_num_rx_queues;
> +	channels->max_rx = adapter->multi_queue ?
> +			   IBMVETH_MAX_RX_QUEUES : channels->rx_count;
> +}
> +
> +/* Called with the device closed: open() sizes the RX queues and the TX
> + * LTBs from these counts.
> + */
> +static int ibmveth_set_queue_counts(struct net_device *netdev,
> +				    unsigned int rx, unsigned int tx)
> +{
> +	struct ibmveth_adapter *adapter = netdev_priv(netdev);
> +	unsigned int old_rx = adapter->num_rx_queues;
> +	unsigned int old_tx = netdev->real_num_tx_queues;
> +	int rc;
> +
> +	rc = netif_set_real_num_queues(netdev, tx, rx);
> +	if (!rc) {
> +		adapter->num_rx_queues = rx;
> +		if (old_rx != rx || old_tx != tx) {
> +			if (adapter->multi_queue)
> +				netdev_info(netdev,
> +					    "queues %08x: RX %u -> %u, TX %u -> %u\n",
> +					    adapter->vdev->unit_address,
> +					    old_rx, rx, old_tx, tx);
> +			else if (old_tx != tx)
> +				netdev_info(netdev,
> +					    "queues %08x: TX %u -> %u (RX 1)\n",
> +					    adapter->vdev->unit_address,
> +					    old_tx, tx);

[Severity: Low]

Can this non-MQ branch ever run?

Without MQ, ibmveth_get_channels() above sets max_rx to the current
rx_count, which is 1. The ethtool core rejects an rx_count above max_rx.
It also rejects an rx_count of 0 when combined_count is 0.

So on a non-MQ adapter, rx always equals adapter->num_rx_queues, and
ibmveth_set_channels() never reaches ibmveth_set_queue_counts():

	if (rx != adapter->num_rx_queues) {
		if (adapter->opened)
			return ibmveth_reopen_with_counts(netdev, rx, goal);
		return ibmveth_set_queue_counts(netdev, rx, goal);
	}

There is a related point in the commit message, which says:

  A queue count change is logged with the old and new counts.

A TX-only change such as "ethtool -L <dev> tx N" resubmits the current
rx_count, so it skips the block above. It takes the existing live TX
path in ibmveth_set_channels(), which calls
netif_set_real_num_tx_queues() and logs nothing.

Should the commit message or the logging be adjusted so they match, and
can the unreachable non-MQ branch be dropped?

> +		}
> +	}
> +	return rc;
> +}

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201190216.62407-1-mmc%40linux.ibm.com
Technical Details
Message-ID: <179649976030.3148.10183919613130315002@kernel.org>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378113-linux-kernel-netdev=dewy.ru
References: <20261201190216.62407-14-mmc@linux.ibm.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378113-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v9 13/13] ibmveth: Allow changing the RX queue count
Date: Sat, 05 Dec 2026 19:42:40 +0000
Organization: Usenet Network
Message-ID: <179649976030.3148.10183919613130315002@kernel.org>
References: <20261201190216.62407-14-mmc@linux.ibm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3107285"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:H1U+MGd5A7Ff/AerdZH8qswC9bs= sha256:X9rjlpJ5f05c/h0PLTmuztM5+2itZNtXeC3eVZtZnl4=
	sha1:fEdx7kHk3osVVjaSdrM9gDTMj/U= sha256:s6gUj4GPw3+v8G0308ijskUXEmxdHEDX8Ygp9ZZlFT8=
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 14330117E49; Sat,  5 Dec 2026 22:43:00 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.539
X-Spam-Status: No, score=-3.539 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, 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, URIBL_BLOCKED=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 0PPP3uUFr8o8;
	Sat,  5 Dec 2026 22:42:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378113-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 3544E117EA0; Sat,  5 Dec 2026 22:42:48 +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 5B61B32175; Sat,  5 Dec 2026 19:42:43 +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=1796499763;
	b=1AUtkaGSHCrD9h/xC56UJQG+00UeGr8sUYzcISJ2wPFVqK2o3dOnc8t73aHH65n3ABUm
	 wSQknb5UYTa9nSEA7kbPS9cFYQLjPaEjmS0+W9Xjl3UBXRe6aC1BOBTkJ9Wu1H60+fHcK
	 f83f3Rk/ba/k7gilBSoK+OaKtJNJyRulkdAE3Z3NmquMjvP1JZBJCL4igADDC6/q9D8qf
	 FQFiXo8YQOpUgUbBgR+B6c9AXTFpj+ZWNZZ3dhPKW2fXNczFYGDJ79pGtHKM52Oj/8RhC
	 6LXiw7JrBKv9yPDibpGipr9Ts6m1CmzwplLzv1OiVz1Amjg95ajN/3a6DR/+xnGcZgw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796499763;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=hcSs6T9s6B3CijUtHiPED85xwjdnS2OOVhvPw5K+PBg=;
	b=BmJ/CpLv76hbdN159rmr6USnURT6bFmzl+6/QdYA+kVH6omS0KQp2w0U3ORXZB5fqxsK
	 /WkMbhpQ7e3MBtjPDLcaRZeuE6nj9/SGbj34mXY3DoWUJBRAOQf4ZKX2u78mupFM/sUIK
	 efuwSgVGmY7lc1HKZxBRcjyu9OkhfkCwCUGP3jr+Ivxx2mTSDkZZEz1roTzMJDEV/Y+zp
	 SDEMt6obYHhEdcuwo9sUNb3VjObtknfLa71l/uIEWbMXUVTyYjQiZe+HQWD5t5PVDI3QJ
	 VBSZjFGibstl3XhffKtenR8I9LeO28MznxCGYSk7JFEe/7kx8y78q1KQeUX+lJ2w9aA==
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=LHf8ItsW;
	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 30C8E606A686;
	Sat,  5 Dec 2026 19:42:43 +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=LHf8ItsW
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=1796499762;
	b=wMscKnCndwjaWVH0McbffzIdLCp/x3yIE5Q65wEU1tN3uVTNOT7kxKDjTvPSJdv0OT8N
	 XJ/ihsPF23N9rqQKsOWs1PD52c9VwxbHcAgvX1IFIXc09nf4IV9Dv9slKh+5JEy02VYEe
	 OJYiGCH7u9MtRj/kLQO6dlOkNh4KyRIek0aUUfI8bfqEZ0r8xSCF4D/9rds7Zre+mImZS
	 6/bbaI8PfsaXX82sGP8bPh099HD/5OamE8tEmxT9/5oEBwq1i4397oY9B1zWllVfujLMb
	 Qr7OLpCAucarWGe6SB0yTGQyc44EeWvWVi1NrIGPqG9yeL8JitsSJDu28NvBIURmsVA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796499762;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=hcSs6T9s6B3CijUtHiPED85xwjdnS2OOVhvPw5K+PBg=;
	b=1fOPw1R/klVU3FIURjV/V/i568sww9CwOMVpWXGlJsxSaEdASHMWtY4tlJNZMTIqE82u
	 tMw0lELEDuHtsx/AE2gZxCfPwYB1FHJ9SKP7kbAzmf+6kULpm7eQZ3Pp/TbqWfwCclajy
	 Y9C+zdAmVUTZB5TDo9eMXVWUtadC8RN1FnD+uPApNh/eg+RgNbW6ugCY+9zzOgAUzt5th
	 nFU1CNf/1S1/8V1DMxa/cIyetdPSTwmZDpAxpxW5LmH98r6bOOAYE2stBoe0OwyeBRnVL
	 t8xGfYruMlWv0+Dwcv+1HURnG7DvHf46rShR21IrJwgeNgAqvsa9m0SndJdmWUYJJnA==
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=LHf8ItsW;
	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 50836606A330
	for <netdev@vger.kernel.org>; Sat,  5 Dec 2026 19:42:42 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7A831F0092B;
	Sat,  5 Dec 2026 19:42:40 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796499761;
	bh=hcSs6T9s6B3CijUtHiPED85xwjdnS2OOVhvPw5K+PBg=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=LHf8ItsWpkD2d6BUL5pDhRKNOZE6ZEYwSjki21LqHqnjzh1HnrJgiBPzZn0BI8Zel
	 clObW8NU40bsnxinBoMU8TuqtWe7TpJVCSJZZTrTc4HfZYpJZrQYtyZoh/R/fZf9c4
	 cqEAw61AoFfE/EaNl+80Hj/LbFbmpqV8DnOpBP5876h+H70ZqeRzloB0o6VcFAgIEG
	 r3Iu11zXgumHzXyztTwe48ZbnsgG5BgbsO4qaQUdRnY+NIZyl+wf/p8tIadcUpwRoN
	 Zn7I6NVvT0GAfUqeoeDXwSY0aYdm+GeAJS9pcJQZ+hdVioCmUxKLTyPUNFnc26qy9m
	 2htuzvAxoyhEw==
X-Cc: netdev@vger.kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au,
 npiggin@gmail.com, chleroy@kernel.org, ritesh.list@gmail.com,
 sshegde@linux.ibm.com, nnac123@linux.ibm.com, andrew+netdev@lunn.ch,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 linuxppc-dev@lists.ozlabs.org, horms@kernel.org, davemarq@linux.ibm.com,
 haren@linux.ibm.com, ricklind@linux.ibm.com, bjking1@linux.ibm.com,
 shaik.abdulla1@ibm.com, willemb@google.com
X-In-Reply-To: <20261201190216.62407-14-mmc@linux.ibm.com>
X-sashiko-severity: Low
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