From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7B57542943; Fri, 14 Apr 2023 19:07:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 672D6410F6; Fri, 14 Apr 2023 19:07:19 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 9E3EB40144 for ; Fri, 14 Apr 2023 19:07:17 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id DF7402179260; Fri, 14 Apr 2023 10:07:16 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DF7402179260 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1681492036; bh=6zw1iP/bJGkA+0hOdcqkaMK9X+pDdOaE6nP5EGJ02Yw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XT6X7W8mRBI2VQwlL+zXT6izb9d1E/Yc7FSWmk24cLk1b6l+VmVRkelBGXEKuEzFY LjJ/fRMycaGEUTNyWd9LItszNk0daNC8ud/90OKdqscA9JgTJD97OLmfnPij8RiCrr 6BKrowGHyGGFxkWCHETvyfErti6J4CYSaEXsd41o= Date: Fri, 14 Apr 2023 10:07:16 -0700 From: Tyler Retzlaff To: Bruce Richardson Cc: Volodymyr Fialko , dev@dpdk.org, Reshma Pattan , jerinj@marvell.com, anoobj@marvell.com Subject: Re: [PATCH] reorder: improve buffer structure layout Message-ID: <20230414170716.GB10264@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20230414084344.271602-1-vfialko@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 > > --- > > Acked-by: Bruce Richardson > > > 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 > >