From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v8 01/21] mem: add length to memseg list Date: Mon, 1 Oct 2018 19:01:09 +0200 Message-ID: <20181001190109.2b71f3d0@shemminger-XPS-13-9360> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Anatoly Burakov Return-path: Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by dpdk.org (Postfix) with ESMTP id E61911B433 for ; Mon, 1 Oct 2018 19:01:13 +0200 (CEST) Received: by mail-ed1-f65.google.com with SMTP id g26-v6so14918900edp.0 for ; Mon, 01 Oct 2018 10:01:13 -0700 (PDT) In-Reply-To: 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 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 */ };