DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Jakub Grajciar <jgrajcia@cisco.com>
Cc: <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC v8] /net: memory interface (memif)
Date: Thu, 16 May 2019 08:18:14 -0700	[thread overview]
Message-ID: <20190516081814.239b37e3@hermes.lan> (raw)
In-Reply-To: <20190516114658.29102-1-jgrajcia@cisco.com>

On Thu, 16 May 2019 13:46:58 +0200
Jakub Grajciar <jgrajcia@cisco.com> 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 */
};

  reply	other threads:[~2019-05-16 15:18 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 13:30 [dpdk-dev] [RFC v3] " Jakub Grajciar
2018-12-13 18:07 ` Stephen Hemminger
2018-12-14  9:39   ` Bruce Richardson
2018-12-14 16:12     ` Wiles, Keith
2019-01-04 17:16 ` Ferruh Yigit
2019-01-04 19:23 ` Stephen Hemminger
2019-01-04 19:27 ` Stephen Hemminger
2019-01-04 19:32 ` Stephen Hemminger
2019-02-20 11:52 ` [dpdk-dev] [RFC v4] " Jakub Grajciar
2019-02-20 15:46   ` Stephen Hemminger
2019-02-20 16:17   ` Stephen Hemminger
2019-02-21 10:50   ` Rami Rosen
2019-02-27 17:04   ` Ferruh Yigit
2019-03-22 11:57   ` [dpdk-dev] [RFC v5] " Jakub Grajciar
2019-03-22 11:57     ` Jakub Grajciar
2019-03-25 20:58     ` Ferruh Yigit
2019-03-25 20:58       ` Ferruh Yigit
2019-05-02 12:35       ` Jakub Grajciar -X (jgrajcia - PANTHEON TECHNOLOGIES at Cisco)
2019-05-02 12:35         ` Jakub Grajciar -X (jgrajcia - PANTHEON TECHNOLOGIES at Cisco)
2019-05-03  4:27         ` Honnappa Nagarahalli
2019-05-03  4:27           ` Honnappa Nagarahalli
2019-05-06 11:00           ` Jakub Grajciar -X (jgrajcia - PANTHEON TECHNOLOGIES at Cisco)
2019-05-06 11:00             ` Jakub Grajciar -X (jgrajcia - PANTHEON TECHNOLOGIES at Cisco)
2019-05-06 11:04             ` Damjan Marion (damarion)
2019-05-06 11:04               ` Damjan Marion (damarion)
2019-05-07 11:29               ` Honnappa Nagarahalli
2019-05-07 11:29                 ` Honnappa Nagarahalli
2019-05-07 11:37                 ` Damjan Marion (damarion)
2019-05-07 11:37                   ` Damjan Marion (damarion)
2019-05-08  7:53                   ` Honnappa Nagarahalli
2019-05-08  7:53                     ` Honnappa Nagarahalli
2019-05-09  8:30     ` [dpdk-dev] [RFC v6] " Jakub Grajciar
2019-05-09  8:30       ` Jakub Grajciar
2019-05-13 10:45       ` [dpdk-dev] [RFC v7] " Jakub Grajciar
2019-05-13 10:45         ` Jakub Grajciar
2019-05-16 11:46         ` [dpdk-dev] [RFC v8] " Jakub Grajciar
2019-05-16 15:18           ` Stephen Hemminger [this message]
2019-05-16 15:19           ` Stephen Hemminger
2019-05-16 15:21           ` Stephen Hemminger
2019-05-20  9:22             ` Jakub Grajciar -X (jgrajcia - PANTHEON TECHNOLOGIES at Cisco)
2019-05-16 15:25           ` Stephen Hemminger
2019-05-16 15:28           ` Stephen Hemminger
2019-05-20 10:18           ` [dpdk-dev] [RFC v9] " Jakub Grajciar
2019-05-29 17:29             ` Ferruh Yigit
2019-05-30 12:38               ` Jakub Grajciar -X (jgrajcia - PANTHEON TECHNOLOGIES at Cisco)
2019-05-31  6:22             ` [dpdk-dev] [PATCH v10] net/memif: introduce memory interface (memif) PMD Jakub Grajciar
2019-05-31  7:43               ` Ye Xiaolong
2019-06-03 11:28                 ` Jakub Grajciar -X (jgrajcia - PANTHEON TECHNOLOGIES at Cisco)
2019-06-03 14:25                   ` Ye Xiaolong
2019-06-05 12:01                 ` Ferruh Yigit
2019-06-03 13:37               ` Aaron Conole
2019-06-05 11:55               ` Ferruh Yigit
2019-06-06  9:24                 ` Ferruh Yigit
2019-06-06 10:25                   ` Jakub Grajciar -X (jgrajcia - PANTHEON TECHNOLOGIES at Cisco)
2019-06-06 11:18                     ` Ferruh Yigit
2019-06-06  8:24               ` [dpdk-dev] [PATCH v11] " Jakub Grajciar
2019-06-06 11:38                 ` [dpdk-dev] [PATCH v12] " Jakub Grajciar
2019-06-06 14:07                   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190516081814.239b37e3@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=jgrajcia@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).