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 83CBAA0032; Tue, 16 Nov 2021 00:25:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39F5740E25; Tue, 16 Nov 2021 00:25:51 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id C62C0407FF for ; Tue, 16 Nov 2021 00:25:48 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="319768213" X-IronPort-AV: E=Sophos;i="5.87,237,1631602800"; d="scan'208";a="319768213" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2021 15:25:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,237,1631602800"; d="scan'208";a="472117969" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga002.jf.intel.com with ESMTP; 15 Nov 2021 15:25:47 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 15 Nov 2021 15:25:46 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 15 Nov 2021 15:25:46 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 15 Nov 2021 15:25:46 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 15 Nov 2021 15:25:46 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KBYHhx/QcRnNoJCVpwaaWB69RR/sZ/Jmpmf05mn937y1G/q16IJZNg0Qn6M35D+IIA3Ul3VAA806WHMbhwNGG8Z4qpoyXsVSLzchU9SjE8e40YRHbAZ6GusBuo4WcjHG78f63gS9zdVbcQXy7Ox768Y1dp7ayl47iGXL5yZuklQ/uKJp2WemJAN4TbrS077Bwoq4TcS2nB2NHBqXu3ESU8u9jYlOi4MHHKCaNUXL4Na4Nmn+IBjCWo4w2Ejm5dKjpB+n1nDfUZSqJd2Iacb2FYya6oEMjsyt19f2K3gn/XaIetkuE5D2vqHQcxueUT2ikATaQ1oNb1ZspY55AhFOnQ== 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=ZNUv2/RWTNhhIwNhF0isDOnMm6BwC8NfbYIYCUptknw=; b=A+gONZ+fJk/is+RpcSfmwUb/TCptNLmx9RF64WE5gdo/Hz5VaDvtp6BpqQooJjTBlsZKvbUI7/iChZJrMs5jruNxbWuQOmVaPbpRBpgvmGiPtVf11lD/V84qDOllR/QkSxUf3d7qXHzCoXQTzKslrQUU0ukNZgWmsK126yr6NXNdCcel/071aFueQ2REx+tDQzEvJ8MX7kcy0fa9hX7D1O+YtJn3D3YDey+UfYgJiGWvP68uKhGspgJIQ8IixsBwfy9sg8GSd0aPwDV4p/M6MGrfKcPItzaR6wblZ94Jz4MAxpaVxSPYNTTf2tb088k5BRI/TtVlpPpaYt6z6hkrRg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZNUv2/RWTNhhIwNhF0isDOnMm6BwC8NfbYIYCUptknw=; b=oZEh+rgH3nH5Wp84BKcL5tnPwhTFTcig5O2dYSjz4YzDmIA5XVwTQTYPxfy+LFp6AqgrrW53ap+iotgDI6GBBdUQRpYC7f5If0Lm5VJMn01Q4QfiaGSBdfLL5e8qCw0lN9YgqAoBbjHYktX1HfoEe5vGK5quuv/VwPdhgHhJubk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB5207.namprd11.prod.outlook.com (2603:10b6:510:32::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Mon, 15 Nov 2021 23:25:43 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bc5f:31a7:10ad:443c]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bc5f:31a7:10ad:443c%5]) with mapi id 15.20.4690.027; Mon, 15 Nov 2021 23:25:43 +0000 Message-ID: Date: Mon, 15 Nov 2021 23:25:36 +0000 Content-Language: en-US To: Joyce Kong , , CC: , , Konstantin Ananyev , Bruce Richardson , "jerinj@marvell.com" References: <20210819060442.19014-1-joyce.kong@arm.com> From: Ferruh Yigit Subject: Re: [dpdk-dev] [PATCH] kni: remove non-C11 path from FIFO sync X-User: ferruhy In-Reply-To: <20210819060442.19014-1-joyce.kong@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU2PR04CA0251.eurprd04.prod.outlook.com (2603:10a6:10:28e::16) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by DU2PR04CA0251.eurprd04.prod.outlook.com (2603:10a6:10:28e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Mon, 15 Nov 2021 23:25:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1cbe6119-728d-4771-ea17-08d9a88f3e64 X-MS-TrafficTypeDiagnostic: PH0PR11MB5207: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tKN7+5lvLY2OOmPGtN0h7tQ8qXa/+hU/v0i5Kc/3qnl9k9VA+DDW16pi1uJtvQi+48ET31i4zLawSuwxIhE+l2jcsOudoa1g069uGCBuonEmTxMaqmIS2RjzG3rCVTc/pPqRz+b4+m4Vz4mxSDNKJtlRhNydI2VtHn6yJWmihFraWHqR1jGLgi6xb0gnqt+hSfLWIFCXgALxUUoUlHWU7/dKLeutfpIUO+tzv8h9VURVZjOWvta6HzPf8gtdZahWiu6YoI7LLhA10sW1QIKZgwvoYWwX2d5yUjNKdr+FcnnFXqDv4kJQ2cfkzoZuVePit2Y8TFkyAV4dmHc983m1ClPdVJoaH98nUDhBss0xVEDIk1cjkKdVWKbUbcHtdbv47NV/kA/5UybA5Wx/X93akgaPj0MSUYzaNpH2IoldFL4JA3ZYMeE1gVUzM4Dlpxh0R0oxgH8B60yugJlIqVLgAmT2NGExXZrCwog2KG6xIAloB/h3Nc+1ymqq1v9GYy4phitQhljC4CWYt6OshBf2zbRSixmBSvj+jXtHljg0dmWEQXpRiuavXQx7DpioP1fm1QCAPXR+dpHPw3JXeXAco9eUlHiuI45MLXCJb7he0wjeAZcHo/taia58hFvQin39iPRL3gvYwK8F5YPmKWcoSDOwV3BxX6jCoUWKuBELU6BUcDs7gm4rXKRU3QYCk+ilxvmyyzVSajydLub9+cKi41ynBKI88m7+yxL5HrvL7ZijSzWJHjoVJoX/IbHdU+COPJTsAyyyy0JCEFPy/dHrf0thla+aAWnrWgId5LLX6vk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(4326008)(186003)(6486002)(5660300002)(966005)(956004)(2616005)(31696002)(82960400001)(83380400001)(2906002)(6666004)(31686004)(53546011)(316002)(508600001)(86362001)(66476007)(44832011)(8936002)(66556008)(8676002)(16576012)(36756003)(66946007)(38100700002)(54906003)(26005)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eG9zT3ZTR201S3c0cW5jNi9RV1g1NFFYSGtOTk0yaUZoRUU0U254U1RXZWU3?= =?utf-8?B?WFUzdmFWZVFLUkNmMHQ3R1U0bWhycURIRWU2Ynl1U1NXd2VWcGFhWXlobmxX?= =?utf-8?B?RjI3b2diY2RXZThEYTZEQ1Q0MlMvd0Y4NkUveDVVU3NuZDk2Z0hTb0tYRzc3?= =?utf-8?B?V21Ta3VLYWt5ZG4wbDVxYU85dXVERjJ6dnUyTkNMWWQzbzFMQTU0RFdIeFFk?= =?utf-8?B?a1YvOHM1SUZPOEtZNCt4ZHA3b2ZjY245M2dBT3dJN1RL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jA3MVk4?= =?utf-8?B?djNOWmFVeWF4a0dzZ2NCZmZHSDJNeGlyM2xoOHFKdE0wY1gvejlUdVhzcEcw?= =?utf-8?B?U3NobWlkUmNoaFB2QXRIVzVCNkxyeDNZcWIwTjBiWnNuamxWNEl2cGd0ZWlP?= =?utf-8?Q?C865n3bEPKbU2QfO4p99Ixk=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 1cbe6119-728d-4771-ea17-08d9a88f3e64 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2021 23:25:43.3492 (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: cJAlDZIxCA59lm8jRUQ2VG65nO44gPSMp59J5Vo+OTqLajhFdLtf7P+QFgt71pnqgjgdG6IoRD3crMaRXZiv4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5207 X-OriginatorOrg: intel.com 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 On 8/19/2021 7:04 AM, Joyce Kong wrote: > Non-C11 path was meant to not break build with GCC version < 4.7(when > C11 atomics were introduced), while now minimum GCC version supported > by DPDK has been 4.9, C11 atomics support in compiler is no longer a > problem. So non-C11 path can be removed. As far as I remember the non-C11 path implemented because of performance difference, wasn't it, please check commit: https://git.dpdk.org/dpdk/commit/?id=39368ebfc6067d0c82d76bdf4298ff9b8d257f21 Can you please point the reference where discussed to have non-C11 for because of old compiler support? Also how x86 is affected? Previously it was just assignment because it was using non-C11 model and 'rte_smp_rmb' & 'rte_smp_wmb' are only compiler barrier. Is the '__atomic_load_n()' noop for the x86? Since we are removing 'volatile' from variables, I suspect it is not. And finally, is there a downside to keep both models? > > Signed-off-by: Joyce Kong > Reviewed-by: Ruifeng Wang > --- > lib/kni/rte_kni_common.h | 9 ++------ > lib/kni/rte_kni_fifo.h | 48 +++++++--------------------------------- > 2 files changed, 10 insertions(+), 47 deletions(-) > > diff --git a/lib/kni/rte_kni_common.h b/lib/kni/rte_kni_common.h > index b547ea5501..20d94eaa9b 100644 > --- a/lib/kni/rte_kni_common.h > +++ b/lib/kni/rte_kni_common.h > @@ -58,13 +58,8 @@ struct rte_kni_request { > * Writing should never overwrite the read position > */ > struct rte_kni_fifo { > -#ifdef RTE_USE_C11_MEM_MODEL > - unsigned write; /**< Next position to be written*/ > - unsigned read; /**< Next position to be read */ > -#else > - volatile unsigned write; /**< Next position to be written*/ > - volatile unsigned read; /**< Next position to be read */ > -#endif > + unsigned write; /**< Next position to be written*/ > + unsigned read; /**< Next position to be read */ > unsigned len; /**< Circular buffer length */ > unsigned elem_size; /**< Pointer size - for 32/64 bit OS */ > void *volatile buffer[]; /**< The buffer contains mbuf pointers */ > diff --git a/lib/kni/rte_kni_fifo.h b/lib/kni/rte_kni_fifo.h > index d2ec82fe87..057f6b3ded 100644 > --- a/lib/kni/rte_kni_fifo.h > +++ b/lib/kni/rte_kni_fifo.h > @@ -2,38 +2,6 @@ > * Copyright(c) 2010-2014 Intel Corporation > */ > > - > - > -/** > - * @internal when c11 memory model enabled use c11 atomic memory barrier. > - * when under non c11 memory model use rte_smp_* memory barrier. > - * > - * @param src > - * Pointer to the source data. > - * @param dst > - * Pointer to the destination data. > - * @param value > - * Data value. > - */ > -#ifdef RTE_USE_C11_MEM_MODEL > -#define __KNI_LOAD_ACQUIRE(src) ({ \ > - __atomic_load_n((src), __ATOMIC_ACQUIRE); \ > - }) > -#define __KNI_STORE_RELEASE(dst, value) do { \ > - __atomic_store_n((dst), value, __ATOMIC_RELEASE); \ > - } while(0) > -#else > -#define __KNI_LOAD_ACQUIRE(src) ({ \ > - typeof (*(src)) val = *(src); \ > - rte_smp_rmb(); \ > - val; \ > - }) > -#define __KNI_STORE_RELEASE(dst, value) do { \ > - *(dst) = value; \ > - rte_smp_wmb(); \ > - } while(0) > -#endif > - > /** > * Initializes the kni fifo structure > */ > @@ -59,7 +27,7 @@ kni_fifo_put(struct rte_kni_fifo *fifo, void **data, unsigned num) > unsigned i = 0; > unsigned fifo_write = fifo->write; > unsigned new_write = fifo_write; > - unsigned fifo_read = __KNI_LOAD_ACQUIRE(&fifo->read); > + unsigned fifo_read = __atomic_load_n(&fifo->read, __ATOMIC_ACQUIRE); > > for (i = 0; i < num; i++) { > new_write = (new_write + 1) & (fifo->len - 1); > @@ -69,7 +37,7 @@ kni_fifo_put(struct rte_kni_fifo *fifo, void **data, unsigned num) > fifo->buffer[fifo_write] = data[i]; > fifo_write = new_write; > } > - __KNI_STORE_RELEASE(&fifo->write, fifo_write); > + __atomic_store_n(&fifo->write, fifo_write, __ATOMIC_RELEASE); > return i; > } > > @@ -81,7 +49,7 @@ kni_fifo_get(struct rte_kni_fifo *fifo, void **data, unsigned num) > { > unsigned i = 0; > unsigned new_read = fifo->read; > - unsigned fifo_write = __KNI_LOAD_ACQUIRE(&fifo->write); > + unsigned fifo_write = __atomic_load_n(&fifo->write, __ATOMIC_ACQUIRE); > > for (i = 0; i < num; i++) { > if (new_read == fifo_write) > @@ -90,7 +58,7 @@ kni_fifo_get(struct rte_kni_fifo *fifo, void **data, unsigned num) > data[i] = fifo->buffer[new_read]; > new_read = (new_read + 1) & (fifo->len - 1); > } > - __KNI_STORE_RELEASE(&fifo->read, new_read); > + __atomic_store_n(&fifo->read, new_read, __ATOMIC_RELEASE); > return i; > } > > @@ -100,8 +68,8 @@ kni_fifo_get(struct rte_kni_fifo *fifo, void **data, unsigned num) > static inline uint32_t > kni_fifo_count(struct rte_kni_fifo *fifo) > { > - unsigned fifo_write = __KNI_LOAD_ACQUIRE(&fifo->write); > - unsigned fifo_read = __KNI_LOAD_ACQUIRE(&fifo->read); > + unsigned fifo_write = __atomic_load_n(&fifo->write, __ATOMIC_ACQUIRE); > + unsigned fifo_read = __atomic_load_n(&fifo->read, __ATOMIC_ACQUIRE); > return (fifo->len + fifo_write - fifo_read) & (fifo->len - 1); > } > > @@ -111,7 +79,7 @@ kni_fifo_count(struct rte_kni_fifo *fifo) > static inline uint32_t > kni_fifo_free_count(struct rte_kni_fifo *fifo) > { > - uint32_t fifo_write = __KNI_LOAD_ACQUIRE(&fifo->write); > - uint32_t fifo_read = __KNI_LOAD_ACQUIRE(&fifo->read); > + uint32_t fifo_write = __atomic_load_n(&fifo->write, __ATOMIC_ACQUIRE); > + uint32_t fifo_read = __atomic_load_n(&fifo->read, __ATOMIC_ACQUIRE); > return (fifo_read - fifo_write - 1) & (fifo->len - 1); > } >