DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Gregory Etelson" <getelson@nvidia.com>, <dev@dpdk.org>
Cc: <andrew.rybchenko@oktetlabs.ru>, <bruce.richardson@intel.com>,
	<cristian.dumitrescu@intel.com>, <ferruh.yigit@amd.com>,
	<jasvinder.singh@intel.com>, <konstantin.v.ananyev@yandex.ru>,
	<mkashani@nvidia.com>, <orika@nvidia.com>, <ruifeng.wang@arm.com>,
	<thomas@monjalon.net>
Subject: RE: [PATCH v3] net: add bit fields to IPv6 header definition
Date: Tue, 18 Jun 2024 12:47:55 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F531@smartserver.smartshare.dk> (raw)
In-Reply-To: <20240618095141.290673-1-getelson@nvidia.com>

>  struct rte_ipv6_hdr {
> -	rte_be32_t vtc_flow;	/**< IP version, traffic class & flow label.
> */
> +	union {
> +		rte_be32_t vtc_flow;        /**< IP version, traffic class & flow
> label. */
> +		__extension__
> +		struct {
> +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
> +			rte_be32_t flow_label:20; /**< flow label */

I played around with this in Godbolt, and __attribute__((__packed__)) only packs bytes, not bits, so the packed structure grows from 4 to 5 bytes, because the compiler adds 4 bits of padding here, to byte align the union holding "tc".

Please revert to v2.

Sorry about the noise. ;-)

> +			union {
> +				rte_be32_t tc:8;
> +				struct {
> +					rte_be32_t ecn:2; /**< ECN */
> +					rte_be32_t ds:6;  /**< differentiated
> services */
> +				};
> +			};


  reply	other threads:[~2024-06-18 10:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18  5:17 [PATCH] " Gregory Etelson
2024-06-18  6:42 ` Morten Brørup
2024-06-18  7:02   ` Morten Brørup
2024-06-18  8:07     ` Etelson, Gregory
2024-06-19  0:11   ` Tyler Retzlaff
2024-06-19  4:31     ` Etelson, Gregory
2024-06-18  7:58 ` [PATCH v2] " Gregory Etelson
2024-06-18  8:11   ` Morten Brørup
2024-06-18  9:51 ` [PATCH v3] " Gregory Etelson
2024-06-18 10:47   ` Morten Brørup [this message]
2024-06-18 12:18 ` [PATCH v4] " Gregory Etelson
2024-06-18 12:44   ` Morten Brørup

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=98CBD80474FA8B44BF855DF32C47DC35E9F531@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=getelson@nvidia.com \
    --cc=jasvinder.singh@intel.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=mkashani@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=ruifeng.wang@arm.com \
    --cc=thomas@monjalon.net \
    /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).