Article View: linux.kernel.netdev
Article #23862Re: [PATCH net-next v9 2/3] net: macb: implement ethtool_ops.get|set_channels()
From: Nicolai Buchwitz
Date: Sat, 28 Nov 2026 12:52
Date: Sat, 28 Nov 2026 12:52
43 lines
9984 bytes
9984 bytes
Hi Théo
> [...]
> @@ -3405,16 +3427,28 @@ static void macb_context_swap_end(struct macb
> *bp,
>
> lockdep_assert_held(&bp->mac_cfg_lock);
>
> - /* Swap contexts & give buffer pointers to HW. */
> + /* Swap contexts & give buffer pointers to HW.
> + * !new_ctx means that the swap failed and we keep the old context.
> + */
>
> - old_ctx = bp->ctx;
> - WRITE_ONCE(bp->ctx, new_ctx);
> - wmb(); /* ensure IRQ enabled below read the new context */
> - macb_init_buffers(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->max_num_queues; ++q)
> + netdev_tx_reset_queue(netdev_get_tx_queue(bp->netdev,
> + q));
> + } else {
> + gem_shuffle_tx_rings(bp);
> + }
Under load the frame at txq->tail can already be sent, so index 0
has TX_USED after the shuffle. Doesn't Tx stall there?
Maybe reclaim completed frames before the shuffle?
> [...]
Thanks,
Nicolai
Technical Details
Message-ID:
<a541c74979251cfff2494537f8d42ece@tipi-net.de>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-373118-linux-kernel-netdev=dewy.ruReferences:
<20261127-macb-set-channels-v9-0-0b3addec7886@bootlin.com> <20261127-macb-set-channels-v9-2-0b3addec7886@bootlin.com>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-373118-linux-kernel-netdev=dewy.ru From: nb@tipi-net.de (Nicolai Buchwitz) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v9 2/3] net: macb: implement ethtool_ops.get|set_channels() Date: Sat, 28 Nov 2026 13:52:49 +0100 Organization: Usenet Network Message-ID: <a541c74979251cfff2494537f8d42ece@tipi-net.de> References: <20261127-macb-set-channels-v9-0-0b3addec7886@bootlin.com> <20261127-macb-set-channels-v9-2-0b3addec7886@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="950029"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:T2woxdik3/46DCeDUXnsFroxpKA= sha256:VnvfAIApZLAxasmRMZomWg8XJXBkQ1BHlbdd8Vs8oQs= sha1:+fjAi/rzzoXTQ3AFiBIoaqp5w6U= sha256:XwXabfUHNl4Ukeas0avaH2MLZrOLOtPEPcT65OXqY/g= 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 9260C125F76; Sat, 28 Nov 2026 15:53:10 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, 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 yglsyMTUOlZg; Sat, 28 Nov 2026 15:53:07 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-373118-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 7ED2B125F7D; Sat, 28 Nov 2026 15:52:56 +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 0C649295A7; Sat, 28 Nov 2026 12:52:54 +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=1795870373; b=E+7PZPwKTZoJeT3bVgU2QB9UWUGtpmfKdHNEmkBo/jdBRRKYSvlJae0/+VjspftuVCL1 c7wl7xCD9Uf7GTiC+a9NQm87iLE9ZcMa+QXKVL+s/Rg6qNCYlF75K7vOlnWLtrifAOMPC vVsXl/zZnGH+WdH39zeWiE055njbUjbsU1qBIOVcCRKB1tdUuqfbdstDlvt5KblTB4qcg BHdkTCXQwhn3+yfSYPo+88b7obgC409yjGQJMlV9c8OrFzHlTS47XQU6u9zYGJ8ee7sD1 f36e9MgWsnSyf3FfQe0J0Jc/epKrr2kfiuoI1ty0Gx7+ux4VVnwknprDRg+3dxNs2xQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795870373; 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=yLW/dyD8I6PEk1YDdZv/3axmWhb2lbqGvW4A3W54gqw=; b=sLEM64ee2QfHXaL9HF16rxBz/Ut1x6vogh9qAeeqCrwG34ipiFgtXzC8SDvZg/fkTJ8f T4Ztuxx/wVPbPrB4XLCHBqjQ/REu4nOILNa6VVC51z1xsyl/4Kruwsze19qEexo+ccDcA GXSVR0gcWEXxwRCdJr4aTomiPxjS2yNNACChMNURFz/XSDVVS1MFlkXRUKiVC5nXA1h2A aFM10zx452dW7+Sng6J4oGqyyrs8+2xqu7EyMADNKe3J+kHDdoCYIxZpwxPNYm3sKM9n0 h6CGcrVT3heZQ/69vzJTs3K59yKf1FUF31UrknPRmaPqVebx3n1Ed7391cM5NDemV2Q== 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=r55aQfUH; 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 A0561606A32D; Sat, 28 Nov 2026 12:52:53 +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=r55aQfUH 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=1795870372; b=5fGHye1tjgUyjGMKANR38YVGpqOwVumM3nVaxUsz3ZXm8kXJ31k+TzgBeO0cRlpp7D33 ftJ703L5NCE0wyMaT78hNDN2ESjnD/BIpcqr//mm6C398E0czBcydIhBy7ftvl9JmctFz qIS7CAWdyROKZ1A5RtQ5amqfVgOHRPBXYOHjxUigxSzUFhZmy2RHazHlYMAnBS6Mldu/I P/nYjgN5jIHvpIQzpOZ0oY2Y+LctpG1VlQNOXVNdVO4Vk6H52NEoArwfAWl/BPx+3nPSP ZTP50xEF4zbdgRt56trhFG3/H+GT6H5l5w7uaz1j+6LPoBPj7w0LvE+5WN6Mniy8LQg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795870372; 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=yLW/dyD8I6PEk1YDdZv/3axmWhb2lbqGvW4A3W54gqw=; b=HTyibniGB79tXAJta54CbbsbtF4cj0TOB5gmsRfR3riDcMSex86PaCpdaCimKZNdYon9 RN5zgLXH/dY2ikSs9axxIGVylwPwKMpsXTN9klqlOnhyD3OCjCkJZ/haUftTvXHOT5f/x xbQQD8l7IK4Df4Kx4Sg2EFAXxaQpPIcxaK8+rODKvIM4KEyonZXHN+VA3Ar+93OgdgreP cIkAVk75HEGppht4jyhfVC8ZMkLfFzuMWuMGPal4wNTsC5bfWpVZJep2UOEyizI73BmyC 1Gq1sM5KOPrIWAVmM2gwv91KH+WC7ghxs2GlfRwK8Y2Hf+mwQtVNNRRjbiC7EL4JzcQ== 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=r55aQfUH; 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 4FA7F606A31F; Sat, 28 Nov 2026 12:52:52 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4FA7F606A31F 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 48118A0011; Sat, 28 Nov 2026 13:52:49 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1795870369; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=yLW/dyD8I6PEk1YDdZv/3axmWhb2lbqGvW4A3W54gqw=; b=r55aQfUHJMuYaaZACVD3ZWVg+sKHEcw2eZYaXIxordLm6MDWKTzov+zDXenxXz+8FieGb8 +TqY8Zwgbw/2Fg6Iu/jmI/bQRN059J5C5BCu+lm46zh9L5O+WZcV2djEMNk1d9WjqdzPit /ecXS0I3P0Ma35TVV5LwDpHS3wSpcyMJmdzo6085yRrTC0dUel05hfLEe+nWOfWUrT1ogQ yC9NVybRT/x/2sD0pYHLAq62IlD22Q+xcGKp7+0SASHA2l+3Cpm8tZruMK+x23y1yjO5QL PzjKRFB9JqS1USGsO1r3oHvYP1adMJ9a50OfEoRYtGjqHtcDmK+AqEjOBkdYfA== 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>, Vineeth Karumanchi <vineeth.karumanchi@amd.com> X-In-Reply-To: <20261127-macb-set-channels-v9-2-0b3addec7886@bootlin.com> X-Sender: nb@tipi-net.de X-Last-TLS-Session-Version: TLSv1.3