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 2F326A0543; Thu, 7 Jul 2022 21:09:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 768904282F; Thu, 7 Jul 2022 21:09:18 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id BF40B4069D for ; Thu, 7 Jul 2022 17:59:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657209580; x=1688745580; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Ky0DAdWZcDE4pbAcBzilmynbwRPyfKW58v8cos1OOFM=; b=Fq91yxr4cassqFREaT/iRXIfJeHfbXIFxqLflssKJQ/h9BauM4OPb2JK 2j2NH8xfGtLxO7GN+KBGqdxozGCiCpsoMu9bvempLoDGYRP+hwgNF6aAZ KvpCCEtw/dykNih/MO1fCtrT3dMyx3ULLNVeh4bGDlviZDa/s7KjGcddI 1aD+jfWbYUaOqMeYH3cqmwWdQ3pIoovk8aIBcBS+1kFzQmA+OumjRjsUK l2xnqsxP2T8kLl8t7+xYX+PeXKZlS+C/RRbOA+Po+Fi+0oVxueQOeYZF2 Fqn9icAe3fqhJDtHKBFDhs9gjWPByDJfyJAJKrZjByY/VCdebUFZUG44H g==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="285186362" X-IronPort-AV: E=Sophos;i="5.92,253,1650956400"; d="scan'208";a="285186362" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 08:59:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,253,1650956400"; d="scan'208";a="736016287" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga001.fm.intel.com with ESMTP; 07 Jul 2022 08:59:39 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 7 Jul 2022 08:59:39 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 7 Jul 2022 08:59:39 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.45) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 7 Jul 2022 08:59:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LTds2I2rYWMJ0mlRy+VwVxMN69pgA3X7+058rXNGZsMwh6GDZrVpkh0fmJgRWWvg2u86Qia4ziSh4TcOBEF9qPUDhZjmC2lEN0f3U3/7AEStcUsDSxZiIg8QJ2J0CZJDql+tdeRIa6b3/led1ON5q3Rvq0WvoqiXU4AYPpeYBaFfrbesNHLpNzNBfIsATqwMxgnSFUcQPeWCU0jV438E0hG/HUfbM++iDYWG0A1bZxVWOqcSBB80tBQL+H2Nu9aKAdW1muQjcrDtA5agCFJhwXFw/C6A7laB1cfnAjA/GwhsGPwJYughGinIHH1GvXK/t5mEiJ0Lsq5CKR6rOXA1Og== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=foACxDb7gzE7j+/QR/csaIk0c7/fkoYskop1sE+d9Z0=; b=YDGxMpmGuZ+EYpPLkWFM1nHdodc7zB3steTgQksrGjUq4QZmciSu7mpljkLEpJAqAYsV2DM9NK4poREMaPZ/1k/Dl+F67GO14cUJZGDcDbEbPcaUcf0Z0FUt4ItB7DRcO2+3FcX+KCpItW9+szX9UKbxp4XobvJ4JMCUQwen/MeFeaAF1T6hdADm2Z+DMdvFDS+1rT+e0rYGzlbHSfwIPF5X3wedYoxEQMPgiDaAZ1uwIzrDOelmK7+Vx3JIfkcGex3G6CkgLmrBdnYq5bQDm0lA37wbEOVSRiNW1mw1eWNK3/vfcU00u93rsUC0XdYB4uPa8mwe6DsDLGvzHuIQXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH0PR11MB5159.namprd11.prod.outlook.com (2603:10b6:510:3c::20) by SJ1PR11MB6084.namprd11.prod.outlook.com (2603:10b6:a03:489::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.20; Thu, 7 Jul 2022 15:59:37 +0000 Received: from PH0PR11MB5159.namprd11.prod.outlook.com ([fe80::c8ca:b1a3:b892:8681]) by PH0PR11MB5159.namprd11.prod.outlook.com ([fe80::c8ca:b1a3:b892:8681%8]) with mapi id 15.20.5395.021; Thu, 7 Jul 2022 15:59:37 +0000 From: "Khan, Hamza" To: Thomas Monjalon CC: "dev@dpdk.org" Subject: RE: [PATCH 1/2] common: add safe version of foreach-list to Linux Thread-Topic: [PATCH 1/2] common: add safe version of foreach-list to Linux Thread-Index: AQHYdaYX98CgyyMAyEuMMYzlJjf6lK1wKdEAgAMfCgA= Date: Thu, 7 Jul 2022 15:59:37 +0000 Message-ID: References: <20220601105455.166505-1-hamza.khan@intel.com> <14252746.lhuNh5TYOU@thomas> In-Reply-To: <14252746.lhuNh5TYOU@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.500.17 dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: adef634f-0b02-407e-d1f2-08da6031b16b x-ms-traffictypediagnostic: SJ1PR11MB6084:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Gy/5KLGjHSZxy7SnYqMd4wt30wknd3u8n4JKBe2VQDZQPqpOpo9jt/g35iib7AHwAtIiaZm5laM8CwPdMTfIlAHT4dwrm+gergW5o5DWSYsGcmGNGnvIRt1//lI9YPfQe26Xy59T4oesCOVZ1Vow/XcD0fMVFAKoJ7CxxlfDJHeG6Pqszdgc2UPdIYW0/ovtE731nB2p/mvUCFZkeYp/xhCSmoAhXPmgSW6d6YxNcsx69C/zhco5NddtQhn9Pf9U2Hn+ykaGLqvD21kIgBWMDmYiZCUwBL3VykNmwHYFO2YYkzd+q8OCjW0PdTULKEYbtcm5vzROCk71gbHysr0v3nslBirRVLyQ5TOxM+qkXPJJ8g2U7cfXvzLw3dCyc73wDBnwE2jNbdwI/nuej5lgA7CQ0zEqNW8CfRoknuAaWOyu2fbef/1hwNVs5Aeb8160NKd8oVRnPrEaVxbXpdpamHLul4LKETEIZcim6xIQyFGIU8QPt3En8eJcAlCuYN9Y5UhCmA3bLvQR5yrb/YkkYyHWRyXR8l4obFr+sVstMx/jjyHwts/6y+Chr5Tqf1Lsxj+1Q96xgkxM3eKA9D4OwJyij9CCMd33KHxDboy1u46++pVhHiK+w5Stgc9Zem8ttxmRaynBC9yBr6vgC5UdaDOanOSajaZHe/jwonLZ79xHgz0cbgg8Hk6vS1FKenH3RKm0hdnIRXffhObl5Ll1iSQ2P80q2BEkcVg9JHjVWe3m9yevdFMn3a2W7Tb+FDz4/xGBE+mBFl9aUWdeD1nHRe2Y6155uG2AMsTiahNk8lXfqdQc3oASaFVWlAjFgIA0 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5159.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(396003)(376002)(346002)(136003)(39860400002)(5660300002)(52536014)(38070700005)(8936002)(55016003)(478600001)(82960400001)(2906002)(33656002)(9686003)(83380400001)(66946007)(53546011)(6506007)(66476007)(86362001)(64756008)(38100700002)(76116006)(316002)(71200400001)(66446008)(4326008)(66556008)(26005)(122000001)(7696005)(8676002)(41300700001)(186003)(6916009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?SKfBrWiwKiKD/gwKANl34uHrpr812/bC59tWiRmvfjzPvdPX7auu0euBJA80?= =?us-ascii?Q?Rksdi0D57SDF+UphMxOGSZbYln8ltxor28fVSeJSn7DmZBeZIryPJ0mdRr4s?= =?us-ascii?Q?oLbWmAGtErEQRD2Cmlkf1yd6a1XAQaG79z5UuKGeRJC9LqnxLJm6YIsGfyl9?= =?us-ascii?Q?/rf2WCoIFIUd1NE45syWAwIaxaPC5CljaBOEIoo4dFDJTpv4pKQnYsgRxdLJ?= =?us-ascii?Q?iMvT8Iu0fp17wKHFvX612RhumTa5Il+KtSWqB8BPduIl5I+hFvXbc1p0z+sj?= =?us-ascii?Q?XKy8J4UDz4bbIBTb1lcJ85DYK4NhWZ6/3xV7BkXkm9FapQaagLW5dSa7gvV4?= =?us-ascii?Q?712rSdEutYWOUfEhEYatoUgE5G9gEc54kQ3eHm0DEZLxWDyiq2f4aSfi2k+U?= =?us-ascii?Q?ZHWMCWjcuDl7OuB+CObLPC2Nr5SOnk/zU7W2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gEm/ghEPGWtiuuptvUkXQug00yodcgAwAyBdfXt04V7F?= =?us-ascii?Q?nHYSzArNsXl8/56SmvcbwA+y91kCKBG0A5SStU7EZW6kRKGQAAFVjJtAo8ej?= =?us-ascii?Q?bIVtA1NOJYx0xluTrCIPMSz1unnnTLizvCHGZ4KeWs25MqYNCxRo2rvPQG8s?= =?us-ascii?Q?me6lJSptf4+XRJquorTwKQt+2XwjCS5rI5oXQbq9/Frrp14/vAsI84FpIabw?= =?us-ascii?Q?nTjjv1IvA/K1gi0oje9SnRqKep8ZAadLLF04R4bw?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5159.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: adef634f-0b02-407e-d1f2-08da6031b16b X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2022 15:59:37.2175 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: l2h8HzDxn0mZNHGHOdaZ039FoiOx2aKLD8bFG/l5zsb6K4vnOoK+pZqrEi+zWy0n2U1gNwBnYzvs9Rl+Dd2HNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR11MB6084 X-OriginatorOrg: intel.com X-Mailman-Approved-At: Thu, 07 Jul 2022 21:09:16 +0200 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 > -----Original Message----- > From: Thomas Monjalon > Sent: Tuesday 5 July 2022 17:16 > To: Khan, Hamza > Cc: dev@dpdk.org > Subject: Re: [PATCH 1/2] common: add safe version of foreach-list to Linu= x >=20 > 01/06/2022 12:54, Hamza Khan: > > Linux EAL does not have the LIST_FOREACH_SAFE version of the iterator > > macros. Add it. > > > > Signed-off-by: Hamza Khan > > --- > > lib/eal/linux/include/rte_os.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/lib/eal/linux/include/rte_os.h > > b/lib/eal/linux/include/rte_os.h index c72bf5b7e6..00d7714181 100644 > > --- a/lib/eal/linux/include/rte_os.h > > +++ b/lib/eal/linux/include/rte_os.h > > @@ -26,6 +26,13 @@ extern "C" { > > #define RTE_STAILQ_HEAD(name, type) STAILQ_HEAD(name, type) > #define > > RTE_STAILQ_ENTRY(type) STAILQ_ENTRY(type) > > > > +#ifndef LIST_FOREACH_SAFE > > +#define LIST_FOREACH_SAFE(var, head, field, tvar) > \ > > + for ((var) =3D LIST_FIRST((head)); \ > > + (var) && ((tvar) =3D LIST_NEXT((var), field), 1); \ > > + (var) =3D (tvar)) > > +#endif >=20 > I'm not sure we want to add such thing without a RTE_ prefix. > And we should not need LIST_*, we have RTE_TAILQ_*. >=20 >=20 I have sent v2 patch with the aforementioned fix.=20 However Is being held until the list moderator can review it for approval