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 A435CA0A0A; Thu, 20 May 2021 16:25:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 781E9410E9; Thu, 20 May 2021 16:25:07 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 0BD3040143 for ; Thu, 20 May 2021 16:25:05 +0200 (CEST) IronPort-SDR: GaM9QhNu8DLh1F7AymR15ot7FFK5q53gNbDU2UtFugoL41AAD6zjM67WbD4BgWFNEs8VBPYd16 I4HcWrVe5TqQ== X-IronPort-AV: E=McAfee;i="6200,9189,9989"; a="201293163" X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="201293163" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2021 07:24:43 -0700 IronPort-SDR: byVzkcWeZs6t2Cfi49yJD9IKIInRb73mDtYBin2+UC99QGHNhDSg8u8f5wZ3cLrMPwstK+5POJ +4hTvZoERyig== X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="433917719" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.241.8]) ([10.213.241.8]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2021 07:24:40 -0700 To: Dmitry Kozlyuk , dev@dpdk.org Cc: Pallavi Kadam , Dmitry Malloy , Narcisa Ana Maria Vasile , Ray Kinsella , Neil Horman References: <20210303225121.16146-1-dmitry.kozliuk@gmail.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <06b13bfe-667d-6f26-eb7d-f487c5a3f397@intel.com> Date: Thu, 20 May 2021 15:24:37 +0100 MIME-Version: 1.0 In-Reply-To: <20210303225121.16146-1-dmitry.kozliuk@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] doc: announce renaming of rte_ether_hdr 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 3/3/2021 10:51 PM, Dmitry Kozlyuk wrote: > It is proposed to rename fields of `struct rte_ether_hdr`, > `s_addr` tp `src_addr` and `d_addr` to `dst_addr`, s/tp/to/ > due to the clash with system macro on Windows. > Until remaining is done in 21.11, a workaround can be used. s/remaining/renaming/ ?? > > Windows Sockets headers contain `#define s_addr S_un.S_addr`, which > conflicts with `s_addr` field of `struct rte_ether_hdr`. Undefining > this macro in is breaking some usages of DPDK > and Windows headers in one file. > > Example 1: > > #include > #include > struct in_addr addr; > /* addr.s_addr = 0; ERROR: s_addr undefined by DPDK */ > > Example 2: > > #include > #include > struct rte_ether_hdr eh; > /* eh.s_addr.addr_bytes[0] = 0; ERROR: `addr_s` is a macro */ s/addr_s/s_addr/ ?? > > It is not mandatory to rename `d_addr`, this is for consistency only. > Naming in `rte_ether_hdr` will also resemble `rte_ipv4/6_hdr`. > > Workaround is to define `struct rte_ether_hdr` in such a away that > it can be used with or without `s_addr` macro (as defined on Windows) > This can be done for Windows only or for all platforms to save space. > > #pragma push_macro("s_addr") > #ifdef s_addr > #undef s_addr > #endif > > struct rte_ether_hdr { > struct rte_ether_addr d_addr; /**< Destination address. */ > RTE_STD_C11 > union { > struct rte_ether_addr s_addr; /**< Source address. */ > struct { > struct rte_ether_addr S_un; > /**< MUST NOT be used directly, only via s_addr */ > } S_addr; > /*< MUST NOT be used directly, only via s_addr */ > }; > uint16_t ether_type; /**< Frame type. */ > } __rte_aligned(2); > > #pragma pop_macro("s_addr") > What is the problem with the workaround, why we can't live with it? It requires an order in include files, right? > Signed-off-by: Dmitry Kozlyuk > --- > doc/guides/rel_notes/deprecation.rst | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst > index 82c1a90a3..f7be10543 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -125,3 +125,7 @@ Deprecation Notices > * cmdline: ``cmdline`` structure will be made opaque to hide platform-specific > content. On Linux and FreeBSD, supported prior to DPDK 20.11, > original structure will be kept until DPDK 21.11. > + > +* net: ``s_addr`` and ``d_addr`` fields of ``rte_ether_hdr`` structure > + will be renamed to ``src_addr`` and ``dst_addr`` respectively in DPDK 20.11 v21.11 > + in order to avoid conflict with Windows Sockets headers. >