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 4AA8DA0528; Thu, 9 Jul 2020 16:11:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2395E1E95A; Thu, 9 Jul 2020 16:11:01 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2072.outbound.protection.outlook.com [40.107.21.72]) by dpdk.org (Postfix) with ESMTP id DEDA21E956 for ; Thu, 9 Jul 2020 16:10:59 +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=t5fWnZ9rkAmxnBmWNYEToRQVxTz/Y6lxqeMp/Zo1GD8=; b=qyr3r52XYCi6ml89fDSpmz8OM93T6xIQltpC+DM3uOyiSERinSmNGvvy0amQ8w15PueTz4ysWpO+h+K+cYUG6DYr8eRjy7dV67x2JLUdKHzclt8t759uQpE0q8LM19+jRx1sdTmIV1dT8Hv1uPoauFtTN4ocPizW10tQe+coQ4U= Received: from DB8PR09CA0017.eurprd09.prod.outlook.com (2603:10a6:10:a0::30) by VI1PR08MB3712.eurprd08.prod.outlook.com (2603:10a6:803:b9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Thu, 9 Jul 2020 14:10:58 +0000 Received: from DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:a0:cafe::87) by DB8PR09CA0017.outlook.office365.com (2603:10a6:10:a0::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Thu, 9 Jul 2020 14:10:58 +0000 X-MS-Exchange-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 DB5EUR03FT059.mail.protection.outlook.com (10.152.21.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Thu, 9 Jul 2020 14:10:58 +0000 Received: ("Tessian outbound c83312565ef4:v62"); Thu, 09 Jul 2020 14:10:58 +0000 X-CR-MTA-TID: 64aa7808 Received: from 4dcf50a533fd.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 24E33A03-BFAB-4D5A-B21C-1D66D9A124AD.1; Thu, 09 Jul 2020 14:10:53 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4dcf50a533fd.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Jul 2020 14:10:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k2ygS9REqnp3ACqe0OXgmJ29d8v5JuayT3vHy5p6aqYF02eWDA+AD0pKdCLiOcEvzs/+K/nMIIj7cDflB77NTpsee0DbVa0X8YcV0lzPHp4DAou8GoiH+jJHjp6vOTLaA0RdOy+2OyGBd2mamRo4lZmJ7wwcrFyJEqkNK/tMnL0q90k3LvDVhe57npYKMwy/3rrAEGQaO6oTeF78xnImeq28h5g5+UPYTULWWQwadeqtdF6fyHcVgZbrGjvAvKNwWP2MMgwAzMEHSPY+nFk9dKU82wChbezukP6NqBemXnePPQcMOliI7h77MlEXHvzvRbLVGhgqdeqxABhAYEdfbg== 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=t5fWnZ9rkAmxnBmWNYEToRQVxTz/Y6lxqeMp/Zo1GD8=; b=Ju/c+UXZPjSoQyibZ9fyOIDzrlHadKDBo9Cd3UOGu8E9vEaFRFQc9gQartrN5Oj0WGWtWw4BER7TjO5v9LUi1/Mvf8Oc5gWtzHng6/ihsUk8AqqwbBQmNKNHgTGQkY3tD3P5W6/ogL26eatz994o/HRhu1avrvFNGoC9VfS5vh5vxMjR93f2Ru3YNixW+hYToAj2lsYTW2PfrtqffyeTT+UhdB7LNv//oCWiE4EDiAE2V5jGkPZoCZWYCFoja98XOMLq/CZcNr7A4vYZJcePOqGV0U+JN0acO3lQJxsqVzBxsAsN22zmJQi6c+wF8URPLN03WigNS2E6dPVdKEUXfA== 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=t5fWnZ9rkAmxnBmWNYEToRQVxTz/Y6lxqeMp/Zo1GD8=; b=qyr3r52XYCi6ml89fDSpmz8OM93T6xIQltpC+DM3uOyiSERinSmNGvvy0amQ8w15PueTz4ysWpO+h+K+cYUG6DYr8eRjy7dV67x2JLUdKHzclt8t759uQpE0q8LM19+jRx1sdTmIV1dT8Hv1uPoauFtTN4ocPizW10tQe+coQ4U= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11) by VE1PR08MB5088.eurprd08.prod.outlook.com (2603:10a6:803:110::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Thu, 9 Jul 2020 14:10:49 +0000 Received: from VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::c2e:9ccb:a690:6863]) by VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::c2e:9ccb:a690:6863%6]) with mapi id 15.20.3174.022; Thu, 9 Jul 2020 14:10:49 +0000 From: Phil Yang To: Honnappa Nagarahalli , Olivier Matz CC: "dev@dpdk.org" , "stephen@networkplumber.org" , "david.marchand@redhat.com" , "drc@linux.vnet.ibm.com" , Ruifeng Wang , nd , nd Thread-Topic: [PATCH v3] mbuf: use C11 atomic built-ins for refcnt operations Thread-Index: AQHWVeC1ffllOV15oESYFT6vgODwWKj/Ml/QgAAMeoCAAAlUwA== Date: Thu, 9 Jul 2020 14:10:49 +0000 Message-ID: References: <1594116633-14554-1-git-send-email-phil.yang@arm.com> <1594289442-18594-1-git-send-email-phil.yang@arm.com> <20200709110345.GR5869@platinum> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 389c3441-c097-4c30-965a-eb8fb67052fa.0 x-checkrecipientchecked: true Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [203.126.0.112] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ab8947c0-5de3-48c1-25f2-08d82411e760 x-ms-traffictypediagnostic: VE1PR08MB5088:|VI1PR08MB3712: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: aItSBjqRTIqNgkBmstpI1+VsdYtqnQ89RETGrs40mLGR+oZDgMarLxB0WLa4LZOGkXCppu108Nzejs2plSuBsc3PjRVKVVRv4Inz+gQsvZE1BlcL3Ga8MH9KXFiLO5Ar4WAFzxjSRphdzyfBAePyaGJ4UXnNljnckJ2Q1jl5k1Y+nDZChqqRL9NCOfGAK0kyXfS5hcCP4lKaOdLa42gVksZkAj84Sre34rLZHIJ68liGmn62LDR67QwQxktau1skACRh0yeU9TtT7hK1z0Wwbqe+mHyU8rxiu/AB1/jvSMr1awlUHP3nafg8k/08OVCoM6F1t0Y7U0115FAjaHlG6w== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB4640.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(39860400002)(366004)(396003)(376002)(346002)(478600001)(26005)(4326008)(86362001)(7696005)(186003)(6506007)(52536014)(83380400001)(2906002)(8676002)(5660300002)(8936002)(316002)(66946007)(66556008)(66446008)(54906003)(66476007)(110136005)(76116006)(33656002)(9686003)(71200400001)(64756008)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: QuOhTTsASrUGQVSeC1ysFAPGJ+6F4t/Q1kSS+5n4ci7fOgwNY7sDkmshFrseOq9FKMTphilrsVQJ+2l7DBD9s92FRmS7mfspPTWkq5ECucGJUzLZUaWEwoYnYBaKw3zr0Nfxxr1UIUFMIZ8q65y4H2q90HiHo7pmVqjvyS63pDxYOsjf6Y2Bi6ftefQMEaoky/ryuFePgvgwkKn+xwLZfwxYi26IVk9+bdf/ET7NddMapk59lkgr7ftHtCKBEI6mcBtiJyVQcJGxqD4SsiJykn3wHhVlnSgEl+54L0y0Z6mjMIY+sHEJB7V2IIKG/EMan/gF02Cbo184ZsjdYjmIfgBb+K0CtSkH5MOKyI+5HfAFevN5Bj52gLBbrM6Ctq+EBwylTkNGaKRyqSZVOwtrLo2h/NmFWuEo21TC2KdxA5YlStLSJ/JYsyPdKewN2cAR+I0ZUAFJL1IOYh0dsDD16fHTQGboHtuVUo+ydMa9Fi4= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5088 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT059.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)(396003)(39860400002)(376002)(346002)(46966005)(110136005)(33656002)(8676002)(316002)(8936002)(478600001)(70586007)(81166007)(5660300002)(47076004)(82740400003)(82310400002)(70206006)(356005)(52536014)(186003)(4326008)(26005)(336012)(55016002)(83380400001)(9686003)(86362001)(54906003)(7696005)(6506007)(2906002); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 45cb8258-2cc2-4e4c-f075-08d82411e1e0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fQcCm+Lids7PzkGdr73FZcPGRJmGmkmJ08+gGo3H64VcYPk/3KcbXNn4SyY8TjFWaWRUfsHiPbwVj3hEt54fRQwTluotd87HAwVfQ21O6jbzheN3bl2f/moqdkHEVT7LUBkhloJaZUqYTSbfIdMysyhR1aWTRgPvFjHLKVpHRo0h6iWCnkeMZRhZx+nvNVf8QlyqyXgs92419V8EDwFZUr8eiRgDCXucufKrPiSHy6F/+I43mfkZ2E94pT6cWBUYuyySLR57KE/wdYYeWNCbTOvywSH/FPwGev+XItqCMozgsDBy1jHb/ZNmxSehvWd6thOxV7M1IHnl9oKXJ1Bqc5Z6t0F4KwX0BypRMFptJoXVA2wkHLE4lEYsxEfBUXgRGDXN4kUPUozN389DT62Ysw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2020 14:10:58.7737 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab8947c0-5de3-48c1-25f2-08d82411e760 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-AuthSource: DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3712 Subject: Re: [dpdk-dev] [PATCH v3] mbuf: use C11 atomic built-ins for refcnt operations 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" >=20 > > > > > > Hi Phil, > > > > > > On Thu, Jul 09, 2020 at 06:10:42PM +0800, Phil Yang wrote: > > > > Use C11 atomic built-ins with explicit ordering instead of > > > > rte_atomic ops which enforce unnecessary barriers on aarch64. > > > > > > > > Signed-off-by: Phil Yang > > > > Reviewed-by: Ruifeng Wang > > > > --- > > > > v3: > > > > 1.Fix ABI breakage. > > > > 2.Simplify data type cast. > > > > > > > > v2: > > > > Fix ABI issue: revert the rte_mbuf_ext_shared_info struct refcnt > > > > field to refcnt_atomic. > > > > > > > > lib/librte_mbuf/rte_mbuf.c | 1 - > > > > lib/librte_mbuf/rte_mbuf.h | 19 ++++++++++--------- > > > > lib/librte_mbuf/rte_mbuf_core.h | 2 +- > > > > 3 files changed, 11 insertions(+), 11 deletions(-) > > > > > > > > > > > > > > /* Reinitialize counter before mbuf freeing. */ diff --git > > > > a/lib/librte_mbuf/rte_mbuf_core.h > > > b/lib/librte_mbuf/rte_mbuf_core.h > > > > index 16600f1..d65d1c8 100644 > > > > --- a/lib/librte_mbuf/rte_mbuf_core.h > > > > +++ b/lib/librte_mbuf/rte_mbuf_core.h > > > > @@ -679,7 +679,7 @@ typedef void > > > (*rte_mbuf_extbuf_free_callback_t)(void *addr, void *opaque); > > > > struct rte_mbuf_ext_shared_info { > > > > rte_mbuf_extbuf_free_callback_t free_cb; /**< Free callback > > > function */ > > > > void *fcb_opaque; /**< Free callback argume= nt */ > > > > -rte_atomic16_t refcnt_atomic; /**< Atomically accessed refc= nt */ > > > > +uint16_t refcnt_atomic; /**< Atomically accessed refc= nt */ > > > > }; > > > > > > To avoid an API breakage (i.e. currently, an application that accesse= s > > > to refcnt_atomic expects that its type is rte_atomic16_t), I suggest > > > to do the same than in the mbuf struct: > > > > > > union { > > > rte_atomic16_t refcnt_atomic; > > > uint16_t refcnt; > > > }; > > > > > > I hope the ABI checker won't complain. > > > > > > It will also be better for 20.11 when the deprecated fields will be > > > renamed: the remaining one will be called 'refcnt' in both mbuf and > > > mbuf_ext_shared_info. > Does this need a deprecation notice in 20.08? Yes. We'd better do that. I will add a notice for it in this patch. Thanks. >=20 > > > > Got it. I agree with you. > > It should work. In my local test machine, the ABI checker happy with th= is > > approach. > > Once the test is done, I will upstream the new patch. > > > > Appreciate your comments. > > > > Thanks, > > Phil