From c4379ee599ef2f6feea914566bd494f66f7e8ad0 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlyuk Date: Wed, 21 Jul 2021 22:55:57 +0300 Subject: [PATCH] doc: announce API changes for Windows compatibility Windows headers define `s_addr`, `min`, and `max` as macros. If DPDK headers are included after Windows ones, DPDK structure definitions containing fields with these names get broken (example 1), as well as any usage of such fields (example 2). If DPDK headers undefined these macros, it could break consumer code (example 3). It is proposed to rename structure fields in DPDK, because Win32 headers are used more widely than DPDK, as a general-purpose platform compared to domain-specific kit, and are harder to fix because of that. Exact new names are left for further discussion. Example 1: /* in DPDK public header included after windows.h */ struct rte_type { int min; /* ERROR: `min` is a macro */ }; Example 2: #include #include struct rte_ether_hdr eh; eh.s_addr.addr_bytes[0] = 0; /* ERROR: `addr_s` is a macro */ Example 3: #include #include struct in_addr addr; addr.s_addr = 0; /* ERROR: there is no `s_addr` field, and `s_addr` macro is undefined by DPDK. */ Commit 6c068dbd9fea ("net: work around s_addr macro on Windows") modified definition of `struct rte_ether_hdr` to avoid the issue. However, the workaround assumes `#define s_addr S_addr.S_un` in Windows headers, which is not a part of official API. It also complicates the definition of `struct rte_ether_hdr`. Signed-off-by: Dmitry Kozlyuk Acked-by: Khoa To Acked-by: Thomas Monjalon Acked-by: Akhil Goyal --- doc/guides/rel_notes/deprecation.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index b66056215e..7105821d18 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -139,6 +139,15 @@ Deprecation Notices can still be used if users specify the devarg "driver=i40evf". I40evf will be deleted in DPDK 21.11. +* net: ``s_addr`` and ``d_addr`` fields of ``rte_ether_hdr`` structure + will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers. + +* compressdev: ``min`` and ``max`` fields of ``rte_param_log2_range`` structure + will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers. + +* cryptodev: ``min`` and ``max`` fields of ``rte_crypto_param_range`` structure + will be renamed in DPDK 21.11 to avoid conflict with Windows Sockets headers. + * cryptodev: The field ``dataunit_len`` of the ``struct rte_crypto_cipher_xform`` has a limited size ``uint16_t``. It will be moved and extended as ``uint32_t`` in DPDK 21.11. -- 2.20.1