🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19131

Re: [PATCH net-next v7 2/3] net: macb: implement ethtool_ops.get|set_channels()

#19131
From: Nicolai Buchwitz
Date: Thu, 19 Nov 2026 11:54
50 lines
10021 bytes
Hi Théo

On 18.11.2026 21:53, Théo Lebrun wrote:

> [...]

> @@ -3376,7 +3398,7 @@ static void macb_context_swap_start(struct macb 
> *bp)

> [...]

> +	if (new_ctx) {
> +		old_ctx = bp->ctx;
> +		WRITE_ONCE(bp->ctx, new_ctx);
> +		wmb(); /* ensure IRQ enabled below read the new context */
> +
> +		macb_init_buffers(bp);
> +
> +		/* Clear DQL (only on successful context swap). */
> +		for (q = 0; q < bp->ctx->num_queues; ++q)
> +			netdev_tx_reset_queue(netdev_get_tx_queue(bp->netdev,
> +								  q));
> +	}

The queues we just dropped never get their BQL reset, not on close or
open either. So after shrinking and growing again they can stay stuck.

Maybe just reset all max_num_queues here and in macb_close()?

> [...]

> +static int macb_set_channels(struct net_device *netdev,

> [...]

> +	ret = netif_set_real_num_queues(bp->netdev, num_queues, num_queues);
> +	if (ret) {
> +		if (running) {
> +			macb_free(new_ctx);
> +			kfree(new_ctx);
> +			macb_context_swap_end(bp, NULL);

swap_start() cleared TE, so HW is back at the ring start. Doesn't this
needs a gem_shuffle_tx_rings() like link_up does, otherwise Tx stalls?

> [...]

Regards,
Nicolai
Technical Details
Message-ID: <cc50263bc4f161b2fff96e04306868cc@tipi-net.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366988-linux-kernel-netdev=dewy.ru
References: <20261118-macb-set-channels-v7-0-2dbc00f686af@bootlin.com> <20261118-macb-set-channels-v7-2-2dbc00f686af@bootlin.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366988-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v7 2/3] net: macb: implement
 ethtool_ops.get|set_channels()
Date: Thu, 19 Nov 2026 12:54:12 +0100
Organization: Usenet Network
Message-ID: <cc50263bc4f161b2fff96e04306868cc@tipi-net.de>
References: <20261118-macb-set-channels-v7-0-2dbc00f686af@bootlin.com>
 <20261118-macb-set-channels-v7-2-2dbc00f686af@bootlin.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2863769"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:3ZFtltckOOMbxZ1i6RvEesfrbzA= sha256:B9A9foXV7FLbewxERbGP0d7HM0YhxHqvQqNOvq85fa0=
	sha1:TKdqx6Iy3c4CIX2Mwh1H2jYA/DM= sha256:7BNql3JCJUy5LBTAPphN1G+UEPdAdIg2yWUpKH3y7Jc=
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 7DA4F115607; Thu, 19 Nov 2026 14:54:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=tipi-net.de
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 zhiZTFd5Ap9O;
	Thu, 19 Nov 2026 14:54:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-366988-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 5F7E81155AD; Thu, 19 Nov 2026 14:54:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id AB4C96C6E87; Thu, 19 Nov 2026 11:54:20 +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=1795089257;
	b=Q4fJZyA0d5iw4vRkNGpuzAsb95z90gXKYimLSlcSE8Ipa6L/oF6O5RDUdYShtw7xTfO0
	 RVq8Pm17Qs0NDatV5A1QS1Xntfqmn1ax6YSDEBviZotVPhDyKXV5DvhXAsDIEj0AyCXAW
	 bNhSzFzTwgy0rOHNE7S5jW5vt4q9+4AH1Z4AtBbUI3Bh1R+btpbBj8lkacPUa/D+ktS/T
	 8PwA2daoRJ6mQWwBspa/0RMVwtn2r5aO/w9E9wbj6FcD80FPTkI9dtyPCHn+rqBczw404
	 qDv6GO+bU8+Ujxjz9IZlwmOI1j9fARYbMjCXiha/1ZrhZ8boaKBDyjWuW+LWmqb8CnA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795089257;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=kazK3jP8RDwEUVX6vo6nPdibxxigNipPp+bbhgW8KEo=;
	b=NXIWE1pRBdbqMceKQHRnDm77XnIWq2VWu2u5CZiig+UdNRoVmvq6noX2MzBOLR+E/qPB
	 qYdaWFSOnPFCBFBpgRKFg0F8A+xumqVaEwqw+fs2o5Xw8lKFmZstSUTlViqC8LIVexRhl
	 +DoPEjeZrIXz/B1usHqOKHwz/UDhK/vWYxLh+wQBSkKEiRLRxjQn7JF2lhs1O64aCdFrA
	 hFJpESKQ9P/DtiMThVxwxNJJU3kF7tr6FmSftQSwAcoMrTeOddpYo9fDXT0k/DrVAvoYq
	 XXZ9cc3KXsKKcy+9E70mKfGpIMDeK8juje0QmD/pCdbImFFfvgyY8O0+LjkG3DyVfaw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=SJnORjOz;
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	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 50811606A33D;
	Thu, 19 Nov 2026 11:54:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=SJnORjOz
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795089256;
	b=D/z1qusWCi5hFfRBQ+P5VRGSW4Jj9XceOGZLRyP6QFiiXfy9gd/8NQNpENY+yhXYl1Wz
	 JspQWrhN/JF1S3vgRmFYG5l2bLVFg+gyw08DLEJEOJF9waQhp3ZKYSWdRbtQKbykw6NPi
	 dpjiGVEfC1NGIsZiRUi4Q7XQ2XLLDG6THcazoPLvq0uOdAt/m+AGo5dHmWVps0V/4Ma8d
	 hlkbV16d1NykeuFSa5SLIF2EraCNCiUdISe59zWqgCVpl8LK6QFtQ8qRTRtSNwPOg7h4J
	 CeInGbtQyL/BwNf7sQYWEeohROHE/mXzhARA060SE4vfoqnD052KeoJyl0b6fW/7gig==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795089256;
	h=DMARC-Filter:Received:DKIM-Signature:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=kazK3jP8RDwEUVX6vo6nPdibxxigNipPp+bbhgW8KEo=;
	b=VshVQmt0yROfawmlVjkMli/lkzz14jANcrusbI9WTPNPsj9Qh8wMLvCZbiKULgAOEZ6u
	 QKcNViMZdrOLOWfvGEzZKNENKFm1J6gRO8b+1YMkqxIG7UYpp3N1JBkdBHwIUwKuAfaWZ
	 xwb9B7en9KimggsVa+ziTVYHsl76xUChDauZ+PgehZMiQGec+a1Xtid8F+hWosH+fzHIl
	 HXUeBNqPnINiAtCDEzCxbAgfXGKBOCZB9nEd2X8ACxSBLm1uz9e089H3nu4/hVfXHviW8
	 1ucFqRrdyYRZnbhe8G7a7bGU+ZG7ZJAW+wkOdROsi6zc4/AL5x9zPSH3YsHkaC0kP+A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=SJnORjOz;
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(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 00B53606A33C;
	Thu, 19 Nov 2026 11:54:15 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 00B53606A33C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 25344A1569;
	Thu, 19 Nov 2026 12:54:12 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1795089253; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=kazK3jP8RDwEUVX6vo6nPdibxxigNipPp+bbhgW8KEo=;
	b=SJnORjOzxVOkNj9XFT4lFk4txb+eNozSdMBVMMvo2/vtEKzeT7xm0xRECwMqyeQSyshOBR
	rPQapNrtV7EVeacZcacTePAgXQnpEUAEMSm5TikTxACW6j0ZM2/NOZYM4sUPoD4gjRYMKr
	d2IpQe4PwtEOouDFTRs+p5x3tfvoQXrRQR2zB1+oxih1/DsrSGtdpv1UXpJ9M4/pBtjuhD
	DFoSxvUY7evP5E2kSI1Fe59kJCvx5HrmjZ+NyCa6Ki0w7AbQfF5BF2zqzWxBlbb/jPiLeD
	B4795bSEP4CM/6qSZq2bNmfqWvaP4DBaL21c2hLx3I3FSePDtViTjz8OJE/lkg==
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
X-Cc: Conor Dooley <conor.dooley@microchip.com>, Andrew Lunn
 <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric
 Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni
 <pabeni@redhat.com>, Russell King <linux@armlinux.org.uk>,
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Valerio
 <pvalerio@redhat.com>, Vladimir Kondratiev
 <vladimir.kondratiev@mobileye.com>, Gregory CLEMENT
 <gregory.clement@bootlin.com>, Benoît Monin
 <benoit.monin@bootlin.com>, Tawfik Bayouk <tawfik.bayouk@mobileye.com>,
 Thomas Petazzoni <thomas.petazzoni@bootlin.com>
X-In-Reply-To: <20261118-macb-set-channels-v7-2-2dbc00f686af@bootlin.com>
X-Sender: nb@tipi-net.de
X-Last-TLS-Session-Version: TLSv1.3