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 79E90A056A; Thu, 11 Mar 2021 17:19:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E8F1160823; Thu, 11 Mar 2021 17:19:23 +0100 (CET) Received: from mail1.bemta25.messagelabs.com (mail1.bemta25.messagelabs.com [195.245.230.65]) by mails.dpdk.org (Postfix) with ESMTP id B8547406A3 for ; Thu, 11 Mar 2021 17:19:22 +0100 (CET) Received: from [100.112.198.228] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-1.bemta.az-b.eu-west-1.aws.symcld.net id 79/15-49021-A034A406; Thu, 11 Mar 2021 16:19:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAJsWRWlGSWpSXmKPExsWSoc9iqcvp7JV g8H+jucW7T9uZHBg9fi1YyhrAGMWamZeUX5HAmjG9X6XgvmpF16odzA2MR+S6GLk4GAWWMktc 2DWfFcI5xiKx6+85ZghnD6PEzR9tbCAOi8BWZolPDyYygjhCAouYJJ48mcYM4dxllFi7fiF7F yMnB5uAicSrvc1MILaIgI9E57odYEXMApeZJf7vmgCWEBYIl7h07TgbRFGExMw/k1ggbCOJFZ vWs4LYLAKqEs9vLQIaysHBKxArMfF5AEhYSKBAov3zbrAxnAJ2EgemrgArZxSQlfjSuJoZxGY WEJe49WQ+WI2EgIDEkj3nmSFsUYmXj/9BPdrHKPHg9Ew2iISlxPmpv6CKZCUuze9mhLB9JTZ/ 2ssCYetI9N59CFVTILHoxEc2kNskBFQk/h2qhAirSTQe2gQ1Uk5iVe9DqFYZiQc3toODUUJgD 6vEl3PPWCGcbhaJjVN7mSYw6s9CcjiErSOxYPcnNghbW2LZwtfMIDavgKDEyZlPWBYwsqxiNE 8qykzPKMlNzMzRNTQw0DU0NNI1tLTQNTbQS6zSTdJLLdUtTy0u0TXUSywv1iuuzE3OSdHLSy3 ZxAhMMCkFx+R2MPa++aB3iFGSg0lJlDeDzytBiC8pP6UyI7E4I76oNCe1+BCjDAeHkgQvryNQ TrAoNT21Ii0zB5jsYNISHDxKIrzsTkBp3uKCxNzizHSI1ClGS44JL+cuYuY4dnQekLz5fskiZ iGWvPy8VClxXkeQeQIgDRmleXDjYAn5EqOslDAvIwMDgxBPQWpRbmYJqvwrRnEORiVhXj+QtT yZeSVwW18BHcQEdJCXKthBJYkIKakGpqSLf0Sfbg2KYz7/snvvhKreyVV3eSMCrt1n+rbs7PM L+w57HDxYzbZ735qvuZXycmHHKwNWrWFlcG7LTzzCPU2zYeE235sb0n5HPk28f+Vl5sYr7544 L1pnrdC/tGQCz83pK9/O3sg74eB/66r+X/PCbGoOTtBfoqXX9GGx37yiBMYDZ/LWx+yIUNa+8 IS9YvfED1rGvu4rjbczJ7knHCuzC83YkqLGoMGguGH5YXunFf9uaSeWfDq8ZvuVH3euHvXw8N PUDlO5pZDdEmOjIrLF1fvp9AeH/Y15ZtQcNZsVO9uG9ZnOFr3fnNJLPjWoJXNaPLqyrOdsp86 hv8cy61onvjohe+9CV9yeF67XC5iVWIozEg21mIuKEwH4IE3kQwQAAA== X-Env-Sender: John.Alexander@datapath.co.uk X-Msg-Ref: server-13.tower-288.messagelabs.com!1615479561!1043764!1 X-Originating-IP: [104.47.4.57] X-SYMC-ESS-Client-Auth: mailfrom-relay-check=pass X-StarScan-Received: X-StarScan-Version: 9.60.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23655 invoked from network); 11 Mar 2021 16:19:21 -0000 Received: from mail-am5eur02lp2057.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (104.47.4.57) by server-13.tower-288.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 11 Mar 2021 16:19:21 -0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HWa/LrmlIQL/KcZBcCSmAg8xItwAf/6irywOEJPw+pETt7EuDeZbageLr8eGgkYskJChoYcERezc2nLYQW3iJqgUslc8wZ6LKIWWsaFnszznMJxc3r/4nnYTcb7yI8kHaoTA/aAfQ2hFB14OJgOdhKTr/q941+moefO/iAXtQ3n+2rERXRdfuvB33mlnhXUanemWIUVw42MYd57x5HUy3b+XaX+q9FMR7zxSCz3AQwSGLRFNv9zjFAQYJjFbSXkDBog+g7ScmExdmEciNvYuyIbtHyjkerTZzB0/6nhjHFmOhiRfSP37rDNkCtksHVv4N0qX7pPIyRN+1mBrEFv8kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FB1dpaYeop7t8biwevCoO3H63c7yumUOkLnqvt5iOnk=; b=S1+5C4wqIgk4JynwQjcH7aGX2dySGOsye8kgcqkdJUa0WaPEL5zRqIS9hTRRRE/uVDBv0vEniLkGGUAtJa5/chlQR6Ku3cUc5gthekDp9suzaDo/CYfL1f7nFN9qA/6OP03M/Nd5K6iCcN+YFK9x5XSAVyc73ZOSgloZ7y9JpQ54J6G1sbZy0WsMEHVdPCv/vA0fFPfSw9jZgcyhNivABmihDYsg9RhQp6Vwhhrgg+7VqiXDlXDA7HHd7ZPKClXThxU4WNNU4ydKcY6vkIgunutL8PuNJ07wTPoB6BcjC+rZSZSsiZugsJiz8SE0NigZ+1UKgnBgu/LaoTkA5duH5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=datapath.co.uk; dmarc=pass action=none header.from=datapath.co.uk; dkim=pass header.d=datapath.co.uk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datapathuk.onmicrosoft.com; s=selector2-datapathuk-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FB1dpaYeop7t8biwevCoO3H63c7yumUOkLnqvt5iOnk=; b=B0oJCIuw27ySM3enuVlQ/DRoqpWd0qC3UgoSfJioBqBaNGl2ORIlBTbabwR5AJF2It0+6lZrlZwMNwdveIXUbKKPNgnucVOIxf3EXiK71CRb7JOSPJNaJKBWaBY7dEpT0ApIVBfVC2G2530VJnmjQfjyNXx81ItLN6Csgv/mbys= Received: from AM9PR09MB4900.eurprd09.prod.outlook.com (2603:10a6:20b:30e::18) by AM4PR0902MB1795.eurprd09.prod.outlook.com (2603:10a6:200:95::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Thu, 11 Mar 2021 16:19:20 +0000 Received: from AM9PR09MB4900.eurprd09.prod.outlook.com ([fe80::920:fa3a:8689:903e]) by AM9PR09MB4900.eurprd09.prod.outlook.com ([fe80::920:fa3a:8689:903e%5]) with mapi id 15.20.3912.031; Thu, 11 Mar 2021 16:19:20 +0000 From: John Alexander To: Dmitry Kozlyuk , "dev@dpdk.org" CC: Ferruh Yigit , Pallavi Kadam , Dmitry Malloy , Narcisa Ana Maria Vasile , Stephen Hemminger , Tyler Retzlaff , Declan Doherty , Fiona Trahe , Ashish Gupta , Ray Kinsella , Neil Horman Thread-Topic: [dpdk-dev] [PATCH v2] doc: announce API changes for Windows compatibility Thread-Index: AQHXFgi7rPBUdAZ0bk2SmpzKd3aBNap+98Zw Date: Thu, 11 Mar 2021 16:19:20 +0000 Message-ID: References: <20210303225121.16146-1-dmitry.kozliuk@gmail.com> <20210310235421.23259-1-dmitry.kozliuk@gmail.com> In-Reply-To: <20210310235421.23259-1-dmitry.kozliuk@gmail.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2a00:23c4:403:e001:5164:ada9:e94:5dec] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a2585bea-3663-4818-5490-08d8e4a96d43 x-ms-traffictypediagnostic: AM4PR0902MB1795: x-microsoft-antispam-prvs: x-ms-exchange-transport-forked: True x-ms-oob-tlc-oobclassifiers: OLM:2887; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +6Bml9eM/W+mxWAtjIU3T7tPWhhz665TlD4O4pL65K68hZqdzJbYUUKBD/R4qr2H5zM43pxAyw5zaHYlsoz+caFT51vyDquIAYml8d/iljf53FPUZIqdg595Tv+aZAllTAHkj2UGaBh5c7HBPHCGm8t+8V4bqQDkwHWrWgOdMdKTaiuaWBP+xS6w/YDoQmAM04kvqk4NJOGoXLCKE9Z7skRxSB0Cce0Bb3xlhR9l4kt9jPchJuNSqB4SKxKs1OPR/mUZwWE2OVyLgR3VMTjFq1lbyaH0VsikroCu2zSgvmHk685blO8rK3K21q7QC2zeuxaxr+bQe+czK3gfqfChDBTmjNdd7gL1nxcaOvkDWUfj1YhneEKaeyXkpgcKh9O/ELqiMfg6300CLSZbq0NkYiY43clUej/kMQ2HFW/kbWpquvzOGPMP4A2B6lOSxcbVfo8FAyKN3T7w4PR+RDjiRSAoyl1+SNGdVWaUoDHAepvjG7OeFXEZzhVLkPeqsO1PWFFHg5zpfXWS590qt00XEwkG35P9Il8gteWpvlIM+Xde7DLa6Ucdi6XzJ4UI8lu47JAad9s693Ad1XYaRzYM7EdRmvW92bBzT3Yu6/7ESzswkPIKVn1fH8OBBV/jBArUCR4TynK6+dbdOnstUI0Mhg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR09MB4900.eurprd09.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(136003)(39840400004)(346002)(396003)(107886003)(8676002)(4326008)(33656002)(8936002)(86362001)(83380400001)(76116006)(53546011)(55016002)(54906003)(9686003)(6506007)(316002)(64756008)(66556008)(186003)(66476007)(66446008)(66946007)(110136005)(71200400001)(478600001)(966005)(52536014)(45080400002)(5660300002)(7696005)(2906002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?5z9XtKdVQg7xO73UOKbaAmzv11XLpFjHe/ixHD15Ti9g8gBJTl/4Sghwi9GP?= =?us-ascii?Q?ZIePAEpvn4Obbn8YGTNKFX2gwAnFRZpJbw0BNy5Ja68JPPBCRJsnNGY/Gilb?= =?us-ascii?Q?PHxPvPfd53BbZRDOMC5MQpXwBkKG1UcoVWxJchDQ5lT0nQsWdkVL7ctnmMz+?= =?us-ascii?Q?vZvsHSU65/kh07C1NIW4//KO7nSiJ5i9tRL4sbPkTELI57myuNw2nVB0UkT/?= =?us-ascii?Q?0EBgP7f3+a+xPHv5v61Z9LfNmI/j5E3gXIWV+/j9rJM1eyaNylFiD6kcv3Nf?= =?us-ascii?Q?h+PIcgAw4iKoQFsM3zQBdj57YH3nvnOAcX5/KS1YV4r5sSmnlKwOMM5H3Zwo?= =?us-ascii?Q?8yizo60gRtYapfQAiO60wddLe1LFqszL5ht0tADsXmEcjz4atsMbEGVRKQd6?= =?us-ascii?Q?HjwssOkdlvMUwc05S9KLZLeuACcugC9q+ctUZqVAL1pZiUiqOKxw4/OSXwYr?= =?us-ascii?Q?CPJn0jegoyxXlf9XVxT6MHR422HK1UN0Shy4egzpbziG+gYCYsnIP2WRYxDQ?= =?us-ascii?Q?MkAv3TEK/CneEqNoXkxRbhKWV6pfDfxvZbWvSp2MHgymddGPx8sY6xptM75x?= =?us-ascii?Q?xcBPSsUxGDX6BTElIHehYePJD6smpC85A5/ZsX76v05oTsAfrKkleV+4i1z8?= =?us-ascii?Q?qPgR8JNgK4mCcizDJcghvLnIBbPh52Z2958VoBQLJZSouorhyDqmcYrEd025?= =?us-ascii?Q?erdWh8H2rYBTc1Z0+PiFA0rDZhbTSPp5Jsg1+NHlVF0umaIPkUOrT26MPMtF?= =?us-ascii?Q?teKYNdzUDjpMTHMzxlYLl1Pqm8bZYsLBv7bKgNJXFiEItV5ZnymIkuReaU+w?= =?us-ascii?Q?Jc71vYbkcypsQIj8o3tLRNehf399t+NOxsaRmaSklViVP4mzvcfTnWNv30qX?= =?us-ascii?Q?mJTSEc2cRNunPZJlV8k8ZI8i4o3f9O48GNk+37ZCjR86Q7zQdLkDys673LZE?= =?us-ascii?Q?Lg4bwMFi9WIEfOYR1Qp5yMdmtdLyIO28P9dcrq/zmke3uEUlxZmKx+E5sOnx?= =?us-ascii?Q?DPOslIIUYcYOff5WBkIYtP2Xrrk0nfob2k4BkyLI2lEzxzYDEUxpHYJ0bz8o?= =?us-ascii?Q?FUQy1zdgUzwW1ZJRPC76aoi8XYbp4AUatjlyX0oiXG6OLtZiUPjLRyOzvl9V?= =?us-ascii?Q?Fz1Q0tDryanaweIwNBwXRTDELOE5V9ZB/DTGahSg9WqaBMCaM/T/329j45vc?= =?us-ascii?Q?4tBRqf9vGwgSQTHzDVOnpZLCsPP+0J0J8h7W+LQNlSeQ3EjQNWdvGU3mM6ys?= =?us-ascii?Q?gSCJX601j7/IVUgU0awX6X8KvjSDW60odcX7qpWwSSln3lNBb/oNkVuJJ/1U?= =?us-ascii?Q?FT3NohiXTrWy5QfKdBQUqmzMkvzCuLRJTk0DFD5e2jSQUtZ0XcauZ7RSb2wZ?= =?us-ascii?Q?rRlrZDw=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: datapath.co.uk X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4900.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2585bea-3663-4818-5490-08d8e4a96d43 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2021 16:19:20.5316 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 102e0f24-523c-4823-a9ce-5a8ebc4e32a7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xD1zP1fvkfUYpaH9Z/3WkQ5NQol7LbQzh7660fgzo02nOJfMK0zPXSoO8518EhsYP3LVX9mKdl5QNTRizWGjgDn7nMPdxMaFfEMLTM7+bJ8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0902MB1795 Subject: Re: [dpdk-dev] [PATCH v2] doc: announce API changes for Windows compatibility 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" > -----Original Message----- > From: dev On Behalf Of Dmitry Kozlyuk > Sent: 10 March 2021 23:54 > To: dev@dpdk.org > Cc: Ferruh Yigit ; Pallavi Kadam > ; Dmitry Malloy ; > Narcisa Ana Maria Vasile ; Stephen > Hemminger ; Tyler Retzlaff > ; Declan Doherty > ; Fiona Trahe ; Ashish > Gupta ; Dmitry Kozlyuk > ; Ray Kinsella ; Neil Horman > > Subject: [dpdk-dev] [PATCH v2] doc: announce API changes for Windows > compatibility >=20 > CAUTION: This email originated from outside of the organization. Do not c= lick > links or open attachments unless you recognize the sender and know the > content is safe. >=20 > Windows socket headers define `s_addr`, `min`, and `max` macros which > break structure definitions containing fields with one of these names. > Undefining those macros would break some consumers as well. >=20 > Example 1: >=20 > #include > #include > struct in_addr addr; > /* addr.s_addr =3D 0; ERROR: s_addr undefined by DPDK */ >=20 > Example 2: >=20 > #include > #include > struct rte_ether_hdr eh; > /* eh.s_addr.addr_bytes[0] =3D 0; ERROR: `addr_s` is a macro */ >=20 > It is proposed to rename the conflicting fields on DPDK side, because Win= 32 > API has wider use and is slower and harder to change. >=20 > New names are left unspecified, open suggestions: >=20 > * `struct rte_ether_hdr` (by Stephen Hemminger): >=20 > * `s_addr` -> `ether_shost` > * `d_addr` -> `ether_dhost` (for consistency) >=20 > * `struct rte_param_log2_range`, `struct rte_crypto_param_range`: >=20 > * `min` -> `minimum` > * `max` -> `maximum` The min/max macros in the Windows headers cause issues with C++ projects al= so (breaks std::min/std::max). The fix there is to "#define NOMINMAX" prio= r to including windows.h, maybe that's appropriate here too? >=20 > For `s_addr`, a workaround is possible to use it until 21.11. > For `min` and `max`, no workaround seems available. If cryptodev or > compressdev is going to be enabled on Windows before 21.11, the only > option seems to use a new name on Windows (using #ifdef). >=20 > Workaround for `s_addr` is to define `struct rte_ether_hdr` in such a awa= y > that it can be used with or without `s_addr` macro (as defined on Windows= ): >=20 > #pragma push_macro("s_addr") > #ifdef s_addr > #undef s_addr > #endif >=20 > 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); >=20 > #pragma pop_macro("s_addr") >=20 > Signed-off-by: Dmitry Kozlyuk > --- > v2: * Propose to rename all problematic fields identified so far. > * Leave future names unspecified, no need to promise now. > * Propose better names for MAC addresses (Stephen Hemminger). >=20 > Thread about `s_addr` workaround: > https://mails.dpdk.org/archives/dev/2021-March/200700.html > Tyler Retzlaff confirmed offline that Microsoft took similar approach. >=20 > doc/guides/rel_notes/deprecation.rst | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/doc/guides/rel_notes/deprecation.rst > b/doc/guides/rel_notes/deprecation.rst > index 64629e0641..854618f091 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -130,3 +130,12 @@ 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 in DPDK 20.11 to avoid conflict with Windows Sockets > headers. > + > +* compressdev: ``min`` and ``max`` fields of ``rte_param_log2_range`` > +structure > + will be renamed in DPDK 20.11 to avoid conflict with Windows Sockets > headers. > + > +* cryptodev: ``min`` and ``max`` fields of ``rte_crypto_param_range`` > +structure > + will be renamed in DPDK 20.11 to avoid conflict with Windows Sockets > headers. > -- > 2.29.2