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 41E7C41D3C for ; Wed, 22 Feb 2023 11:41:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3196042DAA; Wed, 22 Feb 2023 11:41:21 +0100 (CET) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id A072540689; Wed, 22 Feb 2023 11:41:18 +0100 (CET) Received: from dggpeml100023.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4PMCLW5J2Cz16Nwj; Wed, 22 Feb 2023 18:38:43 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by dggpeml100023.china.huawei.com (7.185.36.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Wed, 22 Feb 2023 18:41:12 +0800 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.017; Wed, 22 Feb 2023 11:41:10 +0100 From: Konstantin Ananyev To: Fengchengwen , Stephen Hemminger , Ruifeng Wang CC: Ashok Kaladi , "jerinj@marvell.com" , "thomas@monjalon.net" , "Honnappa Nagarahalli" , "dev@dpdk.org" , "s.v.naga.harish.k@intel.com" , "erik.g.carrillo@intel.com" , "abhinandan.gujjar@intel.com" , "stable@dpdk.org" , nd Subject: RE: [PATCH 2/2] ethdev: fix race condition in fast-path ops setup Thread-Topic: [PATCH 2/2] ethdev: fix race condition in fast-path ops setup Thread-Index: AQHZRPHnBL1vPilgIEWuG59yHT+R767XVo0AgAGZ0YCAAKEXgIAAh9OAgACoesA= Date: Wed, 22 Feb 2023 10:41:10 +0000 Message-ID: References: <20230220060839.1267349-1-ashok.k.kaladi@intel.com> <20230220060839.1267349-2-ashok.k.kaladi@intel.com> <4786db4b-63dc-5329-522d-77eb58d4cff4@huawei.com> <20230221090053.14d653bf@hermes.local> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.174.178] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogZmVuZ2NoZW5nd2VuIDxm ZW5nY2hlbmd3ZW5AaHVhd2VpLmNvbT4NCj4gU2VudDogV2VkbmVzZGF5LCBGZWJydWFyeSAyMiwg MjAyMyAxOjA3IEFNDQo+IFRvOiBTdGVwaGVuIEhlbW1pbmdlciA8c3RlcGhlbkBuZXR3b3JrcGx1 bWJlci5vcmc+OyBSdWlmZW5nIFdhbmcgPFJ1aWZlbmcuV2FuZ0Bhcm0uY29tPg0KPiBDYzogQXNo b2sgS2FsYWRpIDxhc2hvay5rLmthbGFkaUBpbnRlbC5jb20+OyBqZXJpbmpAbWFydmVsbC5jb207 IHRob21hc0Btb25qYWxvbi5uZXQ7IEhvbm5hcHBhIE5hZ2FyYWhhbGxpDQo+IDxIb25uYXBwYS5O YWdhcmFoYWxsaUBhcm0uY29tPjsgZGV2QGRwZGsub3JnOyBzLnYubmFnYS5oYXJpc2gua0BpbnRl bC5jb207IGVyaWsuZy5jYXJyaWxsb0BpbnRlbC5jb207DQo+IGFiaGluYW5kYW4uZ3VqamFyQGlu dGVsLmNvbTsgc3RhYmxlQGRwZGsub3JnOyBuZCA8bmRAYXJtLmNvbT4NCj4gU3ViamVjdDogUmU6 IFtQQVRDSCAyLzJdIGV0aGR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