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 E1D26A0C4B; Thu, 17 Jun 2021 17:02:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FDEE4067A; Thu, 17 Jun 2021 17:02:44 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 66CB940150 for ; Thu, 17 Jun 2021 17:02:43 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id B21D120B8760; Thu, 17 Jun 2021 08:02:42 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B21D120B8760 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1623942162; bh=/VJKD8yqT7Vn4Wdy1UvbUxRiaDWEfCcsaRn9Vp+bx4Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EqY95WhIK5+Z8sohRTZltyoIXJQs6QiCkHmd1iJ4Q4mJzllVTWclo+pQ10KILq6Wo mpcRLkVZBrECaE7KJh/HEaRwIVQGVMk7JubF9Wkg5iEbFi0qBq22MaipfbWc86Ebau xMeR++EqG5CTzBf805Jqz1+yE2nwOaXOBwDwtzbM= Date: Thu, 17 Jun 2021 08:02:42 -0700 From: Tyler Retzlaff To: Gregory Etelson Cc: dev@dpdk.org, matan@nvidia.com, orika@nvidia.com, rasland@nvidia.com, Bernard Iremonger , Olivier Matz Message-ID: <20210617150242.GC29777@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20210527152858.13312-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210527152858.13312-1-getelson@nvidia.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH] 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" On Thu, May 27, 2021 at 06:28:58PM +0300, Gregory Etelson wrote: > diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h > index 4b728969c1..684bb028b2 100644 > --- a/lib/net/rte_ip.h > +++ b/lib/net/rte_ip.h > @@ -38,7 +38,21 @@ extern "C" { > * IPv4 Header > */ > struct rte_ipv4_hdr { > - uint8_t version_ihl; /**< version and header length */ > + __extension__ this patch reduces compiler portability, though not strictly objecting so long as the community accepts that it may lead to conditional compilation having to be introduced in a future change. please also be mindful of the impact of __attribute__ ((__packed__)) in the presence of bitfields on gcc when evaluating abi compatibility. > + union { > + uint8_t version_ihl; /**< version and header length */ > + struct { > +#if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN > + uint8_t ihl:4; > + uint8_t version:4; > +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN > + uint8_t version:4; > + uint8_t ihl:4; > +#else > +#error "setup endian definition" > +#endif > + }; > + }; > uint8_t type_of_service; /**< type of service */ > rte_be16_t total_length; /**< length of packet */ > rte_be16_t packet_id; /**< packet ID */ > -- > 2.31.1