From: Tal Shnaiderman <talshn@mellanox.com>
To: Omar Cardona <ocardona@microsoft.com>,
Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
Thomas Monjalon <thomas@monjalon.net>,
"pallavi.kadam@intel.com" <pallavi.kadam@intel.com>,
"navasile@linux.microsoft.com" <navasile@linux.microsoft.com>,
"ranjit.menon@intel.com" <ranjit.menon@intel.com>,
Harini Ramakrishnan <Harini.Ramakrishnan@microsoft.com>,
"Dmitry Malloy (MESHCHANINOV)" <dmitrym@microsoft.com>,
Yohad Tor <yohadt@mellanox.com>, Jie Zhou <jizh@microsoft.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] rte_mbuf structure size in Windows
Date: Wed, 13 May 2020 08:50:18 +0000 [thread overview]
Message-ID: <AM0PR05MB5313629FE6EBB912A5C05F46A9BF0@AM0PR05MB5313.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <CY4PR21MB0277F15AEA6DDB452D0A38B8DABF0@CY4PR21MB0277.namprd21.prod.outlook.com>
Thank you Omar, this is indeed the same issue.
> -----Original Message-----
> From: Omar Cardona <ocardona@microsoft.com>
> Sent: Wednesday, May 13, 2020 11:08 AM
> To: Tal Shnaiderman <talshn@mellanox.com>; Dmitry Kozlyuk
> <dmitry.kozliuk@gmail.com>; Thomas Monjalon <thomas@monjalon.net>;
> pallavi.kadam@intel.com; navasile@linux.microsoft.com;
> ranjit.menon@intel.com; Harini Ramakrishnan
> <Harini.Ramakrishnan@microsoft.com>; Dmitry Malloy (MESHCHANINOV)
> <dmitrym@microsoft.com>; Yohad Tor <yohadt@mellanox.com>; Jie Zhou
> <jizh@microsoft.com>
> Cc: dev@dpdk.org
> Subject: RE: rte_mbuf structure size in Windows
>
> Tal,
> See attached compiler bug section for details.
>
> -----Original Message-----
> From: Omar Cardona
> Sent: Wednesday, May 13, 2020 1:04 AM
> To: Tal Shnaiderman <talshn@mellanox.com>; Dmitry Kozlyuk
> <dmitry.kozliuk@gmail.com>; Thomas Monjalon <thomas@monjalon.net>;
> pallavi.kadam@intel.com; navasile@linux.microsoft.com;
> ranjit.menon@intel.com; Harini Ramakrishnan
> <Harini.Ramakrishnan@microsoft.com>; Dmitry Malloy (MESHCHANINOV)
> <dmitrym@microsoft.com>; Yohad Tor <yohadt@mellanox.com>; Jie Zhou
> <jizh@microsoft.com>
> Cc: dev@dpdk.org
> Subject: RE: rte_mbuf structure size in Windows
>
> IIRC, it's this issue.
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.
> llvm.org%2Fshow_bug.cgi%3Fid%3D24383&data=02%7C01%7Ctalshn%4
> 0mellanox.com%7C2987047b646b4854350e08d7f714b2ea%7Ca652971c7d2e4
> d9ba6a4d149256f461b%7C0%7C0%7C637249540596603575&sdata=83m
> NExOvXtXpKIt%2FZaqkoZadkuGpX1olQE3Scc1xOAQ%3D&reserved=0
>
> -----Original Message-----
> From: Tal Shnaiderman <talshn@mellanox.com>
> Sent: Wednesday, May 13, 2020 12:55 AM
> To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>; Thomas Monjalon
> <thomas@monjalon.net>; pallavi.kadam@intel.com;
> navasile@linux.microsoft.com; ranjit.menon@intel.com; Harini
> Ramakrishnan <Harini.Ramakrishnan@microsoft.com>; Omar Cardona
> <ocardona@microsoft.com>; Dmitry Malloy (MESHCHANINOV)
> <dmitrym@microsoft.com>; Yohad Tor <yohadt@mellanox.com>
> Cc: dev@dpdk.org
> Subject: [EXTERNAL] rte_mbuf structure size in Windows
>
> Hi,
>
> I've noticed that there is a difference between the size of rte_mbuf in a Unix
> build comparing to Windows.
>
> The requirements is for rte_mbuf is to be RTE_CACHE_LINE_MIN_SIZE * 2
> bytes however when I'm building it in Windows the size is
> RTE_CACHE_LINE_MIN_SIZE * 3.
>
> Looks like the diff results from the usage of bit fields inside rte_mbuf, from
> my testing it looks to me like the usage of 2 different bit fielded types inside
> rte_mbuf causes additional padding in Windows.
>
> For example from rte_mbuf, the following unions have the same size in
> Windows and Linux:
>
> union {
> uint32_t packet_type;
> // bit fields of type uint32_t will follow
> ...
> };...
>
> 4 bytes both in Unix and Windows.
>
> union {
> uint64_t tx_offload;
> // bit fields of type uint64_t will follow
> ...
> };
>
> 8 bytes both in Unix and Windows.
>
> However when creating a struct containing both unions I'm getting sizeof 16
> bytes in Unix and 24 bytes in Windows.
>
> Did someone faced this issue before? Is this a result of different alignment
> between gcc and clang when bit fields are used?
>
> Thanks,
>
> Tal
next prev parent reply other threads:[~2020-05-13 8:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 7:55 Tal Shnaiderman
2020-05-13 8:04 ` Omar Cardona
2020-05-13 8:07 ` Omar Cardona
2020-05-13 8:50 ` Tal Shnaiderman [this message]
2020-05-13 8:35 ` Dmitry Kozlyuk
2020-05-13 8:55 ` Tal Shnaiderman
2020-05-13 9:34 ` Dmitry Kozlyuk
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=AM0PR05MB5313629FE6EBB912A5C05F46A9BF0@AM0PR05MB5313.eurprd05.prod.outlook.com \
--to=talshn@mellanox.com \
--cc=Harini.Ramakrishnan@microsoft.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=dmitrym@microsoft.com \
--cc=jizh@microsoft.com \
--cc=navasile@linux.microsoft.com \
--cc=ocardona@microsoft.com \
--cc=pallavi.kadam@intel.com \
--cc=ranjit.menon@intel.com \
--cc=thomas@monjalon.net \
--cc=yohadt@mellanox.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).