Article View: linux.kernel.netdev
Article #22477Re: [PATCH net v8 2/2] net: wangxun: access queue counts consistently
From: Simon Horman
Date: Wed, 25 Nov 2026 11:30
Date: Wed, 25 Nov 2026 11:30
34 lines
9431 bytes
9431 bytes
On Wed, Nov 25, 2026 at 09:36:46AM +0800, mengyuanlou@net-swift.com wrote:
>
>
> > 2026ๅนด11ๆ24ๆฅ 19:24๏ผSimon Horman <horms@kernel.org> ๅ้๏ผ
> >
> > On Wed, Nov 18, 2026 at 04:13:29PM +0800, Mengyuan Lou wrote:
> >> Queue-vector teardown clears wx->num_tx_queues and
> >> wx->num_rx_queues while the netdev can remain registered. Lockless
> >> readers may use these counts as ring-array loop bounds while teardown
> >> is clearing the ring slots. wx_xmit_frame() also uses the Tx count to
> >> select a ring and must not divide by zero during teardown.
> >>
> >> Use READ_ONCE() to take a single count snapshot in the lockless readers,
> >> and use WRITE_ONCE() for queue-count updates during scheme setup,
> >> teardown, and allocation-error handling, including the VF queue setup
> >> callbacks. Keep the existing NULL checks so a reader that observed an
> >> old non-zero count can safely skip ring slots that have since been
> >> cleared. wx_xmit_frame() retains its zero-count guard before
> >> queue-index modulo.
> >>
> >> Fixes: 3f703186113f ("net: libwx: Add irq flow functions")
> >> Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
> >
> > This patch feels more like hardening for net-next than a fix for net.
> > But regardless the code changes look good to me.
>
> I think so.
> Should I resend this patch?
Thanks,
IMHO, it would be best to split the series in two: one patch for net and
one for net-next. And resend both.
Technical Details
Message-ID:
<20261125113050.GS31322@horms.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-371263-linux-kernel-netdev=dewy.ruReferences:
<20261118081329.39551-1-mengyuanlou@net-swift.com> <20261118081329.39551-3-mengyuanlou@net-swift.com> <20261124112414.GJ31322@horms.kernel.org> <15430CE6-8AD6-43CF-AACF-1434B5EB666F@net-swift.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-371263-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v8 2/2] net: wangxun: access queue counts consistently Date: Wed, 25 Nov 2026 11:30:50 +0000 Organization: Usenet Network Message-ID: <20261125113050.GS31322@horms.kernel.org> References: <20261118081329.39551-1-mengyuanlou@net-swift.com> <20261118081329.39551-3-mengyuanlou@net-swift.com> <20261124112414.GJ31322@horms.kernel.org> <15430CE6-8AD6-43CF-AACF-1434B5EB666F@net-swift.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="193822"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:oFaczxTVQfMipZsr/rQpG5G8kjc= sha256:GgVuwy40uwy1wBVXDbj/bOjQPUuDD6+H+tRg+FmepdE= sha1:sJybNoCdlNZF/T3UkvN7JQL2AQc= sha256:FVX6a8fFZoqRD9j55ASDvQafFw14nGbnney2FjERPJY= Content-Disposition: inline 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 19FC5125E59; Wed, 25 Nov 2026 14:31:11 +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 Xtjq-uKQFYx3; Wed, 25 Nov 2026 14:31:08 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-371263-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 B7E05125E55; Wed, 25 Nov 2026 14:30:58 +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 0EB6D2B353; Wed, 25 Nov 2026 11:30:56 +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=1795606255; b=yZKzTrpfMed+lkpYzb1aBY/K9Q7MQ5bYJQW4YigiUaMGXHoaxcD3EWM4PCPnuupj3i3g YS2XGVBzMl/06vTImKk0ZVslOZb6Ydp1cgSPbuY67lWcGibIuheXAT/1K7gv8IlREduBX 2//KNUJB2wWjJgfMPnU28UTbUUf64rRKCRCNgXIvFp8xU+IJG8phwZ2+yfXhTiU5qRMzS BrDXPjYLfPAgrQzNdIRZ3819xtMY1rz0Occ+2vmQpDbEdRmtFCEvxNBDCQT6v0+3s6ANP sgZtzPluGHVHr/w+ughV3H3LOPaP1a/hTbbf+yX3rpX6o3g5hPurXBAKa2tTBmIQ5Vw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795606255; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=ZD2E+lKFMmXf4Beo6gPq5BSgGW1LqR9dsVooOtj5qig=; b=EJ9/KZqTHYrHWv4tI+5c3ylJM+sDZpjr7Uagzl9pDyiUIBUqnuc2JsMjL92khwPxCktD qsHTuzdGb2xq2icjGacayaTYIf0SUfHRNR5KoLGTe+d3tilI/BFnDbsLjH2k0Dh+/LO1C XN1/ESx/lxQmplasnNMdFB1Az03gWMu8J3pGVD+vkOUKIyp+VvmcH7Cg/QaOQZPPjmzy9 nDK9Zx1FthgkZPRW461j+GmSMeKEMChtTsvPHGXNH61L2kwFGMaFvYGh2NXk0+nublcJH wiKwRQuXJ3xLcoqlgMFMjKAdcFRdP44WHBFdgHKqwgoF4wNenISgWemLod2uOJjpttA== 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=CslDEfQ8; 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 DB0AB606A326; Wed, 25 Nov 2026 11:30:55 +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=CslDEfQ8 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=1795606255; b=zYcXm/zTuBLBV9IQo5jZtwgqUqo467Yg2gx4WXwmBcqTghGypLWTu/2j026qL/mEtMRN IOizTTVLBbC0J8iRKpXcQeWaXI7F7d6MrJuPeuDpTEGYO1dGR8CE0TEe5lRnWuKDzEwN9 wtV9NlTVEaswD4Cq6GWt2PcDPO6MgDhUuTWE5k2hWQukZR9RB8vzNNV+s20VBYtGWMH0+ mxr9FW39BKybnezPcwXXXyJsbRHF3Y8sTCSALtP5NxvWJif2D1gXzwboGoGgdL4bPVnff SknVlMGyPKT5ah6W+1Y3esS4GLVTZv7RCOUlXdxoom2NlMOMHDEZht1jDmto4+lViPQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795606255; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=ZD2E+lKFMmXf4Beo6gPq5BSgGW1LqR9dsVooOtj5qig=; b=A3rCviEsJvajPS1+pvf/ZOabvPESrCs5/WLUTsQ2v6o2mN9s/f30YrqrF4uhmua9GKWe HuaucsRwliLCnn3nyYXq0Jrm480tVC5BcDyMYOI12/Hq8OeixBDGTHLweDw5bLa7jeUkn CRpzyNP0keESQj7964tE5nDfFudbCxbaxfHIE/zZgBAd9miTzt6cHTH07F+Chf0xomDP4 tMXO1ikTG5M2lK+RZPyGSjxTuQGOi4AEMi2xQjQw6TcSfzg5vYw9zPcHgkw3ea21W7tld E0Rgu72kX11ZGJzHGJ3FOOxM168CI0MHrMEcF92qH60EtAMrmYny5l9I0+sE9uND7TA== 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=CslDEfQ8; 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 042E4606A321 for <netdev@vger.kernel.org>; Wed, 25 Nov 2026 11:30:54 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C3B11F000C4; Wed, 25 Nov 2026 11:30:52 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795606254; bh=ZD2E+lKFMmXf4Beo6gPq5BSgGW1LqR9dsVooOtj5qig=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=CslDEfQ89vw76YLwuCGM8/PuujKqerK1vXjRPnnuw7GHrV7lWrGG3JPpv6xXNlnFJ 2wlyId6tnFnLWF/o12CNYLQAoPY/Sxk14BSRFTN4Aj0k6La8rwbIbbwQug45OVATN2 v3NF/5+6HL2vT9YrslfhFxRUUyvXcb7gFJLdh5Bz58RdkjdJHyR07I25XfCKKV1v0g hq/w+wM8kBmPY6laBb83uP/Ja4A1Mnlq8L6roKohcuJlZ47MiR++1HqUoBnqjSOK8I qLTl/6x27LBLl1p1kAiRJr9AyOhBuTDDNRcQ5CXxCT5hRz3WrvzrdIvn6A/gMNhj4q qjw5GqtlQebaA== X-Cc: netdev@vger.kernel.org, jiawenwu@trustnetic.com, duanqiangwen@net-swift.com, linglingzhang@net-swift.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, hramamurthy@google.com, jacob.e.keller@intel.com, przemyslaw.kitszel@intel.com 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-In-Reply-To: <15430CE6-8AD6-43CF-AACF-1434B5EB666F@net-swift.com>