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>
Subject: Re: [PATCH v3 net 04/11] octeontx2-af: npc: cn20k: Make default entries as x4.
Date: Fri, 24 Apr 2026 13:56:15 +0530	[thread overview]
Message-ID: <aespJ5nvW-pfeMFo@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <20260423104317.2707923-5-rkannoth@marvell.com>

On 2026-04-23 at 16:13:10, Ratheesh Kannoth (rkannoth@marvell.com) wrote:
> X4 profile users won't alloc x2 entries. Allocating x2 entries
> would cause under utilized subbanks(X2). Avoid this in X4 kex
> profile, all allocations will be from x4 subbank.
>
> Fixes: 09d3b7a1403f ("octeontx2-af: npc: cn20k: Allocate default MCAM indexes")
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>

>> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c b/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
>> index 8630a6a73387..97acba77ff88 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/af/cn20k/npc.c
>
>[ ... ]
>
>> @@ -4274,10 +4289,16 @@ int npc_cn20k_dft_rules_alloc(struct rvu *rvu, u16 pcifunc)
>>  	pfvf = rvu_get_pfvf(rvu, pcifunc);
>>  	pfvf->hw_prio = NPC_DFT_RULE_PRIO;
>>
>> +	if (npc_priv.kw == NPC_MCAM_KEY_X4) {
>> +		req.kw_type = NPC_MCAM_KEY_X4;
>> +		req.ref_entry = eidx & (npc_priv.bank_depth - 1);
>> +	} else {
>> +		req.kw_type = NPC_MCAM_KEY_X2;
>> +		req.ref_entry = eidx;
>> +	}
>> +
>>  	req.contig = false;
>>  	req.ref_prio = NPC_MCAM_HIGHER_PRIO;
>> -	req.ref_entry = eidx;
>> -	req.kw_type = NPC_MCAM_KEY_X2;
>>  	req.count = cnt;
>>  	req.hdr.pcifunc = pcifunc;
>>
>> @@ -4299,8 +4320,9 @@ int npc_cn20k_dft_rules_alloc(struct rvu *rvu, u16 pcifunc)
>>
>>  		req = otx2_mbox_alloc_msg_npc_mcam_alloc_entry(&pf->mbox);
>>  		req->contig = false;
>> -		req->ref_entry = eidx + 1;
>>  		req->kw_type = NPC_MCAM_KEY_X2;
>> +		req->ref_entry = eidx + 1;
>
>The VF fallback path still hardcodes req.kw_type = NPC_MCAM_KEY_X2. Does this
>violate the commit message's claim that "X4 profile users won't alloc x2
>entries"? When the first allocation attempt fails for a VF on an X4 system,
>wouldn't this retry path still allocate from X2 subbanks?
>
>Also, should the ref_entry here be masked with (npc_priv.bank_depth - 1)
>similar to the primary allocation path for X4 profiles?

AI review report: https://netdev-ai.bots.linux.dev/ai-review.html?id=9923f145-31df-46b0-84e8-b15f1e307ad2#patch-10
pw-bot: changes-requested

Simon suggested to remove this from net, and post it as enhancement when net-next opens. So Dropping it for now.
Will post it in net-next after fixing this comment.

  reply	other threads:[~2026-04-24  8:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23 10:43 [PATCH v3 net 0/11] octeontx2-af: npc: cn20k: MCAM fixes Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 01/11] octeontx2-af: npc: cn20k: Propagate MCAM key-type errors on cn20k Ratheesh Kannoth
2026-04-24  8:21   ` Ratheesh Kannoth
2026-04-24 10:54   ` Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 02/11] octeontx2-af: npc: cn20k: Drop debugfs_create_file() error checks in init Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 03/11] octeontx2-af: npc: cn20k: Propagate errors in defrag MCAM alloc rollback Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 04/11] octeontx2-af: npc: cn20k: Make default entries as x4 Ratheesh Kannoth
2026-04-24  8:26   ` Ratheesh Kannoth [this message]
2026-04-23 10:43 ` [PATCH v3 net 05/11] octeontx2-af: npc: cn20k: Align MCAM X2/X4 use with KEX profile Ratheesh Kannoth
2026-04-24  9:06   ` Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 06/11] octeontx2-af: npc: cn20k: Clear MCAM entries by index and key width Ratheesh Kannoth
2026-04-27  3:44   ` Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 07/11] octeontx2-af: npc: cn20k: Fix bank value Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 08/11] octeontx2-af: npc: cn20k: Fix MCAM actions read Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 09/11] octeontx2-af: npc: cn20k: Initialize default-rule index outputs up front Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 10/11] octeontx2-af: npc: cn20k: Tear down default MCAM rules explicitly on free Ratheesh Kannoth
2026-04-24  9:11   ` Ratheesh Kannoth
2026-04-27  3:53   ` Ratheesh Kannoth
2026-04-23 10:43 ` [PATCH v3 net 11/11] octeontx2-af: npc: cn20k: Reject missing default-rule MCAM indices Ratheesh Kannoth
2026-04-24  9:15   ` Ratheesh Kannoth
2026-04-27  4:18   ` 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=aespJ5nvW-pfeMFo@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 \
    /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