public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: <edumazet@google.com>, <sgoutham@marvell.com>,
	<andrew+netdev@lunn.ch>, <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<sumang@marvell.com>, <sbhatta@marvell.com>,
	<davem@davemloft.net>
Subject: Re: [net-next,v8,09/13] octeontx2-af: npc: cn20k: virtual index support
Date: Tue, 24 Feb 2026 10:17:49 -0800	[thread overview]
Message-ID: <20260224101749.015d6f89@kernel.org> (raw)
In-Reply-To: <aZ1DOQOswkO6bgmP@rkannoth-OptiPlex-7090>

On Tue, 24 Feb 2026 11:50:41 +0530 Ratheesh Kannoth wrote:
> > > +fail1:
> > > +	if (xa_insert(&npc_priv.xa_vidx2idx_map, vidx,
> > > +		      xa_mk_value(old_midx), GFP_KERNEL))
> > > +		dev_err(rvu->dev,
> > > +			"%s: Faled to roll back vidx2idx to old_midx=%u, vidx=%u\n",
> > > +			__func__, old_midx, vidx);  
> >
> > This isn't a bug, but there's a typo: "Faled" should be "Failed".
> >
> > Also, at fail1, the rollback attempts to insert into xa_vidx2idx_map to
> > restore old_midx. However, looking at the control flow, fail1 is reached when
> > xa_insert() to xa_vidx2idx_map fails. At that point, xa_vidx2idx_map has
> > already been erased, so the rollback target is correct.
> >
> > But fail2 rolls back using xa_erase() on xa_vidx2idx_map, which was just
> > inserted successfully. The rollback at fail1 should restore xa_idx2vidx_map
> > instead, since that's the only map modified when fail1 is reached via direct
> > return.
> >
> > Could the error path rollback logic be reviewed?  
> This is getting flagged every time. i dont see any issue in the logic. Am i missing
> any thing here.

Maybe rewrite the code to be less confusing and so that the LLM
understands it? For one thing the jump labels are supposed to have
meaningful names, not err1/err2/err3, or fail1/fail2

Also perhaps xa_store() could avoid the erase + insert dance?

  reply	other threads:[~2026-02-24 18:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02  7:45 [PATCH net-next v8 00/13] NPC HW block support for cn20k Ratheesh Kannoth
2026-02-02  7:45 ` [PATCH net-next v8 01/13] octeontx2-af: npc: cn20k: Index management Ratheesh Kannoth
2026-02-04 16:45   ` [net-next,v8,01/13] " Simon Horman
2026-02-04 16:57   ` Simon Horman
2026-02-02  7:45 ` [PATCH net-next v8 02/13] octeontx2-af: npc: cn20k: KPM profile changes Ratheesh Kannoth
2026-02-05  2:25   ` [net-next,v8,02/13] " Jakub Kicinski
2026-02-02  7:45 ` [PATCH net-next v8 03/13] octeontx2-af: npc: cn20k: Add default profile Ratheesh Kannoth
2026-02-02  7:45 ` [PATCH net-next v8 04/13] octeontx2-af: npc: cn20k: MKEX profile support Ratheesh Kannoth
2026-02-02  7:45 ` [PATCH net-next v8 05/13] octeontx2-af: npc: cn20k: Allocate default MCAM indexes Ratheesh Kannoth
2026-02-02  7:46 ` [PATCH net-next v8 06/13] octeontx2-af: npc: cn20k: Use common APIs Ratheesh Kannoth
2026-02-02  7:46 ` [PATCH net-next v8 07/13] octeontx2-af: npc: cn20k: Prepare for new SoC Ratheesh Kannoth
2026-02-02  7:46 ` [PATCH net-next v8 08/13] octeontx2-af: npc: cn20k: Add new mailboxes for CN20K silicon Ratheesh Kannoth
2026-02-05  2:25   ` [net-next,v8,08/13] " Jakub Kicinski
2026-02-02  7:46 ` [PATCH net-next v8 09/13] octeontx2-af: npc: cn20k: virtual index support Ratheesh Kannoth
2026-02-05  2:25   ` [net-next,v8,09/13] " Jakub Kicinski
2026-02-24  6:20     ` Ratheesh Kannoth
2026-02-24 18:17       ` Jakub Kicinski [this message]
2026-02-02  7:46 ` [PATCH net-next v8 10/13] octeontx2-af: npc: cn20k: Allocate MCAM entry for flow installation Ratheesh Kannoth
2026-02-05  2:25   ` [net-next,v8,10/13] " Jakub Kicinski
2026-02-24  6:24     ` Ratheesh Kannoth
2026-02-02  7:46 ` [PATCH net-next v8 11/13] octeontx2-pf: cn20k: Add TC rules support Ratheesh Kannoth
2026-02-02  7:46 ` [PATCH net-next v8 12/13] octeontx2-af: npc: cn20k: add debugfs support Ratheesh Kannoth
2026-02-02  7:46 ` [PATCH net-next v8 13/13] octeontx2-af: npc: Use common structures Ratheesh Kannoth
2026-02-05  2:24 ` [PATCH net-next v8 00/13] NPC HW block support for cn20k Jakub Kicinski

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=20260224101749.015d6f89@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rkannoth@marvell.com \
    --cc=sbhatta@marvell.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