From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2018 02:03:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,331,1534834800"; d="scan'208";a="93840361" Received: from unknown (HELO [10.237.220.113]) ([10.237.220.113]) by fmsmga004.fm.intel.com with ESMTP; 02 Oct 2018 02:03:36 -0700 To: Stephen Hemminger 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 References: <20181001190109.2b71f3d0@shemminger-XPS-13-9360> From: "Burakov, Anatoly" Message-ID: Date: Tue, 2 Oct 2018 10:03:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181001190109.2b71f3d0@shemminger-XPS-13-9360> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v8 01/21] mem: add length to memseg list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Oct 2018 09:03:41 -0000 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