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 CF590A0C41; Mon, 2 Aug 2021 15:49:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5FCF941147; Mon, 2 Aug 2021 15:49:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id F365E40140 for ; Mon, 2 Aug 2021 15:49:02 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 172DjgiI021386; Mon, 2 Aug 2021 06:49:00 -0700 Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2048.outbound.protection.outlook.com [104.47.51.48]) by mx0b-0016f401.pphosted.com with ESMTP id 3a6b46s88p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 Aug 2021 06:49:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kJkoEzvMMoaxf5Le/BRdJCs3sP1jHH9tzYygobMKkG3ON+40fsL4H4k55Pxtv9MnNrotYJ7831QyfJ6Qo8znVrL5C4iD3hPf21DjLsCUTe0WtkOvu66yNc4USCz5WWU7kQeRfQTpAC9/PcPU5A3LnCO6qa2bK0pwKIiKDgRZ+0q37F+qcUvj0Kt7vOZBxV/MqF/wrSYw8KeXrwsreWfy8+bY1vMjDcIWf1bqGXpa6sopidcMQ7S3JSWhJh3Sw+glhZBd0wz6hrTHIQr8uDWTXXdhOhJCdyq8LH6r/XgcIsyzBR5Br3vMctyC1sKaRhQetBigwIeBRjfff+QXqPyFLA== 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=aTEDIE5sbwrRWkpeFtSYakumRIAOCe8iwxYjUh/+SQU=; b=f4DcoiK1x/WtVFY4ZoFVi0MjkP4MA2T5CThd6Mc6JITueu6WKDp4OzD7H/gyhaJd8Hc2ZqjfCpzoglCK7ipthS1CsWpeQ93Z8MkDjKNd/V5ywqLe4P5YWffEBEg/oJdRE/z838Tf9aiglV1gMm6iLn5/gf5QbRC+ZvXheylpkZEaPuAMHCLNfjSt3DWMTKdL+z2WYKQ79RobsRBXgTo24IfybHa+oqqK6WW/LtF+0cL7tXKG6DO/UzxEllwPpE9TKMbiC8av++0b6S6A36XbMXEYE1aqvJe39TlPyehywbhb/99ZcYqQLadK6/rWfJr5aKoAFBnL2lI/gQHAZZA36A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aTEDIE5sbwrRWkpeFtSYakumRIAOCe8iwxYjUh/+SQU=; b=UcjHl6fvWQ7Bgwx6KWy99GhQ5aHkihtcx2EHBC705ddTH2NvJMO8SLbMoviMnNwiKpyUt4jQ6AkHe8yUL+AboKRKkkgAWn1QnntLv0C7H6jv7b7sh+9rDDrVUK29JrZUMYO56dEWwtRgM7PDAsB6VFGlbXr6zLaBr1IHN+iAf70= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO6PR18MB4386.namprd18.prod.outlook.com (2603:10b6:5:350::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Mon, 2 Aug 2021 13:48:59 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1455:9a67:a6e7:e557]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::1455:9a67:a6e7:e557%7]) with mapi id 15.20.4373.026; Mon, 2 Aug 2021 13:48:59 +0000 From: Akhil Goyal To: Dmitry Kozlyuk CC: Thomas Monjalon , "dev@dpdk.org" , Ferruh Yigit , Fiona Trahe , Khoa To , Ray Kinsella , "andrew.rybchenko@oktetlabs.ru" , "olivier.matz@6wind.com" , "navasile@linux.microsoft.com" , "pallavi.kadam@intel.com" , "ranjit.menon@intel.com" , "bruce.richardson@intel.com" , "stephen@networkplumber.org" Thread-Topic: [EXT] Re: [dpdk-dev] [PATCH v4] doc: announce API changes for Windows compatibility Thread-Index: AQHXh5fJMf1504ykvkC2n8np3S2IWKtgKKiggAAE7oCAAAzhsA== Date: Mon, 2 Aug 2021 13:48:58 +0000 Message-ID: References: <20210520184254.16790-1-dmitry.kozliuk@gmail.com> <20210721195557.762726-1-dmitry.kozliuk@gmail.com> <20210721195557.762726-2-dmitry.kozliuk@gmail.com> <9358059.UORW4hmLsd@thomas> <20210802160037.6f8f9c0b@sovereign> In-Reply-To: <20210802160037.6f8f9c0b@sovereign> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=marvell.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 844fb36d-9c48-43a8-b9ff-08d955bc4770 x-ms-traffictypediagnostic: CO6PR18MB4386: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GxF1nlrSWeNWwCUeg945NQZlVYxAtwgpEcWRjtH8k36SYbbx9SrmP/Qossm4Kb3sB5xtD/Pf7vnnRdiJF6r1LtZ9qOl+GgIUeJl4rcZWoDMsj3RAeJXlf6Wvtlqmx58mvdR2kGVsCJjP9mJpr1PUQR36UFq/Ig94jYhCqbvTAq1a/NGDBR2h1hgPPwkZqWxT95v/f8ZlzzV/h0x+zL3gABytWt3JjxfXrYZVgF4lcTny4rtpwZjukY9jhOcmdla8vbq0EdEMzpr3T57EE2xV2CXQKy7ODqGzRPUsJAGrL6DnxYk9dnWrBNkor0ik/jvoxcuLGgKq+yiFBRLlnifZ06WvjgzSRotWYNGpTRv7t0NYpGx6X9m5dKfkIdgKckKLsep9rcv55mnmn4jLkX6OsijMdpJJG7WfQzc5XJDLvShNCpqrtPNme27jLHtJulSx72H+Ig0iXr67PjiX9VnqZL6oS3vSRxdfDzN/J3EIkAy8M/gkEeJVvQH3Dhre0HAlSp8gw0Q8yS9SQA53a9ZjHTYpYFzDSGjdVRBkLPzhk7d8zFHYPw20rMXUjAcuL6iZhKzTpbn5ZOkzEQbb2G9yGBNnAOXoAByaBqCwu7lAe+Toz8goc79HH1altvxTWASnNzLSwT8RhHFKH2heCMqVFSki+tQxL7q+x15vymRdDMz/wWT26zN9v7gmW2EGIQAmZMpSd4QitppCjhERo1tUtw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(376002)(39860400002)(396003)(366004)(55016002)(9686003)(2906002)(6916009)(122000001)(4326008)(7696005)(55236004)(5660300002)(6506007)(316002)(54906003)(478600001)(83380400001)(71200400001)(38100700002)(26005)(86362001)(7416002)(33656002)(66476007)(66446008)(8936002)(52536014)(76116006)(186003)(38070700005)(66556008)(66946007)(64756008)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?duU/fWU/hu68q16azXaMzc12qrDa4zIQzIecpLl9JhxjQgczmLhy8mKDfips?= =?us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Fsh7IV16dV3PUvwtdijP?= =?us-ascii?Q?Ktt6aYNxuv2i7oxOks6xXSl34kDgkvFUgwROEW96PuC1m62g+aMlaxPVYm4U?= =?us-ascii?Q?D6muSmGbvZ3WnZ013/YoHoDvHgdhx9rpOv0xgGeDbmuL6DKmft66PXelaR6k?= =?us-ascii?Q?G9KO3Jpz1wOoF6GI5Z6DXt1Ji6zMz+xDxa483giUI2YQoIaLHKH1gj6eZ1uv?= =?us-ascii?Q?RPIY1JDobSxfS+Hi0qFsM+qnkChs7UXw5brZWYx+CkByD0S5MYRFSVG4s+wA?= =?us-ascii?Q?1yDsAZSVoGTCV34jKfchgy0qVbm6FJXI6O7q3UPOsBXjmOPAetD/138rJW4l?= =?us-ascii?Q?kR2nww1774qOZghKIzEjR+VdJVHkJC+47uKzRAB9YhryKYryGlxk5jlk1BKk?= =?us-ascii?Q?B075N4pXGqf9PyaBI/k5od3g?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 844fb36d-9c48-43a8-b9ff-08d955bc4770 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2021 13:48:58.9223 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 82fFUhq4XzNr/ZtcYE4Iw1j1o8QtHqNfcJEoDDcH5apuyuKs0ynYhIlg1dznb4P/ZfErf/FudQMUqnh1hMHf0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR18MB4386 X-Proofpoint-GUID: IMTF-hQMK0CU3QC9oCqUPIymSRH7E-gE X-Proofpoint-ORIG-GUID: IMTF-hQMK0CU3QC9oCqUPIymSRH7E-gE X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-08-02_05:2021-08-02, 2021-08-02 signatures=0 Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v4] 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" > 2021-08-02 12:45 (UTC+0000), Akhil Goyal: > > > 21/07/2021 21:55, Dmitry Kozlyuk: > > > > 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] =3D 0; /* ERROR: `addr_s` is a macro= */ > > > > > > > > Example 3: > > > > > > > > #include > > > > #include > > > > struct in_addr addr; > > > > addr.s_addr =3D 0; /* ERROR: there is no `s_addr` field, > > > > and `s_addr` macro is undefined by DPD= K. */ > > > > > > > > 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 > > > > --- > > > > +* net: ``s_addr`` and ``d_addr`` fields of ``rte_ether_hdr`` struc= ture > > > > + will be renamed in DPDK 21.11 to avoid conflict with Windows > Sockets > > > headers. > > > > + > > > > +* compressdev: ``min`` and ``max`` fields of ``rte_param_log2_rang= e`` > > > structure > > > > + will be renamed in DPDK 21.11 to avoid conflict with Windows > Sockets > > > headers. > > > > > > The struct rte_param_log2_range should also be renamed to include > > > "compress" prefix. > > > But as we break the struct API, it is not an issue I guess. > > > > > > > +* cryptodev: ``min`` and ``max`` fields of ``rte_crypto_param_rang= e`` > > > structure > > > > + will be renamed in DPDK 21.11 to avoid conflict with Windows > Sockets > > > headers. > > > > > > Acked-by: Thomas Monjalon > > > > > Can we have a local variable named as min/max? > > If not, then I believe it is not a good idea. >=20 > Yes, except for inline functions in public headers. > The only problematic one I know of is this (rte_lru_x86.h): >=20 > static inline int > f_lru_pos(uint64_t lru_list) > { > __m128i lst =3D _mm_set_epi64x((uint64_t)-1, lru_list); > __m128i min =3D _mm_minpos_epu16(lst); /* <<< */ > return _mm_extract_epi16(min, 1); > } >=20 > Fixing it breaks neither API nor ABI, thus no explicit deprecation notice= . OK, Acked-by: Akhil Goyal I hope when windows compilation is enabled, it will be part of CI and it wi= ll run on each patch which goes to patchworks.