From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E2D35A0C4B; Thu, 14 Oct 2021 18:04:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B94AA411FE; Thu, 14 Oct 2021 18:04:33 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 3CE3C4112E for ; Thu, 14 Oct 2021 18:04:32 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 965805C013E; Thu, 14 Oct 2021 12:04:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 14 Oct 2021 12:04:31 -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=fm2; bh= WzLLGOnAAwqiAv2YQTK6uZuvoQ6lVEz1FwBVCknijIc=; b=MbXIerG1d4SlbdXc iCjV5qteFGqIykGJKGrFy0QwZIjZrtHGKdI50OO90FgUoEo/ycJ2TOnkna1uE5Mc wFGsEsGIX6efY5BCSLQS08Mr4a/Q+heFLVWa2FSk8jzFpddiT4nWCXJxPHFVDMwt C9jrmDnefkwAY0MSSH664A1UH4w1+OZPxK+JKEJkr/rpNJVDjDXb2GPYwRc/dJLh lp8macuTLt/1rqt83agMNXEwrS6BGiZKFXdWiIz6IUw4hFrCWJi18irfdpEqWbtl mujR8R4RtLvNSWCtz22eZXpX5UhQmKBqG5tnEqLIZqz6eKyos0sIwQQsXSYHZ7Cg Ra0T3w== 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=fm1; bh=WzLLGOnAAwqiAv2YQTK6uZuvoQ6lVEz1FwBVCknij Ic=; b=DLzMZh7+yX9u+wl+22fq2FaNvb5WUd0mwydFubFERJoQ9ciCbKooZ346+ 8ges2lBpNUadQXeCMbq/VvqH0pZBid8H0zmNpLelshtA9QV6H6SZbiMPQzxTJNbR w5opHll5iQXlTOU2SjXIthTYPIG8IQdS12P53rl60WKaDeXphu86M8doJ7H1v5NN MGogP4QoV744v6Vw6EshRzvZVx68V2SUngxfzfhcqmJuRz82PTQwSfeASUTnhHGj 7GGWsCYev/c4oLCjnItzGwrySe1ffNMOTbOF50q3lD7OYE9lbHI+zi1LOeSlyxAv 4n/OJ9bds1A4Y4/WWfHpDhF1aDc+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdduvddgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 14 Oct 2021 12:04:28 -0400 (EDT) From: Thomas Monjalon To: Gregory Etelson , Ferruh Yigit Cc: dev@dpdk.org, matan@nvidia.com, rasland@nvidia.com, olivier.matz@6wind.com, Ray Kinsella , Bernard Iremonger Date: Thu, 14 Oct 2021 18:04:24 +0200 Message-ID: <2579877.6F7bSuhg24@thomas> In-Reply-To: <84a9b713-4b1d-fb46-5b7d-da8af9411171@intel.com> References: <20210527152858.13312-1-getelson@nvidia.com> <20211013171354.27817-3-getelson@nvidia.com> <84a9b713-4b1d-fb46-5b7d-da8af9411171@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v6 2/2] net: introduce IPv4 ihl and version fields X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" 14/10/2021 17:11, Ferruh Yigit: > On 10/13/2021 6:13 PM, Gregory Etelson wrote: > > struct rte_ipv4_hdr { > > - uint8_t version_ihl; /**< version and header length */ > > + __extension__ > > + union { > > + uint8_t version_ihl; /**< version and header length */ > > + struct { > > +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN > > + uint8_t ihl:4; /**< header length */ > > + uint8_t version:4; /**< version */ > > +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN > > + uint8_t version:4; /**< version */ > > + uint8_t ihl:4; /**< header length */ > > +#else > > +#error "setup endian definition" > > +#endif > > Do we need the last 'else' part? > Although it is harmless to have it, other protocol headers for endianness > check doesn't have this part, so I think better to be consistent. In lib/eal/include/generic/rte_byteorder.h we already have #if !defined(RTE_BYTE_ORDER) #error Unknown endianness. #endif So indeed we don't need this last else part.