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 633E8A0528; Thu, 9 Jul 2020 15:32:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3DAEF1E8F4; Thu, 9 Jul 2020 15:32:01 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10044.outbound.protection.outlook.com [40.107.1.44]) by dpdk.org (Postfix) with ESMTP id BBD711E8F3 for ; Thu, 9 Jul 2020 15:31: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=2qwx5qso6UjGCZeXspFaM2T88ko2S3Tt/nfUT4NFYFM=; b=xj6mwnAU0xVxIpzIdWlZspKObvNMPkzPRUloFjULvmuOQ1muGJvHgVOI1Gv7pyUvIKvWam4yraRSZls+HfAxrGmW46e8yNNQrbHL3uT0o1z/dlpP/U70hMKy/+3ZdqE29DH/QTdKlZum1kySr5Ux6XBWBYs6joqMUsF7EKMkEVE= Received: from MR2P264CA0074.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:32::14) by DB8PR08MB5531.eurprd08.prod.outlook.com (2603:10a6:10:11e::18) 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 13:31:58 +0000 Received: from VE1EUR03FT056.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:32:cafe::9c) by MR2P264CA0074.outlook.office365.com (2603:10a6:500:32::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20 via Frontend Transport; Thu, 9 Jul 2020 13:31: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 VE1EUR03FT056.mail.protection.outlook.com (10.152.19.28) 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 13:31:57 +0000 Received: ("Tessian outbound 73b502bf693a:v62"); Thu, 09 Jul 2020 13:31:57 +0000 X-CR-MTA-TID: 64aa7808 Received: from 20031fd642f3.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2FA08535-259E-47C6-95DE-A1F4F3B038C6.1; Thu, 09 Jul 2020 13:31:52 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 20031fd642f3.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Jul 2020 13:31:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zp1Pfy6qBKeQhW7sQ118L4RsQ26A3DO1VbHL0H0XYbQPmCZo3NlI4uvA7I3T0R8/tJXtAX2flawSRth2sB7twk0EFTrgUMpENnmzkmUibbNSJD4MzSTacyFtAGIUvz1gDB/z7J2WncA7rmvlJVtxDmXFx1inKgiqlWq65hHfj5HC0H8Q0Ixh4SQ/RsTi0+ZYMQMfIr/hqEu9cK8++E5zDE/DqfEdUeKtLdusKvancfO3fuYl8ENavp6mU/7dkTBd+QQlQ4zzR2W7j5FQEWR8fDDXh3WrGb6vC2LtZCXmq32/uXxby142dtA1VLUdoNMY1wwV5xzs6MZuHA2lbBnNRw== 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=2qwx5qso6UjGCZeXspFaM2T88ko2S3Tt/nfUT4NFYFM=; b=W7eJ8Rdj8qj4YDh8DIUSU3VnmdYxRcyEBrzIOh/1Pr6PrqdZZv0PrwNlKRaRUYq99YjHos2D3/lESEAopxDF5y85V+3kw5WkdIyEAQs7IdMrVuyNgkZrcHQgRXnsFeqA4dZft3LRcbPtZy/uY4VZGe7BczbcaoPAVTy9EOxbbX/Oe/YYxt0n3NU61wZqkfsHHEm2jOb54CuwNQF3lIxWnmS+ITMhMiK1KxvnUBwfBjic0MkEkNkQON4ZUyhzdaCkZfbOg9oDh+jzpcPXdJrY6wgQgnrlYyXmoIHDu607xjb8e4/y0z5ov3SWtLqzFcaKIZ6/zFRLAKa0r4SIe3L33A== 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=2qwx5qso6UjGCZeXspFaM2T88ko2S3Tt/nfUT4NFYFM=; b=xj6mwnAU0xVxIpzIdWlZspKObvNMPkzPRUloFjULvmuOQ1muGJvHgVOI1Gv7pyUvIKvWam4yraRSZls+HfAxrGmW46e8yNNQrbHL3uT0o1z/dlpP/U70hMKy/+3ZdqE29DH/QTdKlZum1kySr5Ux6XBWBYs6joqMUsF7EKMkEVE= Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com (2603:10a6:4:85::9) by DB6PR08MB2791.eurprd08.prod.outlook.com (2603:10a6:6:17::32) 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 13:31:51 +0000 Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::9d1d:207b:e89d:199d]) by DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::9d1d:207b:e89d:199d%10]) with mapi id 15.20.3153.030; Thu, 9 Jul 2020 13:31:51 +0000 From: Honnappa Nagarahalli To: Phil Yang , Olivier Matz CC: "dev@dpdk.org" , "stephen@networkplumber.org" , "david.marchand@redhat.com" , "drc@linux.vnet.ibm.com" , Ruifeng Wang , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v3] mbuf: use C11 atomic built-ins for refcnt operations Thread-Index: AQHWVdlSQeI3jIVVD0W3sEV6jJxP46j/FYeAgAAgoICAAAhiEA== Date: Thu, 9 Jul 2020 13:31:51 +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: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 0e198a5a-5d53-4af6-988d-58fa091ea484.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: [217.140.111.135] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 52ce3c16-d854-4bb0-c0d0-08d8240c7413 x-ms-traffictypediagnostic: DB6PR08MB2791:|DB8PR08MB5531: 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: M/SDTgm9dEunCKam7VxbUH9ntXMUq0O1aSfK4gk3EFauqX1nhEM8pVNrKVeGgy806XJuu3J/B0Imf5Y5SqQaStQ4ZrfYxdprkSFEka5/h5bq4xZYu0YHxwHpcuA+02wSwVa2RPuNqrKTaph5pl7OAKcjdT+1hZFlR3oXtdKNITzwy6roAQPBYpw/vx7vTvE+51DKOLzykSh6a7KgPl9rNbNSBSZKvRmgQFRt1auo1CVKWvyey4ATSKs35YYucYx3LNzeJB4wmyzVKdM4ey65vvIojpxLoJ1r84i6ISZS3DqvS2DuSTXC1kSLj9lUlEcakdJSDvcDeHxVz5qDzKlmlA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0802MB2216.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(136003)(366004)(39860400002)(396003)(376002)(66946007)(76116006)(71200400001)(8676002)(7696005)(6506007)(54906003)(9686003)(55016002)(110136005)(316002)(5660300002)(2906002)(478600001)(83380400001)(8936002)(66476007)(33656002)(26005)(186003)(86362001)(52536014)(66446008)(64756008)(66556008)(4326008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: 4/zGoihsLPEUuqhHxEvbnK2ao6xc63ft4YRoOWVM3W0FAp66mAedJC3gm5xamDTm371d2THq/JSrZ7F5jqVfwmT8IgnFXCg/eyQnbDDeX6aUCFXSbgkHC8J8kbE5M+ajCSBgUfL/nXJg02RQ5ZULDQfQAChM8NUuzSojcTSIhCP3kKQNL+AHkbWdPtI20rkUwbO1AIbnzs6A4ztJncLQDGsuyrK6+C3fsQQOfMmeQSsF1EYmhZs1dCf2MUB8dESXFikgH0ReqluJT0y9f4X3aANgxa9QPzkC49JC+ybA963yEiB99r8C1UnwfZ2nwg08+F1aMmFOyXmwVAw1hpq1N4jjayWw+DP5Rk7X4XD95TtoVosbXi+PTZ9S6VZN5Awog+pfoGUp/bKmtqeeIF/U6sRTt2N1JwZOBZWNYaTjC0J3akGN5/07ic017TEHP1VwYcDGDW/YANp7HKHmKriRVzOdEvgKTabrCqWXzQxtLt6NxKyznAPzRXPGp+5nsDzP Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2791 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: VE1EUR03FT056.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)(336012)(86362001)(82740400003)(47076004)(6506007)(26005)(5660300002)(316002)(70206006)(36906005)(4326008)(70586007)(52536014)(110136005)(54906003)(82310400002)(478600001)(8676002)(9686003)(8936002)(83380400001)(356005)(186003)(2906002)(81166007)(7696005)(55016002)(33656002); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 5f4c9565-61ed-4dd4-ab37-08d8240c701c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PQl2MnCXsG7NhHKntc8ysssIrBn+v27VtyZ2xzF2F/BFv3ZXWsYUqVYBe3x99xFvmR7HVKEULhGWBxgVFLBJuL5XrENBS0BHmoyWUf/S8qX8lDheLCWWPUueNvWDrwLlqSFHP7Yx/td/ZFyY6hEAzsphj+q0MeaZG+xb48phxgsZk744mzoka6TQQVXaqH+kIB6cwGdiKt4Resi9T1eYlW+3knCtCmff2k5z1puT9vjamDMw+SwEVJyUTrs5Q7dAcmL36AJ1xBFpo5Q+jhsw93i7QuxuAVCmoRk5JwLOZLJmb2gPYzEe3lDb5a5I5O75q94pegEKRM0Rr3q7f+ReuNIhG2QdabLgwCgj558pvWcaUb1ChXRifyH4M0ccnSiaEYVRFK5gSDCgayQX6xDhqg== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2020 13:31:57.7314 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52ce3c16-d854-4bb0-c0d0-08d8240c7413 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: VE1EUR03FT056.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5531 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" > > > > 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 argument= */ > > > -rte_atomic16_t refcnt_atomic; /**< Atomically accessed refcnt= */ > > > +uint16_t refcnt_atomic; /**< Atomically accessed refcnt= */ > > > }; > > > > To avoid an API breakage (i.e. currently, an application that accesses > > 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? >=20 > Got it. I agree with you. > It should work. In my local test machine, the ABI checker happy with this > approach. > Once the test is done, I will upstream the new patch. >=20 > Appreciate your comments. >=20 > Thanks, > Phil