From: Ratheesh Kannoth <rkannoth@marvell.com>
To: <davem@davemloft.net>, <gakula@marvell.com>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<sgoutham@marvell.com>
Cc: <andrew+netdev@lunn.ch>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, Hariprasad Kelam <hkelam@marvell.com>
Subject: Re: [PATCH v4 net] octeontx2-af: Block VFs from clobbering special CGX PKIND state
Date: Wed, 22 Jul 2026 13:14:00 +0530 [thread overview]
Message-ID: <amB0wMgK_DS0gIQM@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <20260721062907.784484-1-rkannoth@marvell.com>
On 2026-07-21 at 11:59:06, Ratheesh Kannoth (rkannoth@marvell.com) wrote:
> From: Hariprasad Kelam <hkelam@marvell.com>
>
> PF and VF NIX LFs that share a CGX LMAC reuse the same hardware PKIND
> programming. When HiGig2 or EDSA parsing is enabled, a VF NIX LF alloc must
> not reset the LMAC RX PKIND or default TX parse config over the PF setup.
>
> Add cgx_get_pkind() and rvu_cgx_is_pkind_config_permitted() so VFs skip
> cgx_set_pkind(), rvu_npc_set_pkind(), and NIX_AF_LFX_TX_PARSE_CFG updates
> when the LMAC is using NPC_RX_HIGIG_PKIND or NPC_RX_EDSA_PKIND.
>
> Fixes: 94d942c5fb97 ("octeontx2-af: Config pkind for CGX mapped PFs")
> Cc: Geetha sowjanya <gakula@marvell.com>
> Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
> Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
https://sashiko.dev/#/patchset/20260721062907.784484-1-rkannoth%40marvell.com wrote
>> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
>> index 6a0ce2665031d..d1de9c9894bdc 100644
>> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
>[ ... ]
>> @@ -1685,8 +1687,19 @@ int rvu_mbox_handler_nix_lf_alloc(struct rvu *rvu,
>> rvu_write64(rvu, blkaddr, NIX_AF_LFX_RX_CFG(nixlf), req->rx_cfg);
>>
>> /* Configure pkind for TX parse config */
>> - cfg = NPC_TX_DEF_PKIND;
>> - rvu_write64(rvu, blkaddr, NIX_AF_LFX_TX_PARSE_CFG(nixlf), cfg);
>> +
>> + pf = rvu_get_pf(rvu->pdev, pcifunc);
>> +
>> + if (is_pf_cgxmapped(rvu, pf)) {
>> + rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
>> + cgxd = rvu_cgx_pdata(cgx_id, rvu);
>> + mutex_lock(&cgxd->lock);
>> + if (rvu_cgx_is_pkind_config_permitted(rvu, pcifunc)) {
>> + cfg = NPC_TX_DEF_PKIND;
>> + rvu_write64(rvu, blkaddr, NIX_AF_LFX_TX_PARSE_CFG(nixlf), cfg);
>> + }
>> + mutex_unlock(&cgxd->lock);
>> + }
>
>Does this code leave the TX parse configuration uninitialized for non-CGX
>mapped interfaces?
>
>Because rvu_lf_reset() zeroes all LF hardware registers earlier in
>rvu_mbox_handler_nix_lf_alloc(), it appears that if is_pf_cgxmapped()
>evaluates to false, NIX_AF_LFX_TX_PARSE_CFG will remain 0.
>
>Will non-CGX interfaces like SDP, loopback, or representor interfaces need
>an else branch to ensure they are programmed with NPC_TX_DEF_PKIND?
>
>>
>> if (is_rep_dev(rvu, pcifunc)) {
>> pfvf->tx_chan_base = RVU_SWITCH_LBK_CHAN;
ACK.
pw-bot: changes-requested
prev parent reply other threads:[~2026-07-22 7:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 6:29 [PATCH v4 net] octeontx2-af: Block VFs from clobbering special CGX PKIND state Ratheesh Kannoth
2026-07-22 7:44 ` Ratheesh Kannoth [this message]
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=amB0wMgK_DS0gIQM@rkannoth-OptiPlex-7090 \
--to=rkannoth@marvell.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.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