From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0091.outbound.protection.outlook.com [207.46.100.91]) by dpdk.org (Postfix) with ESMTP id BA1132A5F for ; Tue, 3 Nov 2015 17:19:03 +0100 (CET) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@caviumnetworks.com; Received: from localhost.localdomain (111.93.218.67) by SN1PR0701MB1981.namprd07.prod.outlook.com (10.163.131.20) with Microsoft SMTP Server (TLS) id 15.1.312.18; Tue, 3 Nov 2015 16:19:00 +0000 Date: Tue, 3 Nov 2015 21:48:37 +0530 From: Jerin Jacob To: "Ananyev, Konstantin" Message-ID: <20151103161834.GA18450@localhost.localdomain> References: <1446565921-18088-1-git-send-email-jerin.jacob@caviumnetworks.com> <2601191342CEEE43887BDE71AB97725836AB8F01@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB97725836AB8F01@irsmsx105.ger.corp.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0019.INDPRD01.PROD.OUTLOOK.COM (25.164.117.26) To SN1PR0701MB1981.namprd07.prod.outlook.com (25.163.131.20) X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1981; 2:qKj65Ont74xMPFWPZxCfEQeJOQSnKyD1DkpHJ+THbSqpqEzsdLzkRL4ALxpmpNYfInTDONtWassEntlGPmGlxsz541kkqQkjJntOe/6jxgI16hy6EFEgCEVbv+KztleqvCEV0ZcmvFZ/GXu2PYtf3vwJAXxfJ6or5j2CAB9e9oU=; 3:8BTYj5F6lspPDvJgSNIdFsQuYRSJvQRNTX9VLTk9GKt2pJxNeCkPvDGYWdGX/79OYoPujnqll1IN/tvCqieAdmz2O9KK2rippkDjTLmlSrJEDbcUIoGCx0qvqL6X0AxKUnuSYitkMQOryPcWT+736g==; 25:/t3lG5Zfov5HcGt4+T/xCIvvmIIJ9z6gSrP5BQhDf3Fh34fq+5oVscHKIzsYMq8rXopENwh1BNyhSNL39fNWm4ct604PyMnzgyldVStivzoZdrsOk/fRmy6j2pW/AbkFaNl/TXM8d1DmxRU6srTytixd23PCt5A+KfaGiUeU+1n8uvTPRFeH6ZiZ67dId9NQtXHbcHyEqP5/k7zxZLl1DJDisFdX5lIdR6X5Cf8oq7JtO+wgTE+8RywEbAApcqlGZREzwEtxNO5M0n/GGvOzig== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0701MB1981; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1981; 20:8AvMY07R3UsnnysBCHZx/PxpBr8DarcS//zFHWcdgSnZsB2ECbm+rx93PbtMmRBlZ4dbumRknNEQD/3nkR8PZsaDhCcUf+VrF/8OC97U8nACsDAT4cXmLAWU1bqTQAGaJnEcUzela4gEIuiAk/EHqoKq0FrV80gvMkqILkUBye+jdv4b39FXNsKSLKjvi1a8WeKqkmZ7hY3PtcYflX9prBf7tdrOp2lNnDsgCP1P7XXxM9Enmqf4CKh97FB5mSknIzdLPmDXaaKMaK/rjV65bSMMLxn/8XK+O5nPUVjz4F5FC6Bo9eaxa04BGrB8GnDJPhVRBBsqADSAG0GM6kc8UjdcHd0837TcqerqiqcORpDpTwAW2I3IhLJXlNyDNqXriGLWksJudB66/j2aCGZ4UkdOD13viwR+br0jkW6YrdjiF6KTMSRSNRiOHEmLIfT9jVaWwXzDaZPL5AHvswF0yt+7jd25draLfrgoz0B/mZX3/ICt3kOSdTPoBpXiLnmMoz/QuHew+y107WCdwO9rPF2/u5vwVsenxh6vsvXXMf2Gxw41Ylb2rn/oPv2UACNFQfAUDq4a8AyKUcJA2MAYuOyo3FtqaCHSdIj8hNVsH+I= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:SN1PR0701MB1981; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0701MB1981; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1981; 4:QjaXqnTDhIEivM/Bp8Ft0SCVBbz7CIYr14Bj5WavEWqDjjJrMASq5o2iZcCZuzkZRA6RCxL6aeBdtfugeUf5VigJWoiwu7cxJzUSXRVKCfdMUnvWEAhXtTw/QNkGn12XGkQd3sYk/HJmwBBu3D2yX8nXYwNAHFeYAuBnR/v3cAYIpSpMZ1JbBKFCBinGxMNJxVmGDSgxcuKjqrS1iAbvm2oRoURwM8RgX1xgo9mqTwUuwdwOvYSEetperw8RcrBQdfyBPyvitQjkc4lj3eLgAX4VqhlktNrdIH7hbrYEaIQOMWVRk7H2ywWsDoaU03yLbMPLoYCqmqVtfOtyaeWXhJeZAUTfS3p7rF7Qpd1lJf8rxbhiY25Izy3JjqeDFu2k X-Forefront-PRVS: 0749DC2CE6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(377454003)(199003)(189002)(24454002)(13464003)(92566002)(97756001)(81156007)(83506001)(5007970100001)(54356999)(76176999)(42186005)(23726002)(87976001)(66066001)(5004730100002)(122386002)(5008740100001)(19580405001)(50466002)(86362001)(19580395003)(61506002)(101416001)(189998001)(50986999)(33656002)(47776003)(97736004)(4001350100001)(77096005)(105586002)(106356001)(5009440100003)(110136002)(5001960100002)(2950100001)(46406003)(40100003)(15395725005)(15975445007)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0701MB1981; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0701MB1981; 23:WK5uaUecgbWHVBHPw/c+lgO0Mdupgdcf17Jk/AD?= =?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gsf/K2JN6s8FSBDN6l0mRcV9SE+uS?= =?us-ascii?Q?gqddbWg5aAlaubWueh4TvruCn84HKHTJOD2kYFuweWevGbczdt3sn2F3Te5L?= =?us-ascii?Q?c9DWebIzHbUqOYPG08im86ErX/UqZwMTgwnOgM3pUSUbj5gsmKtKfzVcWqk5?= =?us-ascii?Q?sNlmArPkng06iaW1lsBwzsMku3ta4UEMMxID7tb7Qc3mx4L+0w1uR03yc3cj?= =?us-ascii?Q?UtLP1ALElBNTKMoPUbnfUHi2wVXjGyANQTIgrg+sdiSL2g/d4KBs9KXcehPF?= =?us-ascii?Q?1U0l4EhCx7uwRAcNSkjfXRYWlYBHECmYcJQbh?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0701MB1981; 5:pk1CJCRjXGWLHoUz/eNwblp+sb52/Z4JGzgbtCUz3V+Fbk2pdzAt/Q/KCh0YP/fvo74PgO5w1Ncxwed33GtI9iVuAnWfpX7yaxcMso1+ObVRwEY96WB+izT+HyHDv0UgAAhTTcHfWPiStrgJKMvXEA==; 24:8oZQ+8vHiYtAOrwP1ci8A4wa+bpTpsGW/sAqjBsdZQ03EEPCGpIT11LZpY1zb9sPvFVTEtUbZWMmQAg5HE0xIivdteGdWuG3GkdkJj8gfM0=; 20:7siKa8QgUpRq9smMOgueHnBLqaXT1fsnKqoVY5K0l8KpzdTtCeVdr/SSCEHpApZPts5/vKmFBRaaTanH8T82OQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2015 16:19:00.8819 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB1981 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [RFC ][PATCH] Introduce RTE_ARCH_STRONGLY_ORDERED_MEM_OPS configuration parameter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2015 16:19:04 -0000 On Tue, Nov 03, 2015 at 03:57:24PM +0000, Ananyev, Konstantin wrote: > > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jerin Jacob > > Sent: Tuesday, November 03, 2015 3:52 PM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [RFC ][PATCH] Introduce RTE_ARCH_STRONGLY_ORDERED_MEM_OPS configuration parameter > > > > rte_ring implementation needs explicit memory barrier > > in weakly ordered architecture like ARM unlike > > strongly ordered architecture like X86 > > > > Introducing RTE_ARCH_STRONGLY_ORDERED_MEM_OPS > > configuration to abstract such dependency so that other > > weakly ordered architectures can reuse this infrastructure. > > Looks a bit clumsy. > Please try to follow this suggestion instead: > http://dpdk.org/ml/archives/dev/2015-October/025505.html Make sense. Do we agree on a macro that is defined based upon RTE_ARCH_STRONGLY_ORDERED_MEM_OP to remove clumsy #ifdef every where ? Jerin > > Konstantin > > > > > Signed-off-by: Jerin Jacob > > --- > > config/common_bsdapp | 5 +++++ > > config/common_linuxapp | 5 +++++ > > config/defconfig_arm64-armv8a-linuxapp-gcc | 1 + > > config/defconfig_arm64-thunderx-linuxapp-gcc | 1 + > > lib/librte_ring/rte_ring.h | 20 ++++++++++++++++++++ > > 5 files changed, 32 insertions(+) > > > > diff --git a/config/common_bsdapp b/config/common_bsdapp > > index b37dcf4..c8d1f63 100644 > > --- a/config/common_bsdapp > > +++ b/config/common_bsdapp > > @@ -79,6 +79,11 @@ CONFIG_RTE_FORCE_INTRINSICS=n > > CONFIG_RTE_ARCH_STRICT_ALIGN=n > > > > # > > +# Machine has strongly-ordered memory operations on normal memory like x86 > > +# > > +CONFIG_RTE_ARCH_STRONGLY_ORDERED_MEM_OPS=y > > + > > +# > > # Compile to share library > > # > > CONFIG_RTE_BUILD_SHARED_LIB=n > > diff --git a/config/common_linuxapp b/config/common_linuxapp > > index 0de43d5..d040a74 100644 > > --- a/config/common_linuxapp > > +++ b/config/common_linuxapp > > @@ -79,6 +79,11 @@ CONFIG_RTE_FORCE_INTRINSICS=n > > CONFIG_RTE_ARCH_STRICT_ALIGN=n > > > > # > > +# Machine has strongly-ordered memory operations on normal memory like x86 > > +# > > +CONFIG_RTE_ARCH_STRONGLY_ORDERED_MEM_OPS=y > > + > > +# > > # Compile to share library > > # > > CONFIG_RTE_BUILD_SHARED_LIB=n > > diff --git a/config/defconfig_arm64-armv8a-linuxapp-gcc b/config/defconfig_arm64-armv8a-linuxapp-gcc > > index 6ea38a5..5289152 100644 > > --- a/config/defconfig_arm64-armv8a-linuxapp-gcc > > +++ b/config/defconfig_arm64-armv8a-linuxapp-gcc > > @@ -37,6 +37,7 @@ CONFIG_RTE_ARCH="arm64" > > CONFIG_RTE_ARCH_ARM64=y > > CONFIG_RTE_ARCH_64=y > > CONFIG_RTE_ARCH_ARM_NEON=y > > +CONFIG_RTE_ARCH_STRONGLY_ORDERED_MEM_OPS=n > > > > CONFIG_RTE_FORCE_INTRINSICS=y > > > > diff --git a/config/defconfig_arm64-thunderx-linuxapp-gcc b/config/defconfig_arm64-thunderx-linuxapp-gcc > > index e8fccc7..79fa9e6 100644 > > --- a/config/defconfig_arm64-thunderx-linuxapp-gcc > > +++ b/config/defconfig_arm64-thunderx-linuxapp-gcc > > @@ -37,6 +37,7 @@ CONFIG_RTE_ARCH="arm64" > > CONFIG_RTE_ARCH_ARM64=y > > CONFIG_RTE_ARCH_64=y > > CONFIG_RTE_ARCH_ARM_NEON=y > > +CONFIG_RTE_ARCH_STRONGLY_ORDERED_MEM_OPS=n > > > > CONFIG_RTE_FORCE_INTRINSICS=y > > > > diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h > > index af68888..1ccd186 100644 > > --- a/lib/librte_ring/rte_ring.h > > +++ b/lib/librte_ring/rte_ring.h > > @@ -457,7 +457,12 @@ __rte_ring_mp_do_enqueue(struct rte_ring *r, void * const *obj_table, > > > > /* write entries in ring */ > > ENQUEUE_PTRS(); > > + > > +#ifdef RTE_ARCH_STRONGLY_ORDERED_MEM_OPS > > rte_compiler_barrier(); > > +#else > > + rte_wmb(); > > +#endif > > > > /* if we exceed the watermark */ > > if (unlikely(((mask + 1) - free_entries + n) > r->prod.watermark)) { > > @@ -552,7 +557,12 @@ __rte_ring_sp_do_enqueue(struct rte_ring *r, void * const *obj_table, > > > > /* write entries in ring */ > > ENQUEUE_PTRS(); > > + > > +#ifdef RTE_ARCH_STRONGLY_ORDERED_MEM_OPS > > rte_compiler_barrier(); > > +#else > > + rte_wmb(); > > +#endif > > > > /* if we exceed the watermark */ > > if (unlikely(((mask + 1) - free_entries + n) > r->prod.watermark)) { > > @@ -643,7 +653,12 @@ __rte_ring_mc_do_dequeue(struct rte_ring *r, void **obj_table, > > > > /* copy in table */ > > DEQUEUE_PTRS(); > > + > > +#ifdef RTE_ARCH_STRONGLY_ORDERED_MEM_OPS > > rte_compiler_barrier(); > > +#else > > + rte_rmb(); > > +#endif > > > > /* > > * If there are other dequeues in progress that preceded us, > > @@ -727,7 +742,12 @@ __rte_ring_sc_do_dequeue(struct rte_ring *r, void **obj_table, > > > > /* copy in table */ > > DEQUEUE_PTRS(); > > + > > +#ifdef RTE_ARCH_STRONGLY_ORDERED_MEM_OPS > > rte_compiler_barrier(); > > +#else > > + rte_rmb(); > > +#endif > > > > __RING_STAT_ADD(r, deq_success, n); > > r->cons.tail = cons_next; > > -- > > 2.1.0 >