public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ratheesh Kannoth <rkannoth@marvell.com>
To: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <sgoutham@marvell.com>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<andrew+netdev@lunn.ch>, Suman Ghosh <sumang@marvell.com>
Subject: Re: [PATCH v4 net 05/10] octeontx2-af: npc: cn20k: Clear MCAM entries by index and key width
Date: Mon, 27 Apr 2026 15:31:52 +0530	[thread overview]
Message-ID: <ae80EJ-oWJtyj_Ce@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <20260427063213.3937451-6-rkannoth@marvell.com>

On 2026-04-27 at 12:02:08, Ratheesh Kannoth (rkannoth@marvell.com) wrote:
> Replace the old four-argument CN20K MCAM clear with a per-bank static
> helper and npc_cn20k_clear_mcam_entry() that takes a logical MCAM index,
> resolves the key width via npc_mcam_idx_2_key_type(), and clears either
> one bank (X2) or every bank (X4).
> Call it from npc_clear_mcam_entry() on cn20k and log when key-type lookup
> fails. Use the per-bank helper from npc_cn20k_config_mcam_entry() for
> pre-program clears.
> For loopback VFs, use the promisc MCAM index as ucast_idx when copying
> RSS action for promisc, matching cn20k default-rule layout.
>
> Cc: Suman Ghosh <sumang@marvell.com>
> Fixes: 6d1e70282f76 ("octeontx2-af: npc: cn20k: Use common APIs")
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>

>> @@ -755,9 +762,15 @@ void rvu_npc_install_promisc_entry(struct rvu *rvu, u16 pcifunc,
>>
>>  	/* If the corresponding PF's ucast action is RSS,
>>  	 * use the same action for promisc also
>> +	 * Please note that for lbk(s) "index" and "ucast_idx"
>> +	 * will be same.
>>  	 */
>> -	ucast_idx = npc_get_nixlf_mcam_index(mcam, pcifunc,
>> -					     nixlf, NIXLF_UCAST_ENTRY);
>> +	if (is_lbk_vf(rvu, pcifunc))
>> +		ucast_idx = index;
>> +	else
>> +		ucast_idx = npc_get_nixlf_mcam_index(mcam, pcifunc,
>> +						     nixlf, NIXLF_UCAST_ENTRY);
>> +
>The commit subject and the Fixes: tag reference a cn20k-only change,
>and the comment added above says the new layout matches cn20k
>default-rules, but is_lbk_vf() is silicon-agnostic:
>    static inline bool is_lbk_vf(struct rvu *rvu, u16 pcifunc)
>    {
>        return (!(pcifunc & ~RVU_PFVF_FUNC_MASK) &&
>            (rvu->vf_devid == RVU_LBK_VF_DEVID));
>    }
>Is it intentional that this branch fires on cn10k and otx2 LBK VFs as
>well?
>Previously, for any LBK VF, ucast_idx was obtained from
>npc_get_nixlf_mcam_index(..., NIXLF_UCAST_ENTRY), which on non-cn20k
>falls through to npc_get_ucast_mcam_index() and returns the ucast
>slot.  After this patch ucast_idx becomes the promisc slot for all
>LBK VFs.
>The subsequent is_mcam_entry_enabled(ucast_idx) and
>npc_get_mcam_action(ucast_idx) now read a different MCAM entry on
>non-cn20k silicon, which can change whether an RSS action is
>inherited for the LBK VF promisc rule.
>Should this hunk be gated by is_cn20k(rvu->pdev), or is the
>behavioural change on cn10k/otx2 LBK VFs intended and worth calling
>out in the commit message?
This is intentional change.

  reply	other threads:[~2026-04-27 10:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  6:32 [PATCH v4 net 0/10] octeontx2-af: npc: cn20k: MCAM fixes Ratheesh Kannoth
2026-04-27  6:32 ` [PATCH v4 net 01/10] octeontx2-af: npc: cn20k: Propagate MCAM key-type errors on cn20k Ratheesh Kannoth
2026-04-27  9:45   ` Ratheesh Kannoth
2026-04-27  6:32 ` [PATCH v4 net 02/10] octeontx2-af: npc: cn20k: Drop debugfs_create_file() error checks in init Ratheesh Kannoth
2026-04-27  6:32 ` [PATCH v4 net 03/10] octeontx2-af: npc: cn20k: Propagate errors in defrag MCAM alloc rollback Ratheesh Kannoth
2026-04-27  9:56   ` Ratheesh Kannoth
2026-04-27  6:32 ` [PATCH v4 net 04/10] octeontx2-af: npc: cn20k: Fix target map and rule Ratheesh Kannoth
2026-04-27  6:32 ` [PATCH v4 net 05/10] octeontx2-af: npc: cn20k: Clear MCAM entries by index and key width Ratheesh Kannoth
2026-04-27 10:01   ` Ratheesh Kannoth [this message]
2026-04-27  6:32 ` [PATCH v4 net 06/10] octeontx2-af: npc: cn20k: Fix bank value Ratheesh Kannoth
2026-04-27  6:32 ` [PATCH v4 net 07/10] octeontx2-af: npc: cn20k: Fix MCAM actions read Ratheesh Kannoth
2026-04-27  6:32 ` [PATCH v4 net 08/10] octeontx2-af: npc: cn20k: Initialize default-rule index outputs up front Ratheesh Kannoth
2026-04-27  6:32 ` [PATCH v4 net 09/10] octeontx2-af: npc: cn20k: Tear down default MCAM rules explicitly on free Ratheesh Kannoth
2026-04-27 10:09   ` Ratheesh Kannoth
2026-04-27  6:32 ` [PATCH v4 net 10/10] octeontx2-af: npc: cn20k: Reject missing default-rule MCAM indices Ratheesh Kannoth
2026-04-27 10:13   ` Ratheesh Kannoth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae80EJ-oWJtyj_Ce@rkannoth-OptiPlex-7090 \
    --to=rkannoth@marvell.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sgoutham@marvell.com \
    --cc=sumang@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox