From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 91DF5A0093; Tue, 19 May 2020 20:49:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 44A001D181; Tue, 19 May 2020 20:49:58 +0200 (CEST) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by dpdk.org (Postfix) with ESMTP id CDC101D17E for ; Tue, 19 May 2020 20:49:56 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 1FECB5801C3; Tue, 19 May 2020 14:49:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Tue, 19 May 2020 14:49:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= u5mehKWZg0ZCn32Dk2++17DFoXBfbLe+yDzyHWtee0g=; b=fUicvEes3bqC1SZX CuEXINzvP2xhzzDisvEdsDOSirJsgx/CNU7FAkOHcdVyBdnFCUSAU4At+2J/u3FZ R479MT+XkxkjuFUKzuD55p7KBkSD/9yto9BMAZKc5iVdgaBz9Sz4prpFMWgOlCZL KPKysWCIioxARLfgwP6uAwDDNIXtmxaMvdDx+7mzF1jDEbMc1DFelCAinky74BzO /NLo1G9aCp5rH+IsAWD4nqs65OKpeR3GRz4itDx6DN3fX8nHgGu6w0rXYutXpEkG XCA71B9E9FAeorBGiNhHPbdcuZYJqcs2plnuWrZ6XY5iYQ2C5MuD14Cwpn7UCVZ1 m2eMtQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=u5mehKWZg0ZCn32Dk2++17DFoXBfbLe+yDzyHWtee 0g=; b=A4T3KuK9XP3tCaw0sIgISNmYyiZZW2GjVf7V2jDL4Iyd2KdZIPNtlvra0 kRa9j/JbtxXF0fNEaVEknjHNtCQ8oU3vpWdB9jUhF/vYAxcE5Ms5/Cz6wmgNidYu 7dCu97/20Mvma/UWZtpGvOrL92rIQwbjr+IGYeBPGanQnfrRSIjpZZkY8bh280EV +obvwpvM2XgJiVDzgu6TGQpthKoie4tcnzE+yx6/t8QrMyUwD96KEXJ4eg4/r6/+ hlEzGFJUQOEvjdfXHTrOqApIA4EJVKJ9EuyRwCNlPzAIow29Vb7HOjt87VkrB6Ns 6e7yyaWLK1MDitfvnx9ndVG7SvvdA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddtjedguddvkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 3B0733280060; Tue, 19 May 2020 14:49:52 -0400 (EDT) From: Thomas Monjalon To: talshn@mellanox.com Cc: dev@dpdk.org, pallavi.kadam@intel.com, dmitry.kozliuk@gmail.com, ranjit.menon@intel.com, navasile@linux.microsoft.com, olivier.matz@6wind.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, Tal Shnaiderman , olivier.matz@6wind.com, david.marchand@redhat.com, arybchenko@solarflare.com, bruce.richardson@intel.com, jerinj@marvell.com, drc@linux.vnet.ibm.com, ruifeng.wang@arm.com, konstantin.ananyev@intel.com Date: Tue, 19 May 2020 20:49:50 +0200 Message-ID: <3106438.CAdn2TfLgq@thomas> In-Reply-To: <20200519184111.4504-1-talshn@mellanox.com> References: <20200519184111.4504-1-talshn@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] mbuf: align rte_mbuf for Windows 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" +Cc more maintainers 19/05/2020 20:41, talshn@mellanox.com: > From: Tal Shnaiderman > > Using uint32_t type bit-fields in Windows will pads the > 'L2/L3/L4 and tunnel information' union with additional bits. > > This padding causes rte_mbuf size misalignment and the total size > increases to 3 cache-lines. > > Changed packet_type bit-fields types from uint32_t to uint8_t > to allow unified 2 cache-line structure size. > > Added the __extension__ attribute over the modified struct to avoid > the warning: > > type of bit-field ... is a GCC extension [-pedantic] > > Signed-off-by: Tal Shnaiderman > --- > lib/librte_mbuf/rte_mbuf_core.h | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h > index b9a59c879..82441555e 100644 > --- a/lib/librte_mbuf/rte_mbuf_core.h > +++ b/lib/librte_mbuf/rte_mbuf_core.h > @@ -521,11 +521,12 @@ struct rte_mbuf { > RTE_STD_C11 > union { > uint32_t packet_type; /**< L2/L3/L4 and tunnel information. */ > + __extension__ > struct { > - uint32_t l2_type:4; /**< (Outer) L2 type. */ > - uint32_t l3_type:4; /**< (Outer) L3 type. */ > - uint32_t l4_type:4; /**< (Outer) L4 type. */ > - uint32_t tun_type:4; /**< Tunnel type. */ > + uint8_t l2_type:4; /**< (Outer) L2 type. */ > + uint8_t l3_type:4; /**< (Outer) L3 type. */ > + uint8_t l4_type:4; /**< (Outer) L4 type. */ > + uint8_t tun_type:4; /**< Tunnel type. */ > RTE_STD_C11 > union { > uint8_t inner_esp_next_proto; > @@ -541,7 +542,7 @@ struct rte_mbuf { > /**< Inner L3 type. */ > }; > }; > - uint32_t inner_l4_type:4; /**< Inner L4 type. */ > + uint8_t inner_l4_type:4; /**< Inner L4 type. */ > }; > };