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 DE8E1A0565; Wed, 3 Mar 2021 23:51:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D69440683; Wed, 3 Mar 2021 23:51:34 +0100 (CET) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mails.dpdk.org (Postfix) with ESMTP id AED8B4067B for ; Wed, 3 Mar 2021 23:51:32 +0100 (CET) Received: by mail-lj1-f177.google.com with SMTP id h4so30681014ljl.0 for ; Wed, 03 Mar 2021 14:51:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OLnQ3+jfek95YtUemvMrGiK5Fl6UAPKgzuM1hSNPIBY=; b=j9E1cYv9qjyeLGK1gaPglj3fgTqv9EuRJJ5f/Jv1TTEWor/yKHPf3N2C6bGvxemWym tt5S6q8kbcGprSMaHxOKsyYmo+pwE+nMepLSegqVf6JF9dKCbPsBkCmI/JHxwZJgrb15 o3KkWotfzAY9jyp2Bnjag6yaQ7f7KR8QuZBpFQZMBHbtsh6PorgVC/L01OCvR5ViGgxD GASkA8UazGfStuUl344rK0NRVfOL+rj5FFupryml5rzPvU64nLOOcdArldD7Z9IKEOvY 3UFSwhUO6YKW4koIkN3gqVDlBKnQ6gv1mN0m8Yl/DPqQSk6pThckA5xulAnesmJY99S0 JG+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OLnQ3+jfek95YtUemvMrGiK5Fl6UAPKgzuM1hSNPIBY=; b=HBGkag21vv3I9XwQTyWM/cRcy1xDiFuHCaTlXlCm0k4RvUfDR5nYuFfFuDLBnEcJKr 8KuivB9AsuqdAZPwPuLyAsXqwWHgHFUjafBoDkKehHHz2vTLBq6wUzvTR8EIGFykGpZR 2pnlLneFmCq0/WQF2TOSjvLWDLkMhE8ilx9Vi78kUBic4H5D4TARtZLR86G6ZJq+Bc0n GoEOVFHs1HFZ4yNYVp5kso2uPfhu9R+sEpi9/+g4zt/ok6nItOcD2F0hCjppOsd/gPzg IhsuJJu4iBbbsq/9jdxzBpUo6NXcuUMBqBbXSi5cCFsgpoBAVlyqj11xmCgrxxQ8Xgu3 +yqg== X-Gm-Message-State: AOAM531vLXStIlpjuUH2pgwtnxnotSUiNJQQyN235ZjajMXmP92qHMLP 8ms4SMTKtpql0Ir3ankk76npEHmoG3EWS7Nz X-Google-Smtp-Source: ABdhPJxfZXb7vWpoYnG4LyOcicEPWAB9whnFE4+QtXPz5Hm8OL9Uv/+qDxaiw9RedlXLkii6WGD6mQ== X-Received: by 2002:a2e:9793:: with SMTP id y19mr613953lji.374.1614811891942; Wed, 03 Mar 2021 14:51:31 -0800 (PST) Received: from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id x7sm995511ljc.118.2021.03.03.14.51.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 14:51:30 -0800 (PST) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Ferruh Yigit , Pallavi Kadam , Dmitry Malloy , Narcisa Ana Maria Vasile , Dmitry Kozlyuk , Ray Kinsella , Neil Horman Date: Thu, 4 Mar 2021 01:51:21 +0300 Message-Id: <20210303225121.16146-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [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" It is proposed to rename fields of `struct rte_ether_hdr`, `s_addr` tp `src_addr` and `d_addr` to `dst_addr`, due to the clash with system macro on Windows. Until remaining is done in 21.11, a workaround can be used. 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 */ 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") 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 + in order to avoid conflict with Windows Sockets headers. -- 2.29.2