🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #15503

Re: [PATCH net] octeontx2-af: Fix keep PF_FUNC match for AF TX rules in rep mode

#15503
From: netdev-bot+sashiko
Date: Thu, 12 Nov 2026 22:52
142 lines
13457 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 0 · Low: 3

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] The fix is incomplete.
- [Low] The commit message gets the scope of the bug wrong.
- [Low] The Signed-off-by chain is malformed.
- [Low] The comment above the changed condition in npc_update_tx_entry()
  (drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c) still reads…

--

octeontx2-af: Fix keep PF_FUNC match for AF TX rules in rep mode

When rep_mode is enabled, npc_update_tx_entry() no longer clears the
PF_FUNC mask for TX MCAM rules that the AF installs. Those rules now
match on the target PF_FUNC instead of wildcarding it.

> Currently, npc_update_tx_entry() clears PF_FUNC mask for AF-requested
> rules. In rep_mode, that wildcard can make a TX rule match traffic for
> other representors on the same TX interface, which can steer egress
> traffic through the wrong rule.

[Severity: Low]
Is this the full impact of the old behaviour?

For rte == true, rvu_rep_install_tx_rule() only sets req.vf. It never
sets req.features:

	if (rte) {
		req.vf = pcifunc;
	} else {

npc_update_flow() returns early when features is 0, so PF_FUNC was the
only key field for these entries. With mask = 0 the key was empty. Each
of these entries then matched all egress on the NIX TX interface from any
PF/VF, not just representor traffic.

In practice, the lowest-indexed TX entry would take all TX traffic and
loop it to LBK with the first representee's tag.

All representors also share one PF_FUNC (rvu->rep_pcifunc), so PF_FUNC
was never what told "other representors" apart.

Since this patch carries a Fixes: tag, could the commit message describe
the actual impact?

> Fixes: 683645a2317e ("octeontx2-af: Add packet path between representor and VF")
>
> Signed-off-by: kmahammadraf <kmahammadraf@marvell.com>
> Signed-off-by: Aditya Thapliyal <athapliyal@marvell.com>

[Severity: Low]
This isn't a bug, but the Signed-off-by chain looks off. The author is
Aditya Thapliyal, but the first Signed-off-by is from kmahammadraf and
there is no Co-developed-by tag.

Per Documentation/process/submitting-patches.rst, should there be a
Co-developed-by: line right before that Signed-off-by? Or should From:
name that person instead? The DCO also asks for a real name, and
kmahammadraf looks like a username.

There is also a blank line between the Fixes: tag and the Signed-off-by
block.

> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> index ec004ea5154cb..4afd4a10cd649 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> @@ -1396,7 +1396,7 @@ static int npc_update_tx_entry(struct rvu *rvu, struct rvu_pfvf *pfvf,
>  	/* If AF is installing then do not care about
>  	 * PF_FUNC in Send Descriptor
>  	 */
> -	if (is_pffunc_af(req->hdr.pcifunc))
> +	if (is_pffunc_af(req->hdr.pcifunc) && !rvu->rep_mode)

[Severity: Low]
This isn't a bug, but the comment above this condition still says the AF
does not care about PF_FUNC. With this change, AF-installed TX rules in
rep_mode match PF_FUNC exactly. Should the comment mention the rep_mode
exception?

>  		mask = 0;
>  
>  	npc_update_entry(rvu, NPC_PF_FUNC, mdata, (__force u16)htons(target),

[Severity: High]
Does this stop representor egress from going through the wrong TX rule
when there is more than one representee?

For rte == false, rvu_rep_install_tx_rule() uses the same target for
every representee. It relies on sq_id to tell them apart:

	} else {
		req.vf = rvu->rep_pcifunc;
		req.packet.sq_id = vlan_tci;
		req.mask.sq_id = 0xffff;
	}

req.features is never set, and npc_update_flow() returns right away when
there are no features:

	if (!features)
		return;

As far as I can tell, nothing in the AF uses sq_id. It is declared in
struct flow_msg in mbox.h and written in rvu_rep.c, and that is all.
There is no NPC key field for it either.

With this patch, PF_FUNC == htons(rep_pcifunc) is the only key field in
every rte == false entry, so all of these entries have the same key.
rvu_rep_install_mcam_rules() installs them at increasing indices, and
the lowest-indexed matching entry wins.

On the NIC side, rvu_rep_xmit() sends traffic for every representor from
the same representor PF. It picks only the SQ, based on rep_id:

	sq = &pf->qset.sq[rep->rep_id];

Wouldn't all of that traffic hit the first rte == false entry? It would
then get that entry's vtag0_def (the first representee's rep_id), and the
RX rule that matches on vlan_tci would deliver it to the first
representee.

The unused sq_id match dates back to 683645a2317e. Still, the commit
message says this patch stops a TX rule from matching traffic for other
representors and steering it through the wrong rule. That still looks
possible in the representor to representee direction.

Does the SQ id need to be added to the MCAM key to fix this, rather than
only changing the PF_FUNC mask?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261109105043.1986921-1-kmahammadraf%40marvell.com
Technical Details
Message-ID: <179452392874.2199510.9170447818850423839@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362241-linux-kernel-netdev=dewy.ru
References: <20261109105043.1986921-1-kmahammadraf@marvell.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362241-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] octeontx2-af: Fix keep PF_FUNC match for AF TX rules
 in rep mode
