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 5BAEAA0528; Thu, 9 Jul 2020 12:00:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2FA071E551; Thu, 9 Jul 2020 12:00:35 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2076.outbound.protection.outlook.com [40.107.20.76]) by dpdk.org (Postfix) with ESMTP id 6C76E1DEA4 for ; Thu, 9 Jul 2020 12:00:34 +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=BmB+pPF1i4DGY2wmyOBhn0ZLdbhTJVWXmMFecScX3QY=; b=5Fgcdh59d45BJVWrIhLilhJHiZnca94HWvubK1QS/UjhdP/uk03siQ/53105nXkPKZAo69bMflbbLjNhLSb9Q9gechQgxkXJIypjzp4PhobDbe8FihaBEFhitv0V5Tm+kOg6kIBJUwU8nJS7j0rph+WSBYNHK0vsHa2Ic1wfdYE= Received: from DB6PR0301CA0003.eurprd03.prod.outlook.com (2603:10a6:4:3e::13) by VI1PR0801MB1727.eurprd08.prod.outlook.com (2603:10a6:800:5a::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 10:00:33 +0000 Received: from DB5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3e:cafe::a6) by DB6PR0301CA0003.outlook.office365.com (2603:10a6:4:3e::13) 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 10:00:33 +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 DB5EUR03FT054.mail.protection.outlook.com (10.152.20.248) 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 10:00:33 +0000 Received: ("Tessian outbound c83312565ef4:v62"); Thu, 09 Jul 2020 10:00:33 +0000 X-CR-MTA-TID: 64aa7808 Received: from 6dede38bccbf.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B3A74FBC-BE62-4781-850B-D0E4F6356EDD.1; Thu, 09 Jul 2020 10:00:28 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6dede38bccbf.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Jul 2020 10:00:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cVsyDct92ioYjlWNxIBATcdIzwjsIchd8wzFzSGXedk/7ZLzFp1GaH6NlinMyWnNm9MjHFD/YRlRtIbf9b0lQqJwWd3I1xkOTV4o8Ms5zrBxZe34okOU+jE3KIJi2WVYkRwVx4v0kDlavJAHOKOJxEx2jB+PdR6vO4s+HeTWPeeuMnN9ASO0mPfZOxhfYO1iQABVIKklHIS9p9dr0fM9hoPCM6jV0SfLwg/k5SJmBzPWiGZjTlW1tRZ5wvqVqGZ3VrNd6EC6UKvL7Fdi8L5ITy67dpwkieot1TRnsD9OPlVp2rASU9VxD8XXLXgd+Y00dGeh2wdpRhXvxyCrvy1OIQ== 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=BmB+pPF1i4DGY2wmyOBhn0ZLdbhTJVWXmMFecScX3QY=; b=OtXTxDVCWHX/XMt/CjGcEpjDKqN8WejV99JDQ2D40wk0BiI2IMBnUCAcR47s71osleMt+fsbTc9aWieNnsMl7075QmRz2MdvXie4U1INu4+NMdHDD/U8NmQcgMwEzdwfdP9uTH+piuix7CbyzwVJ9LE7ydHp/V4akY4zStjcbIDudD6kKGTolBRi0uQtSTU/4F5R2/3UDjqTjaVJhJ7I+IdPk9c3/2Apf/Zf6F9T50SEbv/DBzEGdECcCx0ORvKlgUChNSkwlHjpaXVr0MonvDi+aDqW7q9CKpzF3Q85D/W/6cGiTnXP/ToYlvRvMFz53dmn869lfa6T0oNKsKDT8g== 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=BmB+pPF1i4DGY2wmyOBhn0ZLdbhTJVWXmMFecScX3QY=; b=5Fgcdh59d45BJVWrIhLilhJHiZnca94HWvubK1QS/UjhdP/uk03siQ/53105nXkPKZAo69bMflbbLjNhLSb9Q9gechQgxkXJIypjzp4PhobDbe8FihaBEFhitv0V5Tm+kOg6kIBJUwU8nJS7j0rph+WSBYNHK0vsHa2Ic1wfdYE= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11) by VE1PR08MB4910.eurprd08.prod.outlook.com (2603:10a6:802:ac::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24; Thu, 9 Jul 2020 10:00:23 +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 10:00:23 +0000 From: Phil Yang To: Olivier Matz CC: "david.marchand@redhat.com" , "dev@dpdk.org" , "drc@linux.vnet.ibm.com" , Honnappa Nagarahalli , Ruifeng Wang , nd Thread-Topic: [PATCH v2] mbuf: use C11 atomics for refcnt operations Thread-Index: AQHWVR00pTIG4oOTZUS/nI0wX7HRZqj/AzOQ Date: Thu, 9 Jul 2020 10:00:23 +0000 Message-ID: References: <1591871178-12542-1-git-send-email-phil.yang@arm.com> <1594116633-14554-1-git-send-email-phil.yang@arm.com> <20200708114428.GO5869@platinum> In-Reply-To: <20200708114428.GO5869@platinum> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 21d8d2d7-90ef-445f-9f53-b71ca9db1b11.0 x-checkrecipientchecked: true Authentication-Results-Original: 6wind.com; dkim=none (message not signed) header.d=none;6wind.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: 584778d9-a32b-426d-511f-08d823eeeb73 x-ms-traffictypediagnostic: VE1PR08MB4910:|VI1PR0801MB1727: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; x-forefront-prvs: 04599F3534 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ow5ccAl72AhLha3LP0h8K4vu8rF7DxGb3F90Kug/L51o1YvNd4kzTaHoJ5rmBt0l5yjF00SkekEcESjGKZmcrkbswJcLnrcXiLoPJyu3XNatuwclpeeyPXheMFxtLI+kfYkPQrMsDAgs0P7vQsonTJD8b5ngjFJnmLrnEpz8lim4Y5zsQNtoL+QtOdg1+xcRKe5E/QK/8Loknz5YLaJe6GctM6pWkMo+OCLFsLb+34MNatOyq/X4pUN0GNxtwdMr/FPK5fij3nzQSsaew3QjU5qjddxp6TFUQL2T8JXkkRDfIQH4rJHpqdVUPXbCVjBAz+XwaFNUXPG/HzYQ8vkl1w== 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)(346002)(376002)(396003)(366004)(136003)(39860400002)(26005)(76116006)(66946007)(66446008)(66556008)(66476007)(64756008)(83380400001)(86362001)(8936002)(8676002)(5660300002)(52536014)(186003)(6916009)(55016002)(4326008)(71200400001)(478600001)(6506007)(53546011)(2906002)(9686003)(33656002)(316002)(7696005)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: MQqiy1npYDNTm9uhpRBkM6x0bmvRgJGseB930s0Jo/nwjoQj4zZvD9hRaWCWD1KRpwbZfOcULmxk6CbxHQ8GSfLrwBFW32YuAhaPIiSkPpOfD0shhpsBpqpSKsUtxlpzmLL93JTiZX5AFQEkAcnqzZiInEJIojclgeqjLwuHaIKDAu9qDt91FtLklH02V/7n1zx1vfKuEizozFQcbshiujszPh8xP/Eab8+tjoKSEx4v6sW/BT896nK5FagOu0Eum/JFMaut0st5gCJ27qSSeqeOw1MeJXjC8z+IpdVJFJRWG1MU85t7zUphp5xPNZFS7T1jCObVfoIXAmkeq6iz6rAMXukjonQ1xYQ2oT+S1e6VFMJPkF8JVAbA8zIxwc/zdb8Z2D6VH1fkpCGrobkrZsZiQQxvd2CJ2LL96zza1M5LOPJ6dztSj3a8LIcBxzzwNfI/qwVdyUtxc/C7KmWvIxgF5VojMDExG+TwxbZKpqQ= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4910 Original-Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT054.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)(346002)(396003)(39860400002)(376002)(46966005)(33656002)(8676002)(316002)(8936002)(478600001)(70586007)(81166007)(5660300002)(47076004)(82740400003)(82310400002)(70206006)(356005)(186003)(52536014)(26005)(4326008)(55016002)(2906002)(336012)(6862004)(9686003)(54906003)(86362001)(7696005)(83380400001)(53546011)(6506007); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: c7cf4c96-6f89-4393-04a6-08d823eee584 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /Ek8HD9NUao5GTLV1144IdTpi+NOpmSWZA+TNafBfKPP3U5mNfHC35pb4zP3LjZ2UrnwLXvRfrVcsRgN3PN8BTTgm6/QbrtywULezCVBjHwG7W3mg+tD2A+8X+bXSB71qo/7MumgEzg79iWfIUfOSf3Kl59Z1QNnTFUiLVKP/Q5v1O1kPi0gE6Fq5wkgrivGf9E0OhzXppkuzoAUDHdT4V3V/42edmvELiQohaRSQAyIHUuK9iJ3Li+MKQpbGHqGqmQ1KGzgwzCTrIb7SH8RyN7+512v1jhwz+kOCd1fzc0/iaFy9GMGnb+riV8ZatlM1A8i52EW2H/KHr8yMVr34i4iwYPx1qjtJnZ06HoFNrzq6vddE0xMyxKx7G6VUopB94yGwbic+lz/xemtfI2NKw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2020 10:00:33.2217 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 584778d9-a32b-426d-511f-08d823eeeb73 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: DB5EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1727 Subject: Re: [dpdk-dev] [PATCH v2] mbuf: use C11 atomics 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" > -----Original Message----- > From: Olivier Matz > Sent: Wednesday, July 8, 2020 7:44 PM > To: Phil Yang > Cc: david.marchand@redhat.com; dev@dpdk.org; drc@linux.vnet.ibm.com; > Honnappa Nagarahalli ; Ruifeng Wang > ; nd > Subject: Re: [PATCH v2] mbuf: use C11 atomics for refcnt operations >=20 > Hi, >=20 > On Tue, Jul 07, 2020 at 06:10:33PM +0800, Phil Yang wrote: > > Use C11 atomics with explicit ordering instead of rte_atomic ops which > > enforce unnecessary barriers on aarch64. > > > > Signed-off-by: Phil Yang > > Reviewed-by: Ruifeng Wang > > --- > > 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 | 11 +++-------- > > 3 files changed, 13 insertions(+), 18 deletions(-) > > >=20 > It seems this patch does 2 things: > - remove refcnt_atomic > - use C11 atomics >=20 > The first change is an API break. I think it should be announced in a > deprecation > notice. The one about atomic does not talk about it. >=20 > So I suggest to keep refcnt_atomic until next version. Agreed. I did a local test, this approach doesn't have any ABI breakage issue. I will update in the next version.=20 Thanks, Phil >=20 >=20 > > uint16_t nb_segs; /**< Number of segments. */ > > > > /** Input port (16 bits to support more than 256 virtual ports). > > @@ -679,7 +674,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 = */ > > }; > > > > /**< Maximum number of nb_segs allowed. */ > > -- > > 2.7.4 > >