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 C1E2EA0528; Thu, 9 Jul 2020 15:00:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A8A91E8C5; Thu, 9 Jul 2020 15:00:44 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00088.outbound.protection.outlook.com [40.107.0.88]) by dpdk.org (Postfix) with ESMTP id 7428E1E8B1 for ; Thu, 9 Jul 2020 15:00:42 +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=QETj+gqf6A9AhlIgIKfWKYlRNP23U+E6LQOsGY1upGU=; b=JtD38zzC0e2CwDEYD8w1mwhu/i7G7EZ7C0bbCmiB3lo2SY2RCFDZf/+EeHGnP8AMDkHpIuRWQpdEl+u0PJRcteAoxN7xndbCc7dEFnHm2BiYFdL9eC6CDO6GIVrpS/nSA6KjQQx3w68qi/Xg2SLWvOUI/YLk/+agcT2nwZzKFio= Received: from AM5PR0701CA0065.eurprd07.prod.outlook.com (2603:10a6:203:2::27) by DB8PR08MB5164.eurprd08.prod.outlook.com (2603:10a6:10:e7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Thu, 9 Jul 2020 13:00:40 +0000 Received: from VE1EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:2:cafe::97) by AM5PR0701CA0065.outlook.office365.com (2603:10a6:203:2::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.12 via Frontend Transport; Thu, 9 Jul 2020 13:00:40 +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 VE1EUR03FT059.mail.protection.outlook.com (10.152.19.60) 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:00:40 +0000 Received: ("Tessian outbound 2ae7cfbcc26c:v62"); Thu, 09 Jul 2020 13:00:38 +0000 X-CR-MTA-TID: 64aa7808 Received: from 72ce75999c39.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8B15BE5C-24B1-4C7D-B460-BF3DE223A138.1; Thu, 09 Jul 2020 13:00:33 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 72ce75999c39.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Jul 2020 13:00:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dPmIzRbVcfeHC3PqIL0GPAiDcs2f+PACJPah4IP3+7tXLOEboIzlQEMkzfzLOpYUz1FxGAlBAaXZFH6Vn9zf37+4fG6juhG1wtgjoyTC1yWHxEnaJq0p1vVKkcKUeoSzJGNyIiSgYdHteUujsz1b/LZLggsnCmUzl9HKzNuJtSB1BpQKBzgPL0jOjIgkV1tc4MkJDctg5sFkfF0G22W7xvDmYfPTfXeol+3dJyyCJVg21fAhQFng71gCpZgpTyM3Q/Rg7toPCt2O9MEBg4hJMVEM4mJE94vGQ2JPhuU2dgBbbdjvbWRG5Agq/9KXTRUn9HmbcVucrVeSWXqywiKm+A== 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=QETj+gqf6A9AhlIgIKfWKYlRNP23U+E6LQOsGY1upGU=; b=gVeoyL5DrZTgPNTegrV3dO8l0xRe22/AjnE8GX0DevZw7E/mtArp1bcwPFlgvGYJlKrHnO+vS8UBPxtRUYhJKPQhSiF4R1XnZRRXFGQ60ODbgHS7MhT6rWVzL82Wl7YX2prWWUvDOiKbMmfusPIhZ78H/GmHqSbMFFIG9qCfOF5xSihKczUANBF2khyo7pRjWMP2hbDVQc9r+A7qV5gfo2rV3tO5lKA96PQ8F77lm2BTedu8YwvbMz2Q9QNi2eQwKbcP8e3F0wU+DSc9qYw9UuYFdlYSWRfPMc5N8azPPzJSKpAPzm/fk4X9X1T5MEqWoW2AvcKRemeAA4Gvg2XeFA== 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=QETj+gqf6A9AhlIgIKfWKYlRNP23U+E6LQOsGY1upGU=; b=JtD38zzC0e2CwDEYD8w1mwhu/i7G7EZ7C0bbCmiB3lo2SY2RCFDZf/+EeHGnP8AMDkHpIuRWQpdEl+u0PJRcteAoxN7xndbCc7dEFnHm2BiYFdL9eC6CDO6GIVrpS/nSA6KjQQx3w68qi/Xg2SLWvOUI/YLk/+agcT2nwZzKFio= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11) by VI1PR08MB3295.eurprd08.prod.outlook.com (2603:10a6:803:4a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23; Thu, 9 Jul 2020 13:00:31 +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 13:00:31 +0000 From: Phil Yang To: Olivier Matz CC: "dev@dpdk.org" , "stephen@networkplumber.org" , "david.marchand@redhat.com" , "drc@linux.vnet.ibm.com" , Honnappa Nagarahalli , Ruifeng Wang , nd Thread-Topic: [PATCH v3] mbuf: use C11 atomic built-ins for refcnt operations Thread-Index: AQHWVeC1ffllOV15oESYFT6vgODwWKj/Ml/Q Date: Thu, 9 Jul 2020 13:00:31 +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: <20200709110345.GR5869@platinum> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 46b981d1-d1d3-4bb8-8588-c7170743d960.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: e4f15604-d4b2-4a5f-7f67-08d8240814f2 x-ms-traffictypediagnostic: VI1PR08MB3295:|DB8PR08MB5164: 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-forefront-prvs: 04599F3534 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: xyyJoBVOFky3zabz/MdLw9kdbn032xrdRWtg/9NBDbhNwYRLlyY566Jzv1RWaxdBuDjzMJ92sRof4+tHe/Ns7HoQ1k04JJ9Gb6mkMgoJMZrlrnD4rON6NRrmeYOWClzAyoVuajlHXDUeccn/Qwc/HRuKSYqYkog4lw94bZhB72CZ6mGz84DHKmcNcMolH6SYxW9qX4VWGhpluhO/dub2s64JxF1yX1mNp9QcG0wz4OBUSK5KRBoyYI/BH6kyvirFjI3EtfDnVuHD8Q/9ua4gjr+PALcgKkOf/QP7TJ81StV/UQw0xUHsqPlfghbIDQljBfRPc6ddIQToMgjZbgtf0Q== 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)(366004)(346002)(376002)(396003)(39860400002)(136003)(66946007)(478600001)(64756008)(8936002)(66476007)(66556008)(6506007)(53546011)(316002)(66446008)(54906003)(7696005)(52536014)(33656002)(9686003)(55016002)(8676002)(6916009)(26005)(186003)(4326008)(83380400001)(5660300002)(2906002)(71200400001)(76116006)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: Cw05QSBOmMHyeXauXb0vHZl8bffzMid3FMOuR8zMDqmBsIYkJKSUHxyos046KiS41zZecBJDXWx3euXjrEqIPsm4rPH5NrqNc+lG0qhW5hXFW+/HsNj2wgVK7BIhCEqFlY1lt7kxLJN2/v1fztSR4wI5mNNsRlLBrfjdspJsjUK9LvbGZaMndiojMpNDYNU6BIuoj+nX3RnVEs9X9hnLM4bOREtqpO4nnXWHUHhA0pG9uziwhKp7txS6qfyzotUvW6Z2Dm+iBxDpL/Ii7GCoW0lMchWmAbWpH8cNRaBgUEOVrhGm1LMGEDEf5raUF19+gQnk/IqkXLT96tYBJda0aAR6i2CvAdQLXunM0m1ZTsI5vhfgCvyWTjysDi66BZbjTP0k7vs4iA71ATCgzLVAB8e/Oy2sWfFqxPV7Wm6IyEnCQW6ESkAZApBjhd3F0PPBtpwutmAMYBsnnS8hGJ82MNdyBm7j/cqTGlcsNPD6Vlc= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3295 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: VE1EUR03FT059.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)(396003)(346002)(376002)(39860400002)(136003)(46966005)(5660300002)(83380400001)(316002)(478600001)(8936002)(54906003)(82310400002)(81166007)(356005)(7696005)(86362001)(336012)(8676002)(47076004)(52536014)(82740400003)(33656002)(2906002)(4326008)(6862004)(53546011)(6506007)(9686003)(55016002)(186003)(70206006)(70586007)(26005); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 505a032b-6926-4455-f60c-08d824080fba X-Forefront-PRVS: 04599F3534 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tKtygsYH4BCd3sxqvzy2OOciscqt628b86NHmXxFIBMVnnbE2oLah9Qy9TzHfzc3iLj+w5qpXFNbc32NGh9lKR0yPjHkYaGBwhF5Exn9l/bNivhqasdojt48MQAtgBVmF+qjg2dV0GjyGrltSxlmKFWlbLBXs1GNVaokcymFufpGyqLmXI2xoFbQsXIRRreDLbT0Ajhm6ETkqgon+BA+TvLtHfykpW6oPfuoenH+R3IQ3PhzWZDH3tpis9OdADkEpxagvHIauK1u3oeXxef/Twe9Z3ex8mVB4kL496uzzHMr+vvGbcPHV8yH3jujbF1HMN2scxcSAqeo8CsoiVKqKuelmoHwfO12Nb7HydIJ5ZXqCCSqoXQGHw8s37UE46K+G1MAdFa66gw2k2hYtc5RpQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2020 13:00:40.1520 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4f15604-d4b2-4a5f-7f67-08d8240814f2 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: VE1EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5164 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 Oliver, > -----Original Message----- > From: Olivier Matz > Sent: Thursday, July 9, 2020 7:04 PM > To: Phil Yang > Cc: dev@dpdk.org; stephen@networkplumber.org; > david.marchand@redhat.com; drc@linux.vnet.ibm.com; Honnappa > Nagarahalli ; Ruifeng Wang > ; nd > Subject: Re: [PATCH v3] mbuf: use C11 atomic built-ins for refcnt operati= ons >=20 > Hi Phil, >=20 > 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 = */ > > }; >=20 > 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: >=20 > union { > rte_atomic16_t refcnt_atomic; > uint16_t refcnt; > }; >=20 > I hope the ABI checker won't complain. >=20 > 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. Got it. I agree with you. It should work. In my local test machine, the ABI checker happy with this a= pproach.=20 Once the test is done, I will upstream the new patch. Appreciate your comments. Thanks, Phil