Date: Thu, 12 Nov 2026 22:52:08 +0000
Organization: Usenet Network
Message-ID: <179452392874.2199510.9170447818850423839@kernel.org>
References: <20261109105043.1986921-1-kmahammadraf@marvell.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1229296"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pBs0EI8k2DrH3T9z2iFY8LP6cig= sha256:aoflSQriHPb6rO31PyoXKBzMHOh77xIDXUWvwZJ81Zk=
	sha1:9ka7onBvjOVBGXhfRMktgxJF6q0= sha256:Bs4Z/xG92tNG7UNyQ6JeIpGuBbI01aCYpdy+086q65k=
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 78AAD1143DE; Fri, 13 Nov 2026 04:55:03 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 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, URIBL_BLOCKED=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 mle2rNh0k_3i;
	Fri, 13 Nov 2026 04:54:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-362241-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 4786311439D; Fri, 13 Nov 2026 04:54:51 +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 BC555CFA60; Thu, 12 Nov 2026 22:52:13 +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=1794523931;
	b=r1s4cPEFpGYmIYQDUMD+PxfNgCrapMkBLijjU/NzF4iOoJZX+3v7r4L0z8BDyUX702wk
	 Bq2QjDzhBnDWR7AQurOoDGbO6jecACCG8e19EZ2EAeIbh6modt//THb+yR2YrwMSqovSY
	 nd9a22CR01pnsfRAViBQRxcskzEEKTwTtFy2YQbBtLB99QBl5WjOUeEWiVLhfbi1iqXQ3
	 vVdMMlS6dsDqC9NsJ41zaZVep+DHXz2/DFPSYrFeeLoWtM79hhOHxu+KnGr5IHC9nuiiG
	 RMZC2ir+JVtttkmHJZInHi8yPi5H8lB+Q4B5NKB8firPzLHjyiHlKveqnHTkxOyghkQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794523931;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=HnFbRd2cUO/ogYhoab3tVa+ZjsPjiekhdbMq6gcnrhc=;
	b=pEcpWVz7Vd6NKvhyw02uZMK+gIRdyBrFQKqLIf2JFFK3l2PzK48Ms4eZ1bKkBBUsIyEq
	 OqtiV0+bQtkAQdG8BtV0Kwyrtomwff+wOEgjyKAW7GTKzukRrvr5XnpX5vEQJiPVyAMnT
	 eWPf92gP0lc87nyoxycNUlc4COZy3nx7ifBty8lgsSsu3CakU/zdTkNZpxCVKolfpB8cv
	 j36JLrrNkjR43GTt7cSGk6R5mwehbCC1WKU1wr0MNKXtXQ4t+GX3JBZSwtAv3VK0LreH9
	 QNfMukBBI+xugKFBH0XtOd0QUK1vnMD3vQfazoB+DuzHu4MFl86IQcI0dtSSEh/xSNw==
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=lyqW2l4i;
	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 ED3CB606A334;
	Thu, 12 Nov 2026 22:52:10 +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=lyqW2l4i
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=1794523930;
	b=f3x9OaC7BBW6HERZok8Yc1cjQD1heUtGL4n8L6uxHOh7sfbyHp3REQpdpxcHdz8pnRXq
	 A/lBtifm8P7tI9bhy5loPxInGJ6poo5OFn0od+GtPT5Kpo+2aGRRNLhsJR1fZzWZTDGnv
	 uHJenXVzg57eVqSU47WZMcg4hW/jkBhQeUnyRXKyvV6Pdn9dnS0IV7V6gHafkmfd0zyFJ
	 T7eE8xYqewYt4ZDJmekokkvWOrie/rGmjx49OzIWKPIG42UD2YE08qln4tGwYLgYQvubJ
	 e9LKokzS1GJw/z+oOB9CM71JCkeW3C0/isoCw7cc0via3wMTEP1khvJ4Wu89LGqHXMA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794523930;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=HnFbRd2cUO/ogYhoab3tVa+ZjsPjiekhdbMq6gcnrhc=;
	b=Tuprn6H9ihx0b9Dn8i0iPwV0nylfyUTrvYQ4+DHAyrLyoVIfSXU/WrnhkJi+u5ZYReTU
	 1EEyFiLBZOHwVWj9aZhhiGrxzLaRux387HelyrazaHMoAFlEf/Bj3l0vqV41ElYUC/iFu
	 2rGps5TyczhH93gAXh47zG8VOEBmbiRz40cWmmkAa17WO7YTSD3w90eFJmTx/jQ2FeVCb
	 wWTT2F7eKrkHiT4/Mc+38NGfjA3Iu7jGoJ4Lj0X0bnJMLHWliR+7otOs/pkBA3BL+f85a
	 nEgnEmnFiDrhGa89HPKZ7KPJxn1Jgaw5Ahm5ocoZ027HKQ3AfcyPxI8wDk7r47jRt7w==
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=lyqW2l4i;
	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 16409606A31C;
	Thu, 12 Nov 2026 22:52:10 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ADA11F000C4;
	Thu, 12 Nov 2026 22:52:09 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794523929;
	bh=HnFbRd2cUO/ogYhoab3tVa+ZjsPjiekhdbMq6gcnrhc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=lyqW2l4iaa67g+0HwmN2Un9DQV8xTfYC5uFM8H/wCiCRuJF5mmzuk3Fb/eY9CAJ+S
	 u/NKBauFdVPRcJ/TEd8jVyF5VB37guMqFWqHiNqt1tIvK1ERYT7hIuqHqs0CoY+JW/
	 xzoqMLE4i+cvyhdTFXIFi9rtMC+Ezj0d0FZFcG6j0k1vg7fzFRh8wtJZuUNqW9jGlG
	 TU7K0qFkNhz0tWH7/zi7K+mCZKNQ48oTOJdfGSPz5qo0vJglUuD8FVNq0jrfBmxcML
	 PtbACUSVHhtYsz+CZMRec7a9+VkXTRS6F2IaLrAU3FjzqXJcVsJCnUqlPDEctTyipP
	 IMEDqDRG5HZrA==
X-Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, sgoutham@marvell.com,
 rkannoth@marvell.com, gakula@marvell.com, sbhatta@marvell.com,
 andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, athapliyal@marvell.com
X-In-Reply-To: <20261109105043.1986921-1-kmahammadraf@marvell.com>
X-sashiko-severity: High
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