public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Subbaraya Sundeep <sbhatta@marvell.com>
To: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>,
	<pabeni4redhat.com@mx0a-0016f401.pphosted.com>,
	<horms@kernel.org>, <gakula@marvell.com>, <hkelam@marvell.com>,
	<bbhushan2@marvell.com>, <jerinj@marvell.com>,
	<lcherian@marvell.com>, <sgoutham@marvell.com>,
	<netdev@vger.kernel.org>
Subject: Re: [net-next PATCH v2 01/11] octeontx2-af: Simplify context writing and reading to hardware
Date: Thu, 17 Jul 2025 16:54:14 +0000	[thread overview]
Message-ID: <aHkqtoNCJvorNnSq@67d05fca9368> (raw)
In-Reply-To: <aHdvt63yoJLt/1g9@mev-dev.igk.intel.com>

On 2025-07-16 at 09:24:07, Michal Swiatkowski (michal.swiatkowski@linux.intel.com) wrote:
> On Tue, Jul 15, 2025 at 10:31:54PM +0530, Subbaraya Sundeep wrote:
> > Simplify NIX context reading and writing by using hardware
> > maximum context size instead of using individual sizes of
> > each context type.
> > 
> > Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
> > ---
> >  .../ethernet/marvell/octeontx2/af/rvu_nix.c   | 46 ++++++++++---------
> >  .../marvell/octeontx2/af/rvu_struct.h         |  7 ++-
> >  2 files changed, 30 insertions(+), 23 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
> > index bdf4d852c15d..48d44911b663 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
> > +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
> > @@ -17,6 +17,8 @@
> >  #include "lmac_common.h"
> >  #include "rvu_npc_hash.h"
> >  
> > +#define NIX_MAX_CTX_SIZE	128
> > +
> 
> [...]
> 
> >  
> >  	return 0;
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h
> > index 0596a3ac4c12..8a66f53a7658 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h
> > +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_struct.h
> > @@ -370,6 +370,8 @@ struct nix_cq_ctx_s {
> >  	u64 qsize		: 4;
> >  	u64 cq_err_int		: 8;
> >  	u64 cq_err_int_ena	: 8;
> > +	/* Ensure all context sizes are minimum 128 bytes */
> > +	u64 padding[12];
> >  };
> >  
> >  /* CN10K NIX Receive queue context structure */
> > @@ -672,7 +674,8 @@ struct nix_sq_ctx_s {
> >  struct nix_rsse_s {
> >  	uint32_t rq			: 20;
> >  	uint32_t reserved_20_31		: 12;
> > -
> > +	/* Ensure all context sizes are minimum 128 bytes */
> > +	u64 padding[15];
> >  };
> >  
> >  /* NIX receive multicast/mirror entry structure */
> > @@ -684,6 +687,8 @@ struct nix_rx_mce_s {
> >  	uint64_t rsvd_31_24 : 8;
> >  	uint64_t pf_func    : 16;
> >  	uint64_t next       : 16;
> > +	/* Ensure all context sizes are minimum 128 bytes */
> > +	u64 padding[15];
> >  };
> 
> To be sure that each used structures are correct size you can
> use static assertion, sth like:
> static_assert((NIC_MAX_CTX_SIZE) == sizeof(struct X))
> 
> Thanks
> 
Sure will do it.

Thanks,
Sundeep
> >  
> >  enum nix_band_prof_layers {
> > -- 
> > 2.34.1
> > 

  reply	other threads:[~2025-07-17 16:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15 17:01 [net-next PATCH v2 00/11] Add CN20K NIX and NPA contexts Subbaraya Sundeep
2025-07-15 17:01 ` [net-next PATCH v2 01/11] octeontx2-af: Simplify context writing and reading to hardware Subbaraya Sundeep
2025-07-16  9:24   ` Michal Swiatkowski
2025-07-17 16:54     ` Subbaraya Sundeep [this message]
2025-07-15 17:01 ` [net-next PATCH v2 02/11] octeontx2-af: Add cn20k NIX block contexts Subbaraya Sundeep
2025-07-15 17:01 ` [net-next PATCH v2 03/11] octeontx2-af: Extend debugfs support for cn20k NIX Subbaraya Sundeep
2025-07-15 17:01 ` [net-next PATCH v2 04/11] octeontx2-af: Add cn20k NPA block contexts Subbaraya Sundeep
2025-07-15 17:01 ` [net-next PATCH v2 05/11] octeontx2-af: Extend debugfs support for cn20k NPA Subbaraya Sundeep
2025-07-15 17:01 ` [net-next PATCH v2 06/11] octeontx2-af: Skip NDC operations for cn20k Subbaraya Sundeep
2025-07-15 17:02 ` [net-next PATCH v2 07/11] octeontx2-pf: Initialize cn20k specific aura and pool contexts Subbaraya Sundeep
2025-07-15 17:02 ` [net-next PATCH v2 08/11] octeontx2-pf: Initialize new NIX SQ context for cn20k Subbaraya Sundeep
2025-07-15 17:02 ` [net-next PATCH v2 09/11] octeontx2-af: Accommodate more bandwidth profiles " Subbaraya Sundeep
2025-07-15 17:02 ` [net-next PATCH v2 10/11] octeontx2-af: Display new bandwidth profiles too in debugfs Subbaraya Sundeep
2025-07-15 17:02 ` [net-next PATCH v2 11/11] octeontx2-pf: Use new bandwidth profiles in receive queue Subbaraya Sundeep

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=aHkqtoNCJvorNnSq@67d05fca9368 \
    --to=sbhatta@marvell.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bbhushan2@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=horms@kernel.org \
    --cc=jerinj@marvell.com \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni4redhat.com@mx0a-0016f401.pphosted.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