public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ratheesh Kannoth <rkannoth@marvell.com>
To: Simon Horman <horms@kernel.org>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<sgoutham@marvell.com>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<andrew+netdev@lunn.ch>
Subject: Re: [PATCH net-next v4 07/13] octeontx2-af: npc: cn20k: Prepare for new SoC
Date: Fri, 23 Jan 2026 21:09:23 +0530	[thread overview]
Message-ID: <aXOWK2IkFikFQxnb@rkannoth-OptiPlex-7090> (raw)
In-Reply-To: <aXHhekHJSpTZzHXy@horms.kernel.org>

On 2026-01-22 at 14:06:10, Simon Horman (horms@kernel.org) wrote:
> On Tue, Jan 13, 2026 at 03:46:52PM +0530, Ratheesh Kannoth wrote:
> > @@ -945,12 +945,12 @@ void npc_update_entry(struct rvu *rvu, enum key_fields type,
> >  			kw2 = shift ? val_lo >> (64 - shift) : 0;
> >  			kw2 |= (val_hi << shift);
> >  			kw2 &= field->kw_mask[i + 1];
> > -			dummy.kw[i + 1] = kw2;
> > +			kw[i + 1] = kw2;
>
> Hi Ratheesh,
>
> It's not a problem introduced by this patch.
> But it seems that this could overrun kw if i is max_kw - 1.
> Likewise elsewhere in this loop.
>
> Flagged by Smatch.
ACK.

>
> >  			/* update entry mask */
> >  			kw2 = shift ? mask_lo >> (64 - shift) : 0;
> >  			kw2 |= (mask_hi << shift);
> >  			kw2 &= field->kw_mask[i + 1];
> > -			dummy.kw_mask[i + 1] = kw2;
> > +			kw_mask[i + 1] = kw2;
> >  			break;
> >  		}
> >  		/* place remaining bits of key value in kw[x + 1], kw[x + 2] */
> > @@ -961,34 +961,40 @@ void npc_update_entry(struct rvu *rvu, enum key_fields type,
> >  			kw2 &= field->kw_mask[i + 1];
> >  			kw3 = shift ? val_hi >> (64 - shift) : 0;
> >  			kw3 &= field->kw_mask[i + 2];
> > -			dummy.kw[i + 1] = kw2;
> > -			dummy.kw[i + 2] = kw3;
> > +			kw[i + 1] = kw2;
> > +			kw[i + 2] = kw3;
> >  			/* update entry mask */
> >  			kw2 = shift ? mask_lo >> (64 - shift) : 0;
> >  			kw2 |= (mask_hi << shift);
> >  			kw2 &= field->kw_mask[i + 1];
> >  			kw3 = shift ? mask_hi >> (64 - shift) : 0;
> >  			kw3 &= field->kw_mask[i + 2];
> > -			dummy.kw_mask[i + 1] = kw2;
> > -			dummy.kw_mask[i + 2] = kw3;
> > +			kw_mask[i + 1] = kw2;
> > +			kw_mask[i + 2] = kw3;
> >  			break;
> >  		}
> >  	}
>
> ...

  reply	other threads:[~2026-01-23 15:39 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13 10:16 [PATCH net-next v4 00/13] NPC HW block support for cn20k Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 01/13] octeontx2-af: npc: cn20k: Index management Ratheesh Kannoth
2026-01-18  0:39   ` Jakub Kicinski
2026-01-19  4:04     ` Ratheesh Kannoth
2026-01-18  0:40   ` [net-next,v4,01/13] " Jakub Kicinski
2026-01-19  4:00     ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 02/13] octeontx2-af: npc: cn20k: KPM profile changes Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 03/13] octeontx2-af: npc: cn20k: Add default profile Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 04/13] ocetontx2-af: npc: cn20k: MKEX profile support Ratheesh Kannoth
2026-01-18  0:40   ` [net-next,v4,04/13] " Jakub Kicinski
2026-01-19  4:17     ` Ratheesh Kannoth
2026-01-20  3:24     ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 05/13] octeontx2-af: npc: cn20k: Allocate default MCAM indexes Ratheesh Kannoth
2026-01-18  0:40   ` [net-next,v4,05/13] " Jakub Kicinski
2026-01-19  3:42     ` Ratheesh Kannoth
2026-01-19 17:32       ` Jakub Kicinski
2026-01-20  1:37         ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 06/13] octeontx2-af: npc: cn20k: Use common APIs Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 07/13] octeontx2-af: npc: cn20k: Prepare for new SoC Ratheesh Kannoth
2026-01-22  8:36   ` Simon Horman
2026-01-23 15:39     ` Ratheesh Kannoth [this message]
2026-01-13 10:16 ` [PATCH net-next v4 08/13] octeontx2-af: npc: cn20k: Add new mailboxes for CN20K silicon Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 09/13] octeontx2-af: npc: cn20k: virtual index support Ratheesh Kannoth
2026-01-18  0:40   ` [net-next,v4,09/13] " Jakub Kicinski
2026-01-19  3:39     ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 10/13] octeontx2-af: npc: cn20k: Allocate MCAM entry for flow installation Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 11/13] octeontx2-pf: cn20k: Add TC rules support Ratheesh Kannoth
2026-01-18  0:40   ` [net-next,v4,11/13] " Jakub Kicinski
2026-01-19  3:39     ` Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 12/13] octeontx2-af: npc: cn20k: add debugfs support Ratheesh Kannoth
2026-01-13 10:16 ` [PATCH net-next v4 13/13] octeontx2-af: npc: Use common structures 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=aXOWK2IkFikFQxnb@rkannoth-OptiPlex-7090 \
    --to=rkannoth@marvell.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --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