From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0066.outbound.protection.outlook.com [104.47.41.66]) by dpdk.org (Postfix) with ESMTP id 93BCF47D1 for ; Sun, 24 Jul 2016 19:08:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=txWQ/cioX+QN1Z0SRArlHqMCDsDxFbq3ajo9NM/Co20=; b=T2YdYZiIgoGsWttjL3/Kxsw/D7lx8ogV96tqMkAkvr+YZNv5vITXg0PRW53RiVZxSzCyDyF/P6SIefmmmc6XmX3l2O91yZTcd8T1laVJxI6bub4JFu+78lWv9Zd/y3AsLZJHB+0VqTG0NfGlX3gngGBBxavdmyJjoj0I/0vPHpo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (122.167.222.104) by BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Sun, 24 Jul 2016 17:08:02 +0000 From: Jerin Jacob To: CC: , , Jerin Jacob Date: Sun, 24 Jul 2016 22:37:40 +0530 Message-ID: <1469380060-26696-1-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.167.222.104] X-ClientProxiedBy: MAXPR01CA0023.INDPRD01.PROD.OUTLOOK.COM (10.164.147.30) To BY1PR0701MB1722.namprd07.prod.outlook.com (10.162.111.141) X-MS-Office365-Filtering-Correlation-Id: 2885b9ef-fb23-4270-4683-08d3b3e5137f X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 2:p+O+ACnKmfQuSom94j8W4gFewDXm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KeDqUEVisop+UIV0MGpXYFN1iwfg2cxGk5BKztmd2QQ052wvV+7YP3ND05yOh0pR+XrwP6ri5+HN44LVyFulKHLg5/giuZWMbhjTQu2QDat4sCHbZC6BGQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 31:4RNnN+ciBLqOKEYfAvWIQH9dOh9p7bd+yZ8yEskOUjE1BgO5gxtvPXseZsQMc65xOfAFLUbQ6e4Uimt/61j8Z+v3n3D5JCI1Fja9sz7e83J8A6erXRDaGdkCOA1E2fK8dwnZ3JdW4m8SznYh/404/GoPm6U3B5teerjgAPJvbrmmP/j/x5b/z8jT/uNjDt3CFv6GM7aGhPdL2I6hbnDPRA==; 20:2hXDsacUoZ5CX0Q0G+drqYjib5F319/T56/gy8EL4mwZeJEGlSC/jYhikUzMOcO1Co5HozElJ05kO/PsNaZw5HPfB6MWwod5423Onw7OELJPhNNG8fmlwwTotCRSjbnZIoisLmwrHADqDvy58TbD4ur+OPJl7oddCeRJ2CjGEDill/hV7amx0se9J6HWGQ0A1sRbfrqUSKCivM2aAlTw5Ja9i+SsMCHUmnZafyRFKJCxiYU6U+H3slS0DMZBXMB0j8wfIUb0P25M6p5DKRDSdnPGzkOl70stpZFKe/IHtep/9Pk+e5cgEsvY8qZuR37O5ayaw7ec3HzmtgqyI9h1mGGqsXDGQhA65IqubnS9sqTX2dWczH4bvN61dRFL9igTnJ1Cnv4u0yTVu0QyWpjthlTz05lWn1iR8jGt4qJcfl3gblEb5iIQfUsBqFMhX+xmKbqBZldE4KuUBBPoNB5ihrpdWu7N2+d0yOp46VvVVdtpuxRnC1Znr2KdhBvfdFU4O6oCJewo3W3t9nEq4MntLljnKmz5xb5n1G4y73BsZ08ktToExFAHtuDFsi/H8s9jSRXQxQCaoT6MVCml1WLIB8QpLuL1U4TaMFEriagn5/8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:BY1PR0701MB1722; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1722; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1722; 4:ZE6fL7cuq42QsMGE86bwGS3T7JxC1oqaGwMyP0Bg3WVIU8InGR+loADNYF5u4g0IzV8QDwCgzjZBf/2IwhmBYwPbz3RK9pBAQgpz7XhaKXZ/N+l5osEahjoNMYEmgxjsNca51Ea84MrSmjd175ou83IJeQxCBak12MNTmFROzJ0gLUprgKx2OEJ7wsVIENFQkPmcjF+pLwTqjE8cRqW5obkkou26R08UZrHD/4EwiIH1vfoVUEgecabFJHuogADoZdihJMoF9B+7MOhoSPyQohXfeMa3c1LbHEGYKLDsfv6X6uLg1zy+SyOFmIgh2Eyvs6aw/qsoHczBfP5VXOrKUJ0w86B274r95MKEAi1voaQMC2qz2bvfirjJXLQw8B0g X-Forefront-PRVS: 0013079544 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(105586002)(36756003)(81166006)(48376002)(50466002)(8676002)(5003940100001)(92566002)(81156014)(4001430100002)(77096005)(305945005)(586003)(33646002)(19580405001)(66066001)(19580395003)(47776003)(4326007)(110136002)(107886002)(42186005)(68736007)(2906002)(50226002)(101416001)(106356001)(7736002)(7846002)(50986999)(3846002)(6116002)(97736004)(189998001)(2351001)(229853001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1722; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1722; 23:Fj4tJmD4EJnSoVy3K8ziVxB+HfbxV8hYqzQ97D1?= =?us-ascii?Q?nlNxj/JQNbyD+Q+SlKgQjkjFP5s6yC0ClJRqw91AAtzwKJ98L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 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2016 17:08:02.8298 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1722 Subject: [dpdk-dev] [PATCH] ring: fix sc dequeue performance issue 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: Sun, 24 Jul 2016 17:08:09 -0000 Use of rte_smb_wmb() instead of rte_smb_rmb() in sc dequeue function creates the additional overhead of waiting for all the STOREs to be completed to local buffer from ring buffer memory. The sc dequeue function demands only LOAD-STORE barrier where LOADs from ring buffer memory needs to be completed before tail pointer update. Changing to rte_smb_rmb() to enable the required LOAD-STORE barrier. Fixes: ecc7d10e448e ("ring: guarantee dequeue ordering before tail update") Signed-off-by: Jerin Jacob --- lib/librte_ring/rte_ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h index f928324..0e22e69 100644 --- a/lib/librte_ring/rte_ring.h +++ b/lib/librte_ring/rte_ring.h @@ -756,7 +756,7 @@ __rte_ring_sc_do_dequeue(struct rte_ring *r, void **obj_table, /* copy in table */ DEQUEUE_PTRS(); - rte_smp_wmb(); + rte_smp_rmb(); __RING_STAT_ADD(r, deq_success, n); r->cons.tail = cons_next; -- 2.5.5