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 39BBDA00BE; Wed, 8 Jul 2020 06:48:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3483C1DE50; Wed, 8 Jul 2020 06:48:49 +0200 (CEST) Received: from FRA01-PR2-obe.outbound.protection.outlook.com (mail-eopbgr120084.outbound.protection.outlook.com [40.107.12.84]) by dpdk.org (Postfix) with ESMTP id 5FFA51D8EA for ; Wed, 8 Jul 2020 06:48:47 +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=OP3R53szZ2VkGuI1yn774If6e2dC7su1hxomW0y8U2M=; b=X504jyUE9zAqIorekfRJiegaCRSOOjmlrepnCGC5PWIy1tzdyb5pFauTRyFPXeUpTBCRirVOIxUEqL++KWKsqjl5DQRtr9Pq8ulhynfq+Z6+4emkan/3eKzp+/2IRFBimudN9gz8hzGb/HHtsoXzOffmmLO5t4HI88OE+mT04NY= Received: from MR2P264CA0038.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500::26) by PR2PR08MB4681.eurprd08.prod.outlook.com (2603:10a6:101:20::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24; Wed, 8 Jul 2020 04:48:43 +0000 Received: from VE1EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:0:cafe::49) by MR2P264CA0038.outlook.office365.com (2603:10a6:500::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Wed, 8 Jul 2020 04:48:43 +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 VE1EUR03FT022.mail.protection.outlook.com (10.152.18.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Wed, 8 Jul 2020 04:48:43 +0000 Received: ("Tessian outbound f7489b7e84a7:v62"); Wed, 08 Jul 2020 04:48:42 +0000 X-CR-MTA-TID: 64aa7808 Received: from c7c7d7ddb883.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BE236E70-D3EA-4D38-953F-E6404BECD326.1; Wed, 08 Jul 2020 04:48:37 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c7c7d7ddb883.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 08 Jul 2020 04:48:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IsHSFVOgStolnVWbRn3iuABhKYJ5OYeVnUYAFdWKyMEGY2lTH1wZ/jsHFG9MSXqA77Q1Sh8s+454YcoYe6d3E7KOU+sqjI1uH3BAAx29P3Z9Dm42LSuadDmDM1ssjipwyoN51Y9C/1OSGaRH/LcGPWD51rKLfWz2CJTUnnIoM/OY0UnypV4sI+1rFT9jI9ONO3lbzAJF6pqxmmhPhqIKfFwHa1EjOJGjOvL8b+G/7BwB9UxHgACIryQ4FZqO36yRvnoO/vchTT5Lqlzc1nlldy9aVxJQuvNMz7/BW1vLuou0fVgHcIDQWvKxIow34bMk3OpEuTL5iCSlNmpDlim7Ww== 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=OP3R53szZ2VkGuI1yn774If6e2dC7su1hxomW0y8U2M=; b=n875yHUWuJmqa9dHJxdWOCEWkmNvajV5RtnRAXMiSnGR7uNlFn0vH5tpsidM+7E6ffG8G8Ysei3gH5wmo4I0R+zOFPxY+YitwGqhRepi+X4+5urmaMcjYm5b3Aum5Wv8bZs77th8Ku6rWnqAAi7uD/oxg7YrJ+5IEz3/gMfhM4xIiyRk+N0p7gX6h9ZsXg5ySG6aCgXUfTpF/5dMtNAyP5p7fPHcHU+iESzqdb1hMw1rDqz7EjELHvD1P0bs3dkO1g34mQP+0uPwMFp5enzftr1pbK1qxrBBOFjf3iuJY4qSoL3qn4tkqZmdOZYbWkoXDTgsQ+O5O3fPLhz2qLSakA== 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=OP3R53szZ2VkGuI1yn774If6e2dC7su1hxomW0y8U2M=; b=X504jyUE9zAqIorekfRJiegaCRSOOjmlrepnCGC5PWIy1tzdyb5pFauTRyFPXeUpTBCRirVOIxUEqL++KWKsqjl5DQRtr9Pq8ulhynfq+Z6+4emkan/3eKzp+/2IRFBimudN9gz8hzGb/HHtsoXzOffmmLO5t4HI88OE+mT04NY= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11) by VI1PR08MB2784.eurprd08.prod.outlook.com (2603:10a6:802:25::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Wed, 8 Jul 2020 04:48:34 +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.3153.029; Wed, 8 Jul 2020 04:48:34 +0000 From: Phil Yang To: Stephen Hemminger CC: "david.marchand@redhat.com" , "dev@dpdk.org" , "drc@linux.vnet.ibm.com" , Honnappa Nagarahalli , "olivier.matz@6wind.com" , Ruifeng Wang , nd Thread-Topic: [dpdk-dev] [PATCH v2] mbuf: use C11 atomics for refcnt operations Thread-Index: AQHWVEbwX0ZZhWoutEejPVv4HOUHjKj8Wz4AgAC86dA= Date: Wed, 8 Jul 2020 04:48:33 +0000 Message-ID: References: <1591871178-12542-1-git-send-email-phil.yang@arm.com> <1594116633-14554-1-git-send-email-phil.yang@arm.com> <20200707101314.42df824c@hermes.lan> In-Reply-To: <20200707101314.42df824c@hermes.lan> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 1920a578-fd00-4226-b2be-5319e9e1cb47.0 x-checkrecipientchecked: true Authentication-Results-Original: networkplumber.org; dkim=none (message not signed) header.d=none;networkplumber.org; dmarc=none action=none header.from=arm.com; x-originating-ip: [203.126.0.113] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c0d3bd01-9807-429d-b73e-08d822fa3115 x-ms-traffictypediagnostic: VI1PR08MB2784:|PR2PR08MB4681: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:2512;OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: IQd8p+4yjVxW7LClfyeOn9QFYzvvaDTigpEuuysYK0VydiNUUwPYhRsAySzoUHJ6O3mUwFGzUA5rKv8g1qAeXUtEiR6Kqu32FGwKOOBh4WGLY+JO2sW8y/A7mBvV5o/00wCa+/ZK7tSdNsaLkEMoCitGFY+cfMrY/6GabRp6OYaFemLlxeUQESN3IRsVn9NT1vjMtKR8dX/Bsg2ByZIjx4YG0yTebAwHJo0THSnQs/15SUOF9liW3MTk++Ccuid2gbrot3ATL4n0Kk7Qru3NxRDHypmDGMCWcYIRSttxy786+vIhUAzQXwjU14cYAGYiC0oOPrKohzO+p4KyEYCZZA== 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)(136003)(376002)(39850400004)(346002)(396003)(33656002)(8676002)(6506007)(53546011)(26005)(71200400001)(83380400001)(4744005)(52536014)(66446008)(66946007)(64756008)(66556008)(66476007)(5660300002)(76116006)(86362001)(2906002)(9686003)(55016002)(478600001)(186003)(8936002)(7696005)(316002)(4326008)(6916009)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: MI0fF9DzdqT+G+uSLfngzFH7eU3Oz79zPXs/8ErJqqY4lNwl54vIFlmeLQD0JRe8KSPSD30pywUSkBTk47I0dKBpIRtDEK/kD9m8oCEkwJTOk0uwxWJ3jhyd+v1144tjhVf70kKxtDwO8Mw+pWrIc7mw3PD3mzDW5oRdJZ/oFFBg0fQ1tirrgUgzkAY/BREMYtlpdv4ozD0KjIC8WH+JEaQRWQa3R4OIEtX47e2+ucwbuamWp19oW4phsIUWyE+Cb1XrrLRvqQaBusPHQGTYd0gWzsQQmRYWHP2XcBkqu8uuAN2+qdFrjLx4xfcVAEpZADFzKWtR9iNZtkWkVyT7LeuyyUdXXtieKm/bN44sSPM6V78XfWNLItKON6V51ZIU2XgnHvWyq+FhCiB+knsRudNGs7StCfJRzDlRfvFnwrZesIZBg0oA7FsVe6ktzm7zYPXxaDq2ddJ05xZkAQKX7CuAE00/kQHgtxrTM+pv+i4= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2784 Original-Authentication-Results: networkplumber.org; dkim=none (message not signed) header.d=none; networkplumber.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT022.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)(136003)(346002)(376002)(39850400004)(46966005)(53546011)(86362001)(6862004)(5660300002)(9686003)(6506007)(2906002)(186003)(81166007)(54906003)(356005)(82740400003)(8936002)(70586007)(316002)(8676002)(36906005)(83380400001)(26005)(82310400002)(4326008)(7696005)(33656002)(55016002)(47076004)(52536014)(336012)(70206006)(478600001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 0efe9ffb-487f-4ac7-86e5-08d822fa2b86 X-Forefront-PRVS: 04583CED1A X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PYNYhy4Q3HK21yT2uaPdV4QqSnmnhiLt4I/OTcQdhsTtYE5311QxZDnv7HwHLVELhKXarHX5reSXrv5oDk6n/fdQKKWvo8lPoqYP+tNaFzVib7561hPm3mZeqHVUZpn9MVb/to1twEqWwqFPlkUC3POIlFigxig41kQVB7/GefYh8Jfk6AUUpT6xlCHQMVOiUeki0ySHzIh+tnH8l7myLl5azx2UFwXqONvUXGC0y3zn+5cPZ/HIuNKOL2/j54XqLzq4cUUum7YQB7PjDcpdFkjyCQod4sUCun4Y61uqMoGwEwFrnUGbzm+g6gcyPJdF8BwsunXfg5cvIhqPQ1tVcs+hpuAvwXGsywQF+Za400rg3XQ1fbpZfvxdC8WmdLMrWK+Pvx10usgcEkgw8toFmw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2020 04:48:43.2510 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c0d3bd01-9807-429d-b73e-08d822fa3115 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: VE1EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4681 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: Stephen Hemminger > Sent: Wednesday, July 8, 2020 1:13 AM > To: Phil Yang > Cc: david.marchand@redhat.com; dev@dpdk.org; drc@linux.vnet.ibm.com; > Honnappa Nagarahalli ; > olivier.matz@6wind.com; Ruifeng Wang ; nd > > Subject: Re: [dpdk-dev] [PATCH v2] mbuf: use C11 atomics for refcnt > operations >=20 > On Tue, 7 Jul 2020 18:10:33 +0800 > Phil Yang wrote: >=20 > > + return (uint16_t)(__atomic_add_fetch((int16_t *)&shinfo- > >refcnt_atomic, > > + >=20 > Why do you need so many casts here? > The type of refcnt_atomic is now uint16 after your patch. In the existing code, the input parameter type for this API is signed integ= er. For example: drivers/net/netvsc/hn_rxtx.c:531 lib/librte_mbuf/rte_mbuf.h:1194 However, the output type of rte_mbuf_ext_refcnt related APIs is not uniform= . We use these typecast to consistent with the current API definition.