Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@kernel.org>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, Eric Dumazet <edumazet@kernel.org>,
	Qiliang Yuan <odys.yuan@gmail.com>
Subject: [PATCH net-next] veth: use peer attributes to set peer real number of queues
Date: Fri, 16 Oct 2026 18:03:51 +0200	[thread overview]
Message-ID: <20261016160351.3022939-1-edumazet@kernel.org> (raw)

veth_newlink() creates the peer from its own attributes (tbp), which
come from the nested VETH_INFO_PEER ifinfomsg when present, so the
peer num_tx_queues/num_rx_queues follow the peer IFLA_NUM_TX_QUEUES
and IFLA_NUM_RX_QUEUES.

veth_init_queues(peer, ...) is then called with the attributes of
the first device (tb) instead, so the decision to reduce the peer to
a single real queue is based on the wrong device:

  ip link add va type veth peer vb numtxqueues 4
	-> vb has 4 tx queues, but only 1 real tx queue.

  ip link add va numtxqueues 4 type veth peer vb
	-> vb keeps nr_possible_cpus real tx queues.

Pass tbp, which is tb when no peer attributes were given.

Fixes: 9d3684c24a52 ("veth: create by default nr_possible_cpus queues")
Signed-off-by: Eric Dumazet <edumazet@kernel.org>
Cc: Qiliang Yuan <odys.yuan@gmail.com>
---
 drivers/net/veth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 38f263d4f06b406eaf0a801334272cd438386c14..ba8953fef979aac3868d39c8fb9b19becb47d8e9 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1924,7 +1924,7 @@ static int veth_newlink(struct net_device *dev,
 	priv = netdev_priv(peer);
 	rcu_assign_pointer(priv->peer, dev);
 	netdev_hold(dev, &priv->peer_tracker, GFP_KERNEL);
-	err = veth_init_queues(peer, tb);
+	err = veth_init_queues(peer, tbp);
 	if (err)
 		goto err_peer_queues;
 
-- 
2.53.0


                 reply	other threads:[~2026-10-16 16:03 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=20261016160351.3022939-1-edumazet@kernel.org \
    --to=edumazet@kernel.org \
    --cc=davem@davemloft.net \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=odys.yuan@gmail.com \
    --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