From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id D189CCD3447 for ; Sat, 9 May 2026 11:06:54 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91A124026D; Sat, 9 May 2026 13:06:53 +0200 (CEST) Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by mails.dpdk.org (Postfix) with ESMTP id EAFA540269; Sat, 9 May 2026 13:06:49 +0200 (CEST) X-QQ-mid: Yeas9t1778324801t828t18730 Received: from 0F57A7141CBF4D1588B97A6ED8A17143 (zaiyuwang@trustnetic.com [115.204.251.157]) X-QQ-SSF: 0000000000000000000000000000000 From: =?utf-8?b?WmFpeXUgV2FuZw==?= X-BIZMAIL-ID: 12363965412987554375 To: "'Stephen Hemminger'" Cc: , References: <20260423034024.14404-1-zaiyuwang@trustnetic.com> <20260429102515.58880-1-zaiyuwang@trustnetic.com> <20260429102515.58880-12-zaiyuwang@trustnetic.com> <20260429081136.3defdeba@phoenix.local> In-Reply-To: <20260429081136.3defdeba@phoenix.local> Subject: RE: [PATCH v2 11/20] net/txgbe: fix traffic class priority configuration Date: Sat, 9 May 2026 19:06:40 +0800 Message-ID: <000e01dcdfa3$e9b30880$bd191980$@trustnetic.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIzGrJ934oa1ka+Tuv/tXGR6pozcwHnyBxIArpVolwBjXDnqrUnlckg Content-Language: zh-cn X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:trustnetic.com:qybglogicsvrsz:qybglogicsvrsz3b-0 X-QQ-XMAILINFO: N3IC8um5pMyYsQfPMPilZTMH1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RECHKSPAM: 0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > -----Original Message----- > From: Stephen Hemminger > Sent: Wednesday, April 29, 2026 11:12 PM > To: Zaiyu Wang ; Zaiyu Wang > > Cc: dev@dpdk.org; stable@dpdk.org; Jiawen Wu = ; > Ferruh Yigit ; dev@dpdk.org; stable@dpdk.org; = Jiawen > Wu ; Ferruh Yigit > Subject: Re: [PATCH v2 11/20] net/txgbe: fix traffic class priority = configuration >=20 > On Wed, 29 Apr 2026 18:25:05 +0800 > Zaiyu Wang wrote: >=20 > > After applying the following testpmd command, 802.1Q packets with > > specific priorities were not properly directed to the corresponding = traffic classes: > > port config 0 dcb vt off 4 pfc off > > > > The old driver had two issues: > > 1. The hardware uses a 4-bit mapping register per traffic class for > > priority-to-TC mapping, but the driver incorrectly configured it > > as 3 bits. > > 2. The DCB TX configuration mistakenly wrote to the RX register. > > > > Fix both issues, ensuring that tc-prio mapping works as expected. > > > > Fixes: 8bdc7882f376 ("net/txgbe: support DCB") > > Cc: stable@dpdk.org > > > > Signed-off-by: Zaiyu Wang > > --- >=20 > AI review spotted issues: >=20 > Error: The fix is incomplete. The same priority-to-TC layout is also = written in > drivers/net/txgbe/txgbe_rxtx.c around line 3380 in = txgbe_vmdq_dcb_configure(): > for (i =3D 0; i < RTE_ETH_DCB_NUM_USER_PRIORITIES; i++) > /* > * mapping is done with 3 bits per priority, > * so shift by i*3 each time > */ > queue_mapping |=3D ((cfg->dcb_tc[i] & 0x07) << (i * 3)); >=20 > wr32(hw, TXGBE_RPUP2TC, queue_mapping); > This writes the same TXGBE_RPUP2TC register (0x019008) the patch is = fixing, > using a hardcoded i*3 shift and a comment claiming 3 bits per = priority. After this > patch, txgbe_dcb_config_rx_arbiter_raptor() encodes priorities at = 4-bit positions > (via the updated TXGBE_RPUP2TC_UP_SHIFT=3D4), but = txgbe_vmdq_dcb_configure() > still uses 3-bit positions. The VMDQ+DCB path will produce a wrong = tc-prio > mapping. txgbe_vmdq_dcb_configure() needs the same fix (use > TXGBE_RPUP2TC_UP_SHIFT and update the comment). > Warning: TXGBE_DCBUP2TC_DEC and TXGBE_DCBUP2TC_MAP are now > inconsistent. After this patch: > #define TXGBE_DCBUP2TC_MAP(tc, v) LS(v, 4 * (tc), 0x7) > #define TXGBE_DCBUP2TC_DEC(tc, r) RS(r, 3 * (tc), 0x7) > DEC will not decode what MAP encoded for any tc > 0. = TXGBE_DCBUP2TC_DEC > isn't currently used in tree, so this is not a runtime bug, but it's a = latent trap. Either > update DEC to also use 4*(tc), or remove DEC since it has no callers. >=20 Hi Stephen, Thank you for the thorough AI=E2=80=91assisted review. I really = appreciate it. I have addressed all the issues you raised, and an updated patch set = will be sent shortly.