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 EE783A034F; Tue, 12 May 2020 21:24:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 62E001BF89; Tue, 12 May 2020 21:24:15 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140047.outbound.protection.outlook.com [40.107.14.47]) by dpdk.org (Postfix) with ESMTP id 6A44F1BF81 for ; Tue, 12 May 2020 21:24:14 +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=uzSNIK9gE7MjIMvjO/RRXsmatvaVQnT6WML1AoItHTE=; b=pd1CYuch+EHowpSU8BmdbFYPdZaEXIFM7uvXCsUENsmUhKrnL3lOtwnHKyuzrAT0Fvf6PMTIydPmE4DFt5RQKq4PnRPFWIK/bk9Wcmf4XUg13STMzV56N3N2OC9gywo/gpHQEmiAPi/93Sx2wa64GyG/uPGMAVLUxYuvy4pWrAs= Received: from AM6P193CA0061.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::38) by AM0PR08MB4529.eurprd08.prod.outlook.com (2603:10a6:208:148::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Tue, 12 May 2020 19:24:11 +0000 Received: from AM5EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8e:cafe::82) by AM6P193CA0061.outlook.office365.com (2603:10a6:209:8e::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 19:24:11 +0000 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 AM5EUR03FT029.mail.protection.outlook.com (10.152.16.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 19:24:11 +0000 Received: ("Tessian outbound fb9de21a7e90:v54"); Tue, 12 May 2020 19:24:10 +0000 X-CR-MTA-TID: 64aa7808 Received: from e97181fc78c1.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3CE940A6-49C6-4CCE-B7DA-470BDB9896FB.1; Tue, 12 May 2020 19:24:05 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e97181fc78c1.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 19:24:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yetn3ZbFovuDmmrZdeuc+KCmRoiYEo7wSx2b2tej1YhMYFhkBmxYmPwpQIsuusxSUXpQkMKqWgz5bH9Ccuw9KicEWic9r3a4j2erED1ko4PxoeG4VrKH5LSiCL3eFQXoTtIQzlFUIlQq1IMtK2MHRUTXL6fWEZDl7tXspAy2jb0ZmQChFqR9kEsV0GND88aaO3/N3M/jpW7d6+YPd4ewKCCPWNg7XbyyNPHzI/h1CRvj/1q1uec7Ys829Va45DSxRFJMYLARzIs6yQMauAjEWSkibzYpiNkG9VYY6456iXgo9jJMi8FmcUf1/agXgx+XbptN42Fqj9xcV9WF52PgoA== 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=uzSNIK9gE7MjIMvjO/RRXsmatvaVQnT6WML1AoItHTE=; b=i0CWjYytTw2tiK0n5XMim6gcwJhuTTco5t98Uio8pjoXPkYy3wQHbK1bytGFvfG9Kp6Udxs9qI8wtV4wy4LaSWoPIR891JVVlHc4H2yOb+6U6WriS3b+6aG++Wm6a+5OvbzpDdXNTFJhi/6WNp7nZPMiUrGNumXe+8uDcQnjfvqkWd3FzeeGu2EWF63gImiSVnnGiSM3thM/9HCLPhDqKIPZURTlyA0l8lUpqziyHKWuTBpLEX/0lAgsTYiwG90Tbq87g3ztpNekPbhuiwylNC/F6NOH4owARFvshXzZKAM3bjPnUYMfjWLgjwQ2gM/6KORJvy6PdtBfgoEVqqh8rA== 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=uzSNIK9gE7MjIMvjO/RRXsmatvaVQnT6WML1AoItHTE=; b=pd1CYuch+EHowpSU8BmdbFYPdZaEXIFM7uvXCsUENsmUhKrnL3lOtwnHKyuzrAT0Fvf6PMTIydPmE4DFt5RQKq4PnRPFWIK/bk9Wcmf4XUg13STMzV56N3N2OC9gywo/gpHQEmiAPi/93Sx2wa64GyG/uPGMAVLUxYuvy4pWrAs= Received: from DBBPR08MB4646.eurprd08.prod.outlook.com (2603:10a6:10:f5::16) by DBBPR08MB4393.eurprd08.prod.outlook.com (2603:10a6:10:c7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27; Tue, 12 May 2020 19:23:59 +0000 Received: from DBBPR08MB4646.eurprd08.prod.outlook.com ([fe80::1870:afc4:b90f:609d]) by DBBPR08MB4646.eurprd08.prod.outlook.com ([fe80::1870:afc4:b90f:609d%5]) with mapi id 15.20.3000.016; Tue, 12 May 2020 19:23:58 +0000 From: Honnappa Nagarahalli To: Stephen Hemminger , Phil Yang CC: "thomas@monjalon.net" , "dev@dpdk.org" , "bruce.richardson@intel.com" , "ferruh.yigit@intel.com" , "hemant.agrawal@nxp.com" , "jerinj@marvell.com" , "ktraynor@redhat.com" , "konstantin.ananyev@intel.com" , "maxime.coquelin@redhat.com" , "olivier.matz@6wind.com" , "mb@smartsharesystems.com" , "mattias.ronnblom@ericsson.com" , "harry.van.haaren@intel.com" , "erik.g.carrillo@intel.com" , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v4 4/4] eal/atomic: add wrapper for c11 atomics Thread-Index: AQHWKDQVYr2/oTFRrka2a/dKKmKOWKikw4QAgAAM+EA= Date: Tue, 12 May 2020 19:23:58 +0000 Message-ID: References: <1584407863-774-1-git-send-email-phil.yang@arm.com> <1589270586-4480-1-git-send-email-phil.yang@arm.com> <1589270586-4480-5-git-send-email-phil.yang@arm.com> <1589307606.25513.1@networkplumber.org> In-Reply-To: <1589307606.25513.1@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: a887229b-9f1a-44a2-beed-24f73ca0d86b.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: [70.113.25.165] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 99ebb9e7-1824-4c8e-8f84-08d7f6aa0c9f x-ms-traffictypediagnostic: DBBPR08MB4393:|DBBPR08MB4393:|AM0PR08MB4529: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:7691;OLM:7691; x-forefront-prvs: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Ug9MRlGlankOlYepGOnSVYBi7Iq2ze6QtKiWt9PvBuubqm+xAuBC8CKpYfdG9Eh02l2DwdAXFW/Xutlz1Kc3/kJOM0cnl3FRFs5RY0dKmqaOPjo6BBmGOTuAwqvO49YQ/5qOthr30fzwR7I5D1oUdXJb7ih9GKGGA2D7NVGZdpueXzNYo/SRf64dCPpFjKtS5ePC4W16oI7Hq7TEXXPpVWs3abnYEbQjg0wyj/8R35zvdIz9qxbZXDe4gTosC1ZE28hQ+z8tYtaSVSabqtehXrTMvi7+D7NgxcR/U9ftjEMYZClfo41hy1flLQwKHBS5uZFHglMThMj77V4f8zH6oagQZO6CykdYw+E4wXLwrDmMQa6wPzNe/yCK5oAPWKM9rXwQARMdU4+RKL46NDY7ufC3JB6xmC99+pjT86NaXfTpxXvLmEM7oktjztZ16D4BI+Rfh7SSRt5bQSUW4SERsVHtjk2UGq+1KpTvWTUsvRLyg1rBeZqxH7QhMa406OqZXciJI77XCoIqp5Ei6Ms0d3NSCNX2lOHYlZtxoiT6laNy8k/dF/nukrkIPw5D8Plp X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR08MB4646.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(346002)(396003)(366004)(376002)(136003)(33430700001)(8936002)(86362001)(478600001)(6506007)(26005)(186003)(33440700001)(110136005)(7416002)(54906003)(2906002)(316002)(64756008)(66476007)(6636002)(8676002)(66446008)(66556008)(52536014)(66946007)(33656002)(53546011)(4744005)(55016002)(9686003)(76116006)(5660300002)(7696005)(71200400001)(4326008)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: WdzAAKpyvLb+PfIiI0+DqnG32vnxaTleQ9sgJ9GWhW/F/xpkDQl/AxfZrebzD1iIdv7olR8Pei3vY2T5MuYBxEvL2u0dy4eZsvBG3zkOPcFBAcWEw2pvgFnQii4nyLUEqhNJXfrBvb0F7nhdl2bbitruq2+Qf9ZN8Xr46Dhx7tRl9xd2G7IPfEXFh8IPvs3arYdUZ6VKllrJPMKpmtSCN98HNus1Ny9CedZiivLebeD6maU45px1rDmQln/psjpAeZhRFH4Ws4DHcumEs3dX8iDlE4wgPYN82RAivMMMSZyPL4cHaE2RsLMZWUZolsZ+UeXZ4KudTiyGnUYRoIm09rG5dpb6yQyoiOOthUJRHjwxESDU4dg3mYKL8+r2w/jbySoLPKGk2nyJcf7Hen0l9o4NeBpS6Dc7qoEgGbKmlCNRQl2iJ/BV+C2Uz1Ubr8pOSS99pRsdMIZNF7eOPyMrak/d0vSs+1aeEzR8Cq2SU6FF6bFizBEnA4W8+TE5FbhM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4393 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: AM5EUR03FT029.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)(376002)(346002)(396003)(39860400002)(46966005)(33430700001)(26005)(55016002)(9686003)(6506007)(4744005)(316002)(8936002)(5660300002)(54906003)(8676002)(478600001)(186003)(110136005)(52536014)(7696005)(4326008)(336012)(2906002)(33440700001)(81166007)(33656002)(70586007)(36906005)(6636002)(70206006)(86362001)(356005)(82310400002)(82740400003)(47076004)(21314003); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 917c5f74-7523-425a-8789-08d7f6aa053f X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eQMcr21ktqxESmjy2eciuDHuxWiufQeB3vVtXHqk1yj59OMfhy4dSI7EO/AXH5fCnWABTP+67xZdyWIw9p3u31rpiTfaDa6abw8AipPAWHMRa7nnH94+l4ZizW4pZX1Xu43JAdu8eOCMIHPsUyFqWET4BQ6kpS8cJGF0jYl9Gbub77b9CuRQhK3VB5z6feyf6Rlq0wBZ+dI7aaX8TkjZ4GhrwP89J6TCkC+Y3NHZS39awvptq3JRIZ1XmUxfGw+e+80padcXeKIdByW7qPiF9zkDS3paBCkVEBcqmSlt1/nlXeo2aqtqsPMIkU0HfZpC2OYN9nOvwucYXJcHO/xVRX5QkkanczDa1Vhq6vk7sMoWM/TjjRRqsJ1jSGQebPj1+wV07Ixx5rjirsADI/KI5zHkUHU3w8gF4AKzcbm3sjykZM2pbUyyn3zdRikmGEE3XbW/hrKvsYq2ByrWccynz2z7QE5QXVMmCS7OTjHuKZ10i22L019haKSTYtEesRbsAVI6RYajppIDQrqIomw/kUuJ/YOvZYI/6e6D3CQZHRtrsSNjVJSYKMXlOBGvuJb9SI5UvpeVHV6OQne1K5NXXTKrFCNj6zWYg+vH+kowS9M= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 19:24:11.1941 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99ebb9e7-1824-4c8e-8f84-08d7f6aa0c9f 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4529 Subject: Re: [dpdk-dev] [PATCH v4 4/4] eal/atomic: add wrapper for c11 atomics 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" Subject: Re: [PATCH v4 4/4] eal/atomic: add wrapper for c11 atomics On Tue, May 12, 2020 at 4:03 pm, Phil Yang wrote= : parameter. Signed-off-by: Phil Yang What is the purpose of having rte_atomic at all? Is this level of indirection really helping?=A0 [HONNAPPA] (not sure why this email has html format, converted to text form= at) I believe you meant, why not use the __atomic_xxx built-ins directly? The o= nly reason for now is handling of __atomic_thread_fence(__ATOMIC_SEQ_CST) f= or x86. This is equivalent to rte_smp_mb which has an optimized implementat= ion for x86. According to Konstantin, the compiler does not generate optima= l code. Wrapping that built-in alone is going to be confusing. The wrappers also allow us to have our own implementation using inline asse= mbly for compilers versions that do not support C11 atomic built-ins. But, = I do not know if there is a need to support those versions.