DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: Volodymyr Fialko <vfialko@marvell.com>,
	dev@dpdk.org, Reshma Pattan <reshma.pattan@intel.com>,
	jerinj@marvell.com, anoobj@marvell.com
Subject: Re: [PATCH] reorder: improve buffer structure layout
Date: Fri, 14 Apr 2023 10:07:16 -0700	[thread overview]
Message-ID: <20230414170716.GB10264@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <ZDkcQvvUFEH26gpQ@bricha3-MOBL.ger.corp.intel.com>

On Fri, Apr 14, 2023 at 10:26:26AM +0100, Bruce Richardson wrote:
> On Fri, Apr 14, 2023 at 10:43:43AM +0200, Volodymyr Fialko wrote:
> > Rearrange the reorder buffer structure to prevent padding to extra one
> > cache line.
> > 
> > Current layout:
> > struct rte_reorder_buffer {
> >         char name[RTE_REORDER_NAMESIZE];
> >         uint32_t min_seqn;
> >         unsigned int memsize;
> > // -> padding to cache align (cir_buffer is also cache aligned)
> >         struct cir_buffer ready_buf;
> >         struct cir_buffer order_buf;
> >         int is_initialized;
> > // -> padding to cache align, eat whole line
> > };
> > 
> > New layout:
> > struct rte_reorder_buffer {
> >         char name[RTE_REORDER_NAMESIZE];
> >         uint32_t min_seqn;
> >         unsigned int memsize;
> >         int is_initialized;
> > // -> padding to cache align (cir_buffer is also cache aligned)
> >         struct cir_buffer ready_buf;
> >         struct cir_buffer order_buf;
> > // -> no padding
> > };
> > 
> > Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
> > ---
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> >  lib/reorder/rte_reorder.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
> > index f55f383700..7418202b04 100644
> > --- a/lib/reorder/rte_reorder.c
> > +++ b/lib/reorder/rte_reorder.c
> > @@ -46,9 +46,10 @@ struct rte_reorder_buffer {
> >  	char name[RTE_REORDER_NAMESIZE];
> >  	uint32_t min_seqn;  /**< Lowest seq. number that can be in the buffer */
> >  	unsigned int memsize; /**< memory area size of reorder buffer */
> > +	int is_initialized; /**< flag indicates that buffer was initialized */
> > +
> 
> Since we are moving it, it might be an opportunity to change it from "int"
> to "bool".

+1

> 
> >  	struct cir_buffer ready_buf; /**< temp buffer for dequeued entries */
> >  	struct cir_buffer order_buf; /**< buffer used to reorder entries */
> > -	int is_initialized;
> >  } __rte_cache_aligned;
> >  
> >  static void
> > -- 
> > 2.34.1
> > 

  reply	other threads:[~2023-04-14 17:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14  8:43 Volodymyr Fialko
2023-04-14  9:26 ` Bruce Richardson
2023-04-14 17:07   ` Tyler Retzlaff [this message]
2023-04-14 14:52 ` Stephen Hemminger
2023-04-14 14:54   ` Bruce Richardson
2023-04-14 15:30     ` Stephen Hemminger
2023-04-17  9:12 ` [PATCH v2] " Volodymyr Fialko
2023-06-01 15:19   ` Thomas Monjalon

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=20230414170716.GB10264@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=roretzla@linux.microsoft.com \
    --cc=anoobj@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=reshma.pattan@intel.com \
    --cc=vfialko@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;
as well as URLs for NNTP newsgroup(s).