From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 1D18DA00E6 for ; Thu, 16 May 2019 17:18:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CDCF65F22; Thu, 16 May 2019 17:18:19 +0200 (CEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by dpdk.org (Postfix) with ESMTP id 0FC2A5F1C for ; Thu, 16 May 2019 17:18:17 +0200 (CEST) Received: by mail-pf1-f182.google.com with SMTP id z26so2016153pfg.6 for ; Thu, 16 May 2019 08:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TCw1C1IZ1IHDR/DVfGBULy6tet/iuIprPJoL44nuOZo=; b=Fb78V4XlZraINUFJbnOD2x1612c1nmSyJiBedoJJM87pjDPxxYQGHL8z58ytWbsdk3 SjEHZhJGBJZssS9MWep8Yolz1Y98vN9BexBpzcT4aAk87AyLroV/QaFGrmwWwju4xDzd F2MolPyoZ/i+AWyn4vviB5dGR4Qw7dd1AAT2hZeLbWbXUumcinnrYnqwdXOJW2bFd6S8 AW1d79xLNtEL0Oaq3rXZZhSPkDNqdDGJm2JlWN+NSyS6KVESv73wGA8rjU1MuWbxHO9C OYnsd8XTLdbckTNyKa+uERAOqE4sWsR338G8l1rMEwfGnvZ5lGCwt4wi/9boI/+D6k3I EG7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TCw1C1IZ1IHDR/DVfGBULy6tet/iuIprPJoL44nuOZo=; b=LyFS+lk5k/fkIgtvnjvuzWtuvi7mKCCjLc2QgdyJCniu6nn8/0w8KzZNtrwY0gHRco +Fa3d5rsMCizlM0TH4PmRUpFPJcik0y7pZhx56oKg07ihkTGi8fX/YCAdPG9LYokFIlV AMDQMNOu33mEbrkwp8ZuloqMXlGKEWhRqOP579Wqua68OCTXmkGNViwc/91yynf6JqUW zdNhkh3BHDe2K7q/l/Cu23ZlnJUH3cfw6wp6ZpM9MmYrwKZ4AHHYB7Y8sX/Y2HwV8Q5+ LcrqB7FuC2ottb4WE5kRBxD/QhET24AB2HrwGfh5sIhv2FvRkUVQyQksk7XO7un4Cl/h Y5/A== X-Gm-Message-State: APjAAAXv7YT1D/oXum3FLrvdVx+sRRRNWtkFtYddZSQqkzXvJHedeJv6 TtLxUSIPeOBx/TuSAdJvOAQvHiWle6w= X-Google-Smtp-Source: APXvYqxG79L+q0QQy7ySF2zcmNaIovT+LiQqNlyA6LGjJ2qceXygq7p0BOTjzKsJKntj97QctARUMA== X-Received: by 2002:aa7:86c3:: with SMTP id h3mr53026704pfo.169.1558019896924; Thu, 16 May 2019 08:18:16 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id d15sm18450092pfm.186.2019.05.16.08.18.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 May 2019 08:18:16 -0700 (PDT) Date: Thu, 16 May 2019 08:18:14 -0700 From: Stephen Hemminger To: Jakub Grajciar Cc: Message-ID: <20190516081814.239b37e3@hermes.lan> In-Reply-To: <20190516114658.29102-1-jgrajcia@cisco.com> References: <20190513104552.27843-1-jgrajcia@cisco.com> <20190516114658.29102-1-jgrajcia@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC v8] /net: memory interface (memif) 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 16 May 2019 13:46:58 +0200 Jakub Grajciar wrote: > +struct memif_queue { > + struct rte_mempool *mempool; /**< mempool for RX packets */ > + uint16_t in_port; /**< port id */ > + > + struct pmd_internals *pmd; /**< device internals */ > + > + struct rte_intr_handle intr_handle; /**< interrupt handle */ > + > + /* ring info */ > + memif_ring_type_t type; /**< ring type */ > + memif_ring_t *ring; /**< pointer to ring */ > + memif_log2_ring_size_t log2_ring_size; /**< log2 of ring size */ > + > + memif_region_index_t region; /**< shared memory region index */ > + memif_region_offset_t ring_offset; > + /**< ring offset from start of shm region (ring - memif_region.addr) */ > + > + uint16_t last_head; /**< last ring head */ > + uint16_t last_tail; /**< last ring tail */ > + > + /* rx/tx info */ > + uint64_t n_pkts; /**< number of rx/tx packets */ > + uint64_t n_bytes; /**< number of rx/tx bytes */ > + uint64_t n_err; /**< number of tx errors */ > +}; > + The layout of this structure has lots of holes, you might want to rearrange elements. struct memif_queue { struct rte_mempool * mempool; /* 0 8 */ uint16_t in_port; /* 8 2 */ /* XXX 6 bytes hole, try to pack */ struct pmd_internals * pmd; /* 16 8 */ struct rte_intr_handle intr_handle; /* 24 26656 */ /* --- cacheline 416 boundary (26624 bytes) was 56 bytes ago --- */ memif_ring_type_t type; /* 26680 4 */ /* XXX 4 bytes hole, try to pack */ /* --- cacheline 417 boundary (26688 bytes) --- */ memif_ring_t * ring; /* 26688 8 */ memif_log2_ring_size_t log2_ring_size; /* 26696 1 */ /* XXX 1 byte hole, try to pack */ memif_region_index_t region; /* 26698 2 */ memif_region_offset_t ring_offset; /* 26700 4 */ uint16_t last_head; /* 26704 2 */ uint16_t last_tail; /* 26706 2 */ /* XXX 4 bytes hole, try to pack */ uint64_t n_pkts; /* 26712 8 */ uint64_t n_bytes; /* 26720 8 */ uint64_t n_err; /* 26728 8 */ /* size: 26736, cachelines: 418, members: 14 */ /* sum members: 26721, holes: 4, sum holes: 15 */ /* last cacheline: 48 bytes */ };