From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6D7BBA00C5; Sun, 26 Apr 2020 10:41:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 480261C042; Sun, 26 Apr 2020 10:41:51 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130047.outbound.protection.outlook.com [40.107.13.47]) by dpdk.org (Postfix) with ESMTP id B8C781C01B for ; Sun, 26 Apr 2020 10:41:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IyMD+VeFJONPY4b/a7Dn/Qfc/jJIBm0DP6lPcyTJKPQ=; b=1saYk0BIgH1iojYiwdoIQKvuFCFh0ovmBXJwXbDBIKJRA9oNdgXpWCe6qmoHzlqhnmZ0TxbH7XrGLpnB7P+AgRvRl2ZEMqaCMHpIvpb5hzFcUDSSFrMZOWg3kui70EmxA9oD+BUCwSD14E6N05Zy2iEN5DklDBoUSlo8vec8oAg= Received: from DB6PR0501CA0041.eurprd05.prod.outlook.com (2603:10a6:4:67::27) by AM4PR08MB2626.eurprd08.prod.outlook.com (2603:10a6:205:7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Sun, 26 Apr 2020 08:41:48 +0000 Received: from DB5EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:67:cafe::71) by DB6PR0501CA0041.outlook.office365.com (2603:10a6:4:67::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sun, 26 Apr 2020 08:41:48 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT039.mail.protection.outlook.com (10.152.21.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.19 via Frontend Transport; Sun, 26 Apr 2020 08:41:48 +0000 Received: ("Tessian outbound 567b75aed2b9:v54"); Sun, 26 Apr 2020 08:41:48 +0000 X-CR-MTA-TID: 64aa7808 Received: from cf9d31d40bef.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D9783FF9-07FA-4160-A456-C8DEA3016175.1; Sun, 26 Apr 2020 08:41:43 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cf9d31d40bef.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Sun, 26 Apr 2020 08:41:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eRZOviVjWP4k8cd2Ko0nZC6cEWi5oNia6dtPWiPX01xTRppm+qjBd5xomK3kqaWRYCOiH8nQ4lZkmVNi03l+0x2t9NIBCjwO38t64nw/Bndt6hwGIsnX/addJV5sVmoN1pIhAzx5mt2tU3L0clJOE7m444nY8JFnQ4tFAcqqFz6q3aG72I5pdKWaxd9wEfwdXlPE0eigjjGgYBl0IjVxngv1L4fz7vuAW7d39980y5ShVBObsVksHIwUuK7lbPPw6sL8V49YkcSsKj1r0SbAc8Y3z+uN2A/bLt+lFRZoi91Tv68OPOXAii4Yqr7b80nnJKP4lv3/MlzWsucu1PjfsA== 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-SenderADCheck; bh=IyMD+VeFJONPY4b/a7Dn/Qfc/jJIBm0DP6lPcyTJKPQ=; b=VKNT1FOCCtylMo/fwlhUYUTvfz5LsPirlHWyEZtoO0MTdGnb+Z6LUXY1rC2kfKS+uoizv4aX+FavaaTaQaeHH7ptx0GMjQ6qZYTzK+OHy4lGQGk+g8N14Bkir4WoiMWAd1KsGiLeXREpmVG79o9c+hvEjl/GHfnTi/cTK+s8JGdp7ZGa9GxPs0gcvtY92Im+k2x8a60lY6AAV4WboLsZQhc/BYm0xALj+M43JsGyGkPKTMwmpTYURuG8smoxoaym3DhxHWTFX7bM2kdHGN+tJrH/+TtsCNK1UZXiLh4lfsJDiDmfPvGehKtNQzU8WEHdbrszVBXv5oxAzDPKMXe9+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IyMD+VeFJONPY4b/a7Dn/Qfc/jJIBm0DP6lPcyTJKPQ=; b=1saYk0BIgH1iojYiwdoIQKvuFCFh0ovmBXJwXbDBIKJRA9oNdgXpWCe6qmoHzlqhnmZ0TxbH7XrGLpnB7P+AgRvRl2ZEMqaCMHpIvpb5hzFcUDSSFrMZOWg3kui70EmxA9oD+BUCwSD14E6N05Zy2iEN5DklDBoUSlo8vec8oAg= Received: from VI1PR08MB5376.eurprd08.prod.outlook.com (2603:10a6:803:13e::15) by VI1PR08MB4560.eurprd08.prod.outlook.com (2603:10a6:803:f1::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Sun, 26 Apr 2020 08:41:41 +0000 Received: from VI1PR08MB5376.eurprd08.prod.outlook.com ([fe80::a0e2:2a9f:be7b:4b15]) by VI1PR08MB5376.eurprd08.prod.outlook.com ([fe80::a0e2:2a9f:be7b:4b15%3]) with mapi id 15.20.2937.020; Sun, 26 Apr 2020 08:41:41 +0000 From: Gavin Hu To: "Ananyev, Konstantin" , "dev@dpdk.org" CC: nd , "david.marchand@redhat.com" , "thomas@monjalon.net" , "jerinj@marvell.com" , Honnappa Nagarahalli , Ruifeng Wang , Phil Yang , Joyce Kong , nd Thread-Topic: [dpdk-dev] [PATCH v1 2/2] ring: use wfe to wait for ring tail update on aarch64 Thread-Index: AQHWGgciCpvDkZSsDkGhnmrEcAjVi6iIQyaAgALVlBA= Date: Sun, 26 Apr 2020 08:41:41 +0000 Message-ID: References: <20200424070741.16619-1-gavin.hu@arm.com> <20200424070741.16619-3-gavin.hu@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 5fbd12e6-f321-4753-adcc-1c7f3c0d1ba9.0 x-checkrecipientchecked: true Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 66010b43-9605-4ee6-f64a-08d7e9bda8d2 x-ms-traffictypediagnostic: VI1PR08MB4560:|VI1PR08MB4560:|AM4PR08MB2626: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:6430;OLM:6430; x-forefront-prvs: 03853D523D X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB5376.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(366004)(396003)(136003)(346002)(39860400002)(53546011)(33656002)(5660300002)(86362001)(26005)(6506007)(478600001)(4326008)(7696005)(186003)(66556008)(66446008)(316002)(55016002)(2906002)(55236004)(8936002)(15650500001)(9686003)(52536014)(66946007)(81156014)(71200400001)(66476007)(54906003)(110136005)(76116006)(64756008); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: jnssNAZQvuVIzugf1ISJQmuWxPA05Aamn/xzkIUf7hX/hKDjNCyX2KKyOXWY3mewbqx/5D4ncG5gNpW1pzLYUmxjEVHKragyTon/wbhWoOnEpBkBr7vvHRYMZAtGq0HkFyjMReknjXXG/mtOmxGHkUTUB0p2hk9sM4Z6ONd8JTn6TG8ne5zzMTElIZ8r+KjnThG0VOKfDtkl04SW8oCQf4y9RjDGYJlOhlLtUz5UicKLgVUbIczWzbzneb0dnqzzRBOfLPvJ6lTovVJkZTKk/OzxkGEdj6e6ED76q1I7/JYeBkMOtPY8DjsUFEaxVM4OjIMrLynQ8tJC3pcIqn4jK6YSm+kNlWD2EH0ZT0XuDGukCQwszdgg0YX2g6700RGiHVchrz/qg/KT0vSoCYJSP7Q6sYl+oQWoLX6rsmQl7ao9jNa6+BmJjqciqI3f07Pq x-ms-exchange-antispam-messagedata: KSNfqssNe/wyPUQ8IAPH7NsMafe/3hOUeCf3FyvPGgIBjpv41Bcl22Wkt+Tkg3ZvwLzXHYTQByljqV4mvxj7WlzJvhDhEAg7AlmQUpWHRUdAQQhmSwnc8o2W0AqK00V7dXrFAFCxWmlmilkCYHjZ/kyrPusAH70SW4B4zx0fY+/jFU0ECEBuyUELg3V8HkQesG36vO+x2E/QxJ7lqkd7nhxVoLTdekWhBIIld4KoEAnHJwi81CeHQqPr5wypNv0mEXRulfCAHjoxN/bzHQ9QjXdNOK5ZSiwsFPUDgknm6cUDZXdEN2c5I4OUt871zhw/0/62+C/dOKdGHYgxvJt6ikB/uezkb+nRmzbONN1io0YJHsSbeKhRtwmb+mMhmQ2YPY01XCFyV40gwrZ9GWnvE6DiMh0TJbjZxbbpgYXyJdwOCp+YlylDat+RdOnHievgIU44rHxWV7RJXlOoaPcjMoAibykuOmMIGDx0tjDWH8NcXTwfYxfUYLimXoWxtTTaj1wHQFoT+16LtQECIy3tYakXJvYBeSy8s3rPXp717AYwCrUqdedOBxqV+5EC+Kt3VAPaRlRmYG62+SqcsHncHIYJp0FCZOZr8fnjo/FthAGhgYzKxUdtwZCiGTpp6SCyh7eOSRfQ188LNEJG05KzpBkWSFiaasaA9ZX4QmDtWh123zjX8jw+H63vpsq50Ud7V48dtIRvSHRoDkOU58OdwFISpf1DiS8TwP/fY56l8N2k8EDsbzaztsxHWWnUosv+Vhm3MOHnmlf+vrnoVC7t/lZZR2thTwmxfYuGlBLoRWQ= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4560 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT039.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(136003)(39860400002)(376002)(346002)(396003)(46966005)(47076004)(8936002)(70586007)(81156014)(52536014)(316002)(55016002)(70206006)(54906003)(110136005)(82740400003)(82310400002)(356005)(9686003)(4326008)(81166007)(186003)(26005)(336012)(5660300002)(7696005)(2906002)(478600001)(86362001)(6506007)(15650500001)(53546011)(33656002); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 5a260a1c-2891-4413-8ad1-08d7e9bda4be X-Forefront-PRVS: 03853D523D X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MR0S2AJ8sfoKMgn1Z91LAoTZh3406+e4l4cnKDcqQAToru5g4UMnQhpO8c0RAGTPlwZhE8XXUWymCAZWsz12v5wIS+NEsh49p7jFUuvYdvvsA9QpOwLkxuG6TlwWI8JpFKXUtZrA0E2FbKt12wn2zVVxbqjKBaTqk98HWx7F6rGSWN30GmxnZmCvSDY12AADsYnEI/3Q4ysl8r2FwR0HXbr2UHfVLdSwpVvB6mZWCdIvoqWXZaSf3BnrjO4waupCpZrZGAeusp2uy/U4iPg0nr5zB5dxyySRay6AHbypTRLRU/v3z3i2jo6ErC1agbayPuTgc2JAJwhJgRch3ytRPTMTu0QOjbUsRyppUMz0VWxg7LQa/Mek9b1485KHyd5qRpgRL0zZef8CHwbWxMoV3LAAuVsddYKLyzXTr8JoHaoaG0TWb5t9a4C9TPN4iWrOPcQcwogoKCN3DpEHPxxjTQMA9Kti12GaSsEJ31f1VZraF4tOWe8dtKFjwwiaF946mL5IxptP6crGLdhSAYPwBQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2020 08:41:48.6643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66010b43-9605-4ee6-f64a-08d7e9bda8d2 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2626 Subject: Re: [dpdk-dev] [PATCH v1 2/2] ring: use wfe to wait for ring tail update on aarch64 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Konstantin, > -----Original Message----- > From: Ananyev, Konstantin > Sent: Friday, April 24, 2020 9:24 PM > To: Gavin Hu ; dev@dpdk.org > Cc: nd ; david.marchand@redhat.com; > thomas@monjalon.net; jerinj@marvell.com; Honnappa Nagarahalli > ; Ruifeng Wang > ; Phil Yang ; Joyce Kong > > Subject: RE: [dpdk-dev] [PATCH v1 2/2] ring: use wfe to wait for ring tai= l > update on aarch64 >=20 >=20 > > > > Instead of polling for tail to be updated, use wfe instruction. > > > > Signed-off-by: Gavin Hu > > Reviewed-by: Ruifeng Wang > > Reviewed-by: Steve Capper > > Reviewed-by: Ola Liljedahl > > Reviewed-by: Honnappa Nagarahalli > > --- > > lib/librte_ring/rte_ring_c11_mem.h | 4 ++-- > > lib/librte_ring/rte_ring_generic.h | 3 +-- > > 2 files changed, 3 insertions(+), 4 deletions(-) > > > > diff --git a/lib/librte_ring/rte_ring_c11_mem.h > b/lib/librte_ring/rte_ring_c11_mem.h > > index 0fb73a337..764d8f186 100644 > > --- a/lib/librte_ring/rte_ring_c11_mem.h > > +++ b/lib/librte_ring/rte_ring_c11_mem.h > > @@ -2,6 +2,7 @@ > > * > > * Copyright (c) 2017,2018 HXT-semitech Corporation. > > * Copyright (c) 2007-2009 Kip Macy kmacy@freebsd.org > > + * Copyright (c) 2019 Arm Limited > > * All rights reserved. > > * Derived from FreeBSD's bufring.h > > * Used as BSD-3 Licensed with permission from Kip Macy. > > @@ -21,8 +22,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t > old_val, uint32_t new_val, > > * we need to wait for them to complete > > */ > > if (!single) > > - while (unlikely(ht->tail !=3D old_val)) > > - rte_pause(); > > + rte_wait_until_equal_relaxed_32(&ht->tail, old_val); > > > > __atomic_store_n(&ht->tail, new_val, __ATOMIC_RELEASE); > > } > > diff --git a/lib/librte_ring/rte_ring_generic.h > b/lib/librte_ring/rte_ring_generic.h > > index 953cdbbd5..682852783 100644 > > --- a/lib/librte_ring/rte_ring_generic.h > > +++ b/lib/librte_ring/rte_ring_generic.h > > @@ -23,8 +23,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t > old_val, uint32_t new_val, > > * we need to wait for them to complete > > */ > > if (!single) > > - while (unlikely(ht->tail !=3D old_val)) > > - rte_pause(); > > + rte_wait_until_equal_relaxed_32(&ht->tail, old_val); >=20 > ./lib/librte_ring/rte_ring_generic.h:26:3: error: implicit declaration of > function 'rte_wait_until_equal_relaxed_32'; did you mean > 'rte_wait_until_equal_32'? [-Werror=3Dimplicit-function-declaration] > rte_wait_until_equal_relaxed_32(&ht->tail, old_val); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sorry for the leakage, fixed in v2. >=20 > BTW, after patch #1 compilation fails also: > ../lib/librte_eal/x86/include/rte_spinlock.h:125:24: error: pointer targe= ts in > passing argument 1 of 'rte_try_tm' differ in signedness [-Werror=3Dpointe= r- > sign] > if (likely(rte_try_tm(&sl->locked))) Fixed in v2, thanks! > ^ >=20 >=20 >=20 > > > > ht->tail =3D new_val; > > } > > -- > > 2.17.1