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 56DFCA0C41; Thu, 16 Sep 2021 00:32:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D28934003F; Thu, 16 Sep 2021 00:32:15 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2048.outbound.protection.outlook.com [40.107.22.48]) by mails.dpdk.org (Postfix) with ESMTP id 305964003C for ; Thu, 16 Sep 2021 00:32:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UxIY0oc8vZ1WjEfG7xVDKLMbKW71pV9G6yj4cRrn5DI=; b=KwghtlKSA+I78Fzo8XkWGfitQbhdcEAY48PS8nsr8XGtyor+znBQIDuaCmGIMlZWQv0j7vLm9RfWC1SDvSe5Ke+b4dD6vT5Zaq9ve8+BlnBEW2IzQ+9fQJ8MWDQoP4gmsNBJz7we5mEhXV7w+oKi0YhfqCUPB72+kbTze7mjMrc= Received: from AM6PR04CA0028.eurprd04.prod.outlook.com (2603:10a6:20b:92::41) by PAXPR08MB6527.eurprd08.prod.outlook.com (2603:10a6:102:156::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Wed, 15 Sep 2021 22:32:10 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:92:cafe::78) by AM6PR04CA0028.outlook.office365.com (2603:10a6:20b:92::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Wed, 15 Sep 2021 22:32:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Wed, 15 Sep 2021 22:32:10 +0000 Received: ("Tessian outbound c21c48fbc857:v103"); Wed, 15 Sep 2021 22:32:09 +0000 X-CR-MTA-TID: 64aa7808 Received: from 99cdcf6f660a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 213516E9-3BF2-48F6-BD31-685FA019A7CD.1; Wed, 15 Sep 2021 22:31:57 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 99cdcf6f660a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 15 Sep 2021 22:31:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lk3LpD9okexS6JpW2G7uORLHxsLGGijUNqg9CxtjH7adyJs4Id9oBlRECZqmDxeC5UTg974aSt0q9LEJ9uLMcAlMpFRpBuQsr4Up0wLp+ToU1Q94wnwE2g/MpC+CHnYDudoWR8UaFH1IaeAYrP3xxt7AiZYUnHNFBtkUoAuoGTyurKAuO0lKb8QWnXpHlcUAL6WeP+dQzqb2Jx7d4JRWHieC6VBRpSD9jB/R+MxFh8Y6+qO6cT41qUJ13mkhSzVPj48ICWEfXQ6lV98rsFy3hgzFfXOn/DzulMCo9q2iAAwtQ2Zq4vEBXY7HdE7zf2RtUhS/5j2FY3FUbNFN1Np3ew== 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; bh=UxIY0oc8vZ1WjEfG7xVDKLMbKW71pV9G6yj4cRrn5DI=; b=QemM34dAEDSpL71OVOYkBsEmuYlzEC3wkznx3zkwUxb3pciRVg2rFANlzWDpKsk8iE4uC4y+11zNYhGwqFsfSxmefwWqpb72HtBsyRU/ENJm4HM5dw+2pa7UUDM6M4bZ/BePBuVhF8rSAEXyP+URZ7Po6//OBvo5/Nk6aawi2RxwP2RG2lFuVeBGL+kd/0R4ooPxzueCR3hCvs7e0hBsU7SimZ9EF74h5bWGn1QbkvLvvPLr+5QLKPrZ7/IurdtuLMSfTEqBjN3fAagopa2PRikMXLl759cTMZFPqJJnTF9uuQ9FEHwqYTrHilfDbmNbUOQsWEYk89E6FGJsQ3Fd+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UxIY0oc8vZ1WjEfG7xVDKLMbKW71pV9G6yj4cRrn5DI=; b=KwghtlKSA+I78Fzo8XkWGfitQbhdcEAY48PS8nsr8XGtyor+znBQIDuaCmGIMlZWQv0j7vLm9RfWC1SDvSe5Ke+b4dD6vT5Zaq9ve8+BlnBEW2IzQ+9fQJ8MWDQoP4gmsNBJz7we5mEhXV7w+oKi0YhfqCUPB72+kbTze7mjMrc= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DBBPR08MB5995.eurprd08.prod.outlook.com (2603:10a6:10:20b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Wed, 15 Sep 2021 22:31:54 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::8187:ccbc:30d:3464]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::8187:ccbc:30d:3464%6]) with mapi id 15.20.4523.016; Wed, 15 Sep 2021 22:31:54 +0000 From: Honnappa Nagarahalli To: Dmitry Kozlyuk , "dev@dpdk.org" CC: Konstantin Ananyev , nd , nd Thread-Topic: [PATCH 4/5] ring: rename local variables for Windows compatibility Thread-Index: AQHXqnpvce07Ju1/6kiceeBuvtOEdaulrX0Q Date: Wed, 15 Sep 2021 22:31:53 +0000 Message-ID: References: <20210915214052.143098-1-dmitry.kozliuk@gmail.com> <20210915214052.143098-5-dmitry.kozliuk@gmail.com> In-Reply-To: <20210915214052.143098-5-dmitry.kozliuk@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: FBDCD2D417B5D9409C1B2B07914B32CB.0 x-checkrecipientchecked: true Authentication-Results-Original: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 9f18d953-68aa-40ca-2f39-08d97898a859 x-ms-traffictypediagnostic: DBBPR08MB5995:|PAXPR08MB6527: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:475;OLM:475; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: V/etoVWF7YT7/Ts7gSxj7O+j3PAITpDHaV+eIl/aTLwOb7VWxasHQqDX6xty30y2rJMkJQunUmnYCn2glXNtzf0ViwoCew2AH81JicjjpUW7wbvF3gy694El0vLWwkbhwnErL6/Pu0JOyaVXcCXfVlCzPMnJwrHqSgqCdzy0wfBpl2BHArBsZxnI6iLTp872ORJNCjPA0vgGmU6KxWqkTKqqETdS9WtCGMfVcSPEdy279wgeIyHHActXKpJZTNfxyBmv2JK39UJVLXHp0dafDhRcrirdi3rO3n43sH1GlVrrze9QiqvnXWlASV3E+mklaWZkJFu8zOk4Wu2JrsaEdjJUH4fLvMJpP8Zf9ptXmv2Ku16Kqh4+MDWRwnOZzDfCxVhkWBqcUn+GioDlM7m+tbc9hqyC67KtcTsEWAva+PCdSXb2mBSsD5Lpto5/N6982cudt9Ct7Hrlz7t0YW53/LN8YOPdD4o/v0uTQsTUeV9U8nXeed2+8ygvZ4kt7seYVo9VxoJ+RxTKReLEF2SA95Q1IxZtrKjQC3tCaoNJk5Cv9hAZnkpAfCw4S5jkOW4IJSl4HExKb7PjW3CmFQo8RDEqupoBTvgo4wfeeHmezpjs8U/Hcu9grHtrIokyNUlPORGeLFd35+3fS+y3C++fNWiiVFuxXX7gs2J547pIgcC+EJv2jACH+2dLNrLFlG+Fa7KQajc5LG3apJKhuEIQcA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(346002)(366004)(376002)(396003)(5660300002)(2906002)(83380400001)(8936002)(54906003)(9686003)(122000001)(64756008)(66446008)(66556008)(478600001)(66476007)(76116006)(66946007)(7696005)(316002)(38100700002)(52536014)(33656002)(6506007)(86362001)(71200400001)(38070700005)(26005)(110136005)(4326008)(55016002)(8676002)(186003); DIR:OUT; SFP:1101; x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5995 Original-Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 5d478b72-3689-4a00-94d4-08d978989eb2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VeJ5Hgbt0oCp7pJFNqW5A6sVCgxKgmL74M4pfqoSl0E4nbK1Lpiiww5iVatzLErfjLnxg4IOmiN/CtPMETEl2T+xKO6kqO2Ydp/ByNgraCyhXb9oiZ5qM60UJxtdQeRAAHrbxEihSoNVpsXZGP3nlSi97LwECUR5L9ZwDKvKPcLp1+WFZeFH9z69k0s4XvsM+AeaVkgm4yTqO3VoEa2gAstbxAV8QE/Qy/Irp/yX1zhrVUuBErzV1z/WsYnaQMHr5BqfoOmrYuCRHU/aHNWQ43HU0RoLUmAnTQpQZk8CdgGwmOlRTNOh/DGqizNUxJsgD2mbj3hSw8svN+KedKeERr7vy6pN2PqNvwbVz48N9Gvxm6D3WP4ZQVPRs2judaHDoAB6Azer0PF5d40UROKiI1Bd7UWfxvvsu+siT9xVCBnqKqLeVZ6t3KXpIB8fn9xYxaTn8fIHqK+nOVi0tI977LCXcVfwLwEsLdusfoxaxtwLvBox/NSb5DTrHRqJkV5ZZr0NWraIadMvAUUWTom3/BpNWaTZej74em5agByOlML18e2Y4pFDWkETOlJvXPgSI+oYVIaH9ZCa0Vu8x5/TwOCGeOzzQyyqdlERRjzXv4aMb7dhWHIAtdobKwh/iQyPoRYtY/VYqPSUBafBaSOBe2Qknmal1z2uVJa54xPfRT5lcszmT9dIWaEkx9Ldl9Uw X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(39860400002)(396003)(136003)(346002)(376002)(46966006)(36840700001)(356005)(478600001)(47076005)(83380400001)(33656002)(82310400003)(86362001)(6506007)(2906002)(336012)(186003)(52536014)(8936002)(82740400003)(8676002)(36860700001)(5660300002)(9686003)(7696005)(26005)(4326008)(110136005)(316002)(54906003)(55016002)(70586007)(70206006)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2021 22:32:10.3825 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f18d953-68aa-40ca-2f39-08d97898a859 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6527 Subject: Re: [dpdk-dev] [PATCH 4/5] ring: rename local variables 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" >=20 > Windows SDK headers define `max` macro which breaks the definitions of > `max` variable inside inline functions. Rename the variables to allow inc= lusion > of both DPDK and Windows headers in the same file. Minor comment, typically we include the error message in the commit log. In= this case, even though it is obvious, it does not hurt to include it. >=20 > Signed-off-by: Dmitry Kozlyuk Reviewed-by: Honnappa Nagarahalli > --- > lib/ring/rte_ring_c11_pvt.h | 8 ++++---- > lib/ring/rte_ring_generic_pvt.h | 8 ++++---- lib/ring/rte_ring_rts_ele= m_pvt.h > | 6 +++--- > 3 files changed, 11 insertions(+), 11 deletions(-) >=20 > diff --git a/lib/ring/rte_ring_c11_pvt.h b/lib/ring/rte_ring_c11_pvt.h in= dex > 37e0b2afd6..ec6be12154 100644 > --- a/lib/ring/rte_ring_c11_pvt.h > +++ b/lib/ring/rte_ring_c11_pvt.h > @@ -58,13 +58,13 @@ __rte_ring_move_prod_head(struct rte_ring *r, > unsigned int is_sp, { > const uint32_t capacity =3D r->capacity; > uint32_t cons_tail; > - unsigned int max =3D n; > + unsigned int maximum =3D n; > int success; >=20 > *old_head =3D __atomic_load_n(&r->prod.head, __ATOMIC_RELAXED); > do { > /* Reset n to the initial burst count */ > - n =3D max; > + n =3D maximum; >=20 > /* Ensure the head is read before tail */ > __atomic_thread_fence(__ATOMIC_ACQUIRE); > @@ -132,7 +132,7 @@ __rte_ring_move_cons_head(struct rte_ring *r, int > is_sc, > uint32_t *old_head, uint32_t *new_head, > uint32_t *entries) > { > - unsigned int max =3D n; > + unsigned int maximum =3D n; > uint32_t prod_tail; > int success; >=20 > @@ -140,7 +140,7 @@ __rte_ring_move_cons_head(struct rte_ring *r, int > is_sc, > *old_head =3D __atomic_load_n(&r->cons.head, __ATOMIC_RELAXED); > do { > /* Restore n as it may change every loop */ > - n =3D max; > + n =3D maximum; >=20 > /* Ensure the head is read before tail */ > __atomic_thread_fence(__ATOMIC_ACQUIRE); > diff --git a/lib/ring/rte_ring_generic_pvt.h b/lib/ring/rte_ring_generic_= pvt.h > index c95ad7e12c..beb3140e78 100644 > --- a/lib/ring/rte_ring_generic_pvt.h > +++ b/lib/ring/rte_ring_generic_pvt.h > @@ -58,12 +58,12 @@ __rte_ring_move_prod_head(struct rte_ring *r, > unsigned int is_sp, > uint32_t *free_entries) > { > const uint32_t capacity =3D r->capacity; > - unsigned int max =3D n; > + unsigned int maximum =3D n; > int success; >=20 > do { > /* Reset n to the initial burst count */ > - n =3D max; > + n =3D maximum; >=20 > *old_head =3D r->prod.head; >=20 > @@ -127,13 +127,13 @@ __rte_ring_move_cons_head(struct rte_ring *r, > unsigned int is_sc, > uint32_t *old_head, uint32_t *new_head, > uint32_t *entries) > { > - unsigned int max =3D n; > + unsigned int maximum =3D n; > int success; >=20 > /* move cons.head atomically */ > do { > /* Restore n as it may change every loop */ > - n =3D max; > + n =3D maximum; >=20 > *old_head =3D r->cons.head; >=20 > diff --git a/lib/ring/rte_ring_rts_elem_pvt.h > b/lib/ring/rte_ring_rts_elem_pvt.h > index 7164213ee0..6241f28dc0 100644 > --- a/lib/ring/rte_ring_rts_elem_pvt.h > +++ b/lib/ring/rte_ring_rts_elem_pvt.h > @@ -53,11 +53,11 @@ static __rte_always_inline void > __rte_ring_rts_head_wait(const struct rte_ring_rts_headtail *ht, > union __rte_ring_rts_poscnt *h) > { > - uint32_t max; > + uint32_t maximum; >=20 > - max =3D ht->htd_max; > + maximum =3D ht->htd_max; >=20 > - while (h->val.pos - ht->tail.val.pos > max) { > + while (h->val.pos - ht->tail.val.pos > maximum) { > rte_pause(); > h->raw =3D __atomic_load_n(&ht->head.raw, > __ATOMIC_ACQUIRE); > } > -- > 2.29.3