From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH v8 01/21] mem: add length to memseg list Date: Tue, 2 Oct 2018 10:03:35 +0100 Message-ID: References: <20181001190109.2b71f3d0@shemminger-XPS-13-9360> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, John McNamara , Marko Kovacevic , Bruce Richardson , laszlo.madarassy@ericsson.com, laszlo.vadkerti@ericsson.com, andras.kovacs@ericsson.com, winnie.tian@ericsson.com, daniel.andrasi@ericsson.com, janos.kobor@ericsson.com, geza.koblo@ericsson.com, srinath.mannam@broadcom.com, scott.branden@broadcom.com, ajit.khaparde@broadcom.com, keith.wiles@intel.com, thomas@monjalon.net, shreyansh.jain@nxp.com, shahafs@mellanox.com, arybchenko@solarflare.com, alejandro.lucero@netronome.com To: Stephen Hemminger Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2366B2952 for ; Tue, 2 Oct 2018 11:03:40 +0200 (CEST) In-Reply-To: <20181001190109.2b71f3d0@shemminger-XPS-13-9360> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 01-Oct-18 6:01 PM, Stephen Hemminger wrote: > On Mon, 1 Oct 2018 13:56:09 +0100 > Anatoly Burakov wrote: > >> diff --git a/lib/librte_eal/common/include/rte_eal_memconfig.h b/lib/librte_eal/common/include/rte_eal_memconfig.h >> index aff0688dd..1d8b0a6fe 100644 >> --- a/lib/librte_eal/common/include/rte_eal_memconfig.h >> +++ b/lib/librte_eal/common/include/rte_eal_memconfig.h >> @@ -30,6 +30,7 @@ struct rte_memseg_list { >> uint64_t addr_64; >> /**< Makes sure addr is always 64-bits */ >> }; >> + size_t len; /**< Length of memory area covered by this memseg list. */ >> int socket_id; /**< Socket ID for all memsegs in this list. */ >> uint64_t page_sz; /**< Page size for all memsegs in this list. */ >> volatile uint32_t version; /**< version number for multiprocess sync. */ > > If you are going to break ABI, why not try and rearrange to eliminate holes: > > Output of pahole (on x86 64 bit): > > struct rte_memseg_list { > union { > void * base_va; /* 0 8 */ > uint64_t addr_64; /* 0 8 */ > }; /* 0 8 */ > size_t len; /* 8 8 */ > int socket_id; /* 16 4 */ > > /* XXX 4 bytes hole, try to pack */ > > uint64_t page_sz; /* 24 8 */ > volatile uint32_t version; /* 32 4 */ > > /* XXX 4 bytes hole, try to pack */ > > struct rte_fbarray memseg_arr; /* 40 96 */ > > /* XXX last struct has 4 bytes of padding */ > > /* size: 136, cachelines: 3, members: 6 */ > /* sum members: 128, holes: 2, sum holes: 8 */ > /* paddings: 1, sum paddings: 4 */ > /* last cacheline: 8 bytes */ > }; > Hi Stephen, This data structure isn't performance-critical in any remote sense, but sure, I can do that. -- Thanks, Anatoly