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 45EECA0350; Mon, 29 Jun 2020 07:39:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D5DCA1B952; Mon, 29 Jun 2020 07:39:07 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2079.outbound.protection.outlook.com [40.107.20.79]) by dpdk.org (Postfix) with ESMTP id 6242B2C2B for ; Mon, 29 Jun 2020 07:39:06 +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=guUZqMQbvjpfyPeCU4rQDyQe3sNwx7qKWfuVm64+1mw=; b=vez0MJovbAdsP/3lF3ICx5Oy5i42mja5flDl+a95H3Gqt3g75MaTZVxIiyZ0wOhsPdXCHsggahqEF6N4ja3n1Eil3ABoFpwqszHWqNU1ZGWvaBwsNW5c3874CFkesL9yyjXE14IyU+KCEoDAu2DhVOuEDeYPOio8blJyOybvsXQ= Received: from DB6PR0501CA0024.eurprd05.prod.outlook.com (2603:10a6:4:8f::34) by VI1PR08MB4368.eurprd08.prod.outlook.com (2603:10a6:803:fe::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Mon, 29 Jun 2020 05:39:03 +0000 Received: from DB5EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:8f:cafe::8) by DB6PR0501CA0024.outlook.office365.com (2603:10a6:4:8f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Mon, 29 Jun 2020 05:39:03 +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 DB5EUR03FT021.mail.protection.outlook.com (10.152.20.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.20 via Frontend Transport; Mon, 29 Jun 2020 05:39:03 +0000 Received: ("Tessian outbound cea5956745d7:v60"); Mon, 29 Jun 2020 05:39:03 +0000 X-CR-MTA-TID: 64aa7808 Received: from 95ce9c2a44ef.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 30373274-D720-456B-BD0F-5ADE926516FA.1; Mon, 29 Jun 2020 05:38:58 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 95ce9c2a44ef.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 29 Jun 2020 05:38:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IcdMzgkgyTz1S0EgJMQljjYs67bo3l/c6JqzJQKKimhv33yRTJ73RnqpuEIEr+w6VggUyOT893wwz/FuKKQJnM/YKXdmO1dhBcNATQ8rG2R3y3t7AQ0U0Cbts+UeAH6iTbpAiIVADyFEkCTZ+N6ZpVvnz51jI/7DFC5htF5GS7ZvZY4k9nffVVPrU9hz+uJCvEZWCrbq12uwZrHyjWhwyhN80EHeV8QSW/RhGmosESXNSHo81+w3/NSh81apymJ9+vq39we4l7+jnThKN7/P/q9buXnYkMstNVTn3m5COPZUjEdUVL7DtGficOQNCm8ZwwBObpRpeoDcVqyY6FXx6g== 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=guUZqMQbvjpfyPeCU4rQDyQe3sNwx7qKWfuVm64+1mw=; b=E5DWakmXseZbv+QhKVbJ1iGfZ6Op/XFLw56WoJJ0BP1/burqk+ZsAiX/rcFYoPqkF8WAP9wRUP8ylMTYi9XskikYSM9uhlVl0m/qoXFCK0R5bDK45+XN7vcpubC1mrNgyMDYt/4SQGa1J1wULy1ycVjbYRE/QVH3sggNveA7iPvSM0/8D49nhorTW0K31l9xItXDgqtwje6e70gwuVnHDACRPjg8B5qY65TI79vnejp5slmsjgMeux5lkT51Bt5Bc1LDAfAlvxdOhAZZ4hpg+wBk3s+fNpoDUF43MuqLCIWHBB2xMHVdZys90IpxUD8DOsz6us304ezUYRlPHyAqmA== 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=guUZqMQbvjpfyPeCU4rQDyQe3sNwx7qKWfuVm64+1mw=; b=vez0MJovbAdsP/3lF3ICx5Oy5i42mja5flDl+a95H3Gqt3g75MaTZVxIiyZ0wOhsPdXCHsggahqEF6N4ja3n1Eil3ABoFpwqszHWqNU1ZGWvaBwsNW5c3874CFkesL9yyjXE14IyU+KCEoDAu2DhVOuEDeYPOio8blJyOybvsXQ= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11) by VI1PR0802MB2285.eurprd08.prod.outlook.com (2603:10a6:800:a5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.23; Mon, 29 Jun 2020 05:38:54 +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.3131.026; Mon, 29 Jun 2020 05:38:54 +0000 From: Phil Yang To: Honnappa Nagarahalli , "dev@dpdk.org" CC: "mattias.ronnblom@ericsson.com" , "mb@smartsharesystems.com" , "stephen@networkplumber.org" , "thomas@monjalon.net" , "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" , "harry.van.haaren@intel.com" , "erik.g.carrillo@intel.com" , "drc@linux.vnet.ibm.com" , "david.marchand@redhat.com" , "zhaoyan.chen@intel.com" , Ola Liljedahl , Ruifeng Wang , nd , nd Thread-Topic: [PATCH v5 3/4] devtools: prevent use of rte atomic APIs in future patches Thread-Index: AQHWMzxkyHcrVXmuZ0Ov/UcsxewOH6jvN70AgAAQsJA= Date: Mon, 29 Jun 2020 05:38:54 +0000 Message-ID: References: <1589270586-4480-1-git-send-email-phil.yang@arm.com> <1590483667-10318-1-git-send-email-phil.yang@arm.com> <1590483667-10318-4-git-send-email-phil.yang@arm.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: eb16dede-8e89-4a67-b159-d193a6ba620e.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: [203.126.0.113] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d22cf520-9c78-4128-a2b2-08d81beebb78 x-ms-traffictypediagnostic: VI1PR0802MB2285:|VI1PR08MB4368: 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:9508;OLM:9508; x-forefront-prvs: 044968D9E1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: m82jZlu88u9mvZ221OUNsSUDtSyBnjg8a7ZiNZjci6pjNmx+NP4lz5crWIcab6bLQW3LJAQIUQK38iyMozGchDKbFr6LrtOJWoGfKgH7689rip3ecTCwcOz79hlqiGKg0QF6MvHAjYPXe5PPQ7/WXFqSE9IODBlkDKSTAxTqcHyZsKgGYlhBBnbJmTCNvBSXEkOx6c83GZ2BpafgsDdDc9lbaPMMiBLhn2Rpy6Tfs47Rdya1UfFqoR+Rf7Ei6+OKsXVeAfYuXUXzdrPhjNr7955c0US4BcwTD6Vv6/DMxcH+NbcmZJ70/lqMX+ZXfGPeQKc8lysE/GFiL9g9Rq0RgSIBX9fEKPNH8mjJy/S70j/CtboJhm02hnPwLh+6P8Rd 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)(376002)(346002)(136003)(39850400004)(396003)(76116006)(9686003)(478600001)(53546011)(2906002)(6506007)(4326008)(83380400001)(66476007)(186003)(66556008)(64756008)(66946007)(71200400001)(55016002)(66446008)(33656002)(110136005)(54906003)(8676002)(26005)(86362001)(316002)(7416002)(52536014)(5660300002)(7696005)(8936002)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: pLKq+At2PJ0wdXfY8y8s9vgPEToVOZo0/B4J/R6NKp5VIbZVC85K14mjtLO4x3o5OaYhVvD0pvcbhz9klye30k1t6U3D6EsqRWxmdzeYC8QrG2xfsGQdrFAhKWcIxN4Wutqjuk6/Zy/aPKs6tI9SYxANyJzXcKoHxd54vvlxAT3PLU0pTJTpk50zANmg1TH6lpXghKOK50adjm6/y4zqwYRX97urF23bKOEneGNKNeKNFi6ry4X+lndP8EcBAA9fkPLmvWtpf42geJHp+dANmFJlyBH+oMPGVcjj+yB9+22cJEdQHad9mBh/qFvm2fbF6k6qzKacatpwVxiby6imTnUdOj8kzreOxNK9jFCoJDB45dWiV+01BMBIQtzzCx7eaKeXtYDCCBEVPqTyPwb7XSaE8+LffZus8quSKm2vf0BMfOMZqKeyeyBt5dz2YVO0+l1opOYnBSG6a8VetuRrnmMG65LLDBqp5il8zk9GCs8= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2285 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: DB5EUR03FT021.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)(376002)(346002)(39850400004)(136003)(46966005)(52536014)(86362001)(55016002)(336012)(83380400001)(110136005)(316002)(53546011)(54906003)(478600001)(6506007)(7696005)(9686003)(5660300002)(33656002)(186003)(82310400002)(81166007)(26005)(356005)(8936002)(2906002)(82740400003)(8676002)(47076004)(4326008)(70206006)(70586007)(21314003); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 959d9348-5726-4f06-b7a0-08d81beeb63c X-Forefront-PRVS: 044968D9E1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yQqPJIgE8DG7Vh/fd6tsoiF7Sw6lKu/jV7744XPye23bjZTLxS41msEpgudGOFpXZ62eXE3AaPV1bpHyzlGLQwOL4p96T0jvqNJ7O1TaRy17e27z51pZ3wpS2rjprnrl/tU+u0yaLLaEgDHZyZmXFhOU1V4lTAMVvSJrt+EQQsFkoUxHqmzYnb8wgNXwt3OPqHhXSpN/rKmpbCmwuKYG18LnPm4wj2xcIOXfo06z/Yy+TtKT9KS117FXRNYcsmBVWRqE3t7by0sUWYk5kq70a97b4ltlgCLYYTuoGkDZBCscWYXyFA8jUoGPkkCOgtt0UlwzJAtA2e+SUVwX6CFFpjlA9QeugVOcMwd5eZMEQkWvlfbNkgflrUJf6KEq7PqoKPzKFth1x7dXZuzaBeFz7d6KLyWr0VeQU0LXzsHGevM= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2020 05:39:03.4276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d22cf520-9c78-4128-a2b2-08d81beebb78 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: DB5EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4368 Subject: Re: [dpdk-dev] [PATCH v5 3/4] devtools: prevent use of rte atomic APIs in future patches 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: Honnappa Nagarahalli > Sent: Monday, June 29, 2020 12:38 PM > To: Phil Yang ; dev@dpdk.org > Cc: mattias.ronnblom@ericsson.com; mb@smartsharesystems.com; > stephen@networkplumber.org; thomas@monjalon.net; > 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; harry.van.haaren@intel.com; > erik.g.carrillo@intel.com; drc@linux.vnet.ibm.com; > david.marchand@redhat.com; zhaoyan.chen@intel.com; Ola Liljedahl > ; Ruifeng Wang ; Phil > Yang ; nd ; Honnappa Nagarahalli > ; nd > Subject: RE: [PATCH v5 3/4] devtools: prevent use of rte atomic APIs in f= uture > patches >=20 > >=20 > > Subject: [PATCH v5 3/4] devtools: prevent use of rte atomic APIs in fut= ure > > patches > > > > In order to deprecate the rte_atomic APIs, prevent the patches from usi= ng > > rte_atomic APIs in the converted modules and compilers __sync built-ins= in > > all modules. > > > > The converted modules: > > lib/librte_distributor > > lib/librte_hash > > lib/librte_kni > > lib/librte_lpm > > lib/librte_rcu > > lib/librte_ring > > lib/librte_stack > > lib/librte_vhost > > lib/librte_timer > > lib/librte_ipsec > > drivers/event/octeontx > > drivers/event/octeontx2 > > drivers/event/opdl > > drivers/net/bnx2x > > drivers/net/hinic > > drivers/net/hns3 > > drivers/net/memif > > drivers/net/thunderx > > drivers/net/virtio > > examples/l2fwd-event > > > > On x86 the __atomic_thread_fence(__ATOMIC_SEQ_CST) is quite > expensive > > for SMP case. Flag the new code which use SEQ_CST memory ordering in > > __atomic_thread_fence API. > > > > Signed-off-by: Phil Yang > > Reviewed-by: Ruifeng Wang > > Reviewed-by: Honnappa Nagarahalli > > --- > > devtools/checkpatches.sh | 32 ++++++++++++++++++++++++++++++++ > > 1 file changed, 32 insertions(+) > > > > diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index > > 158087f..5983f05 100755 > > --- a/devtools/checkpatches.sh > > +++ b/devtools/checkpatches.sh > > @@ -69,6 +69,38 @@ check_forbidden_additions() { # > > -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ > > "$1" || res=3D1 > > > > + # refrain from new additions of 16/32/64 bits rte_atomic_xxx() > > + # multiple folders and expressions are separated by spaces > > + awk -v FOLDERS=3D"lib/librte_distributor lib/librte_hash lib/librte_k= ni > > + lib/librte_lpm lib/librte_rcu lib/librte_ring > > + lib/librte_stack lib/librte_vhost > > drivers/event/octeontx > > + drivers/event/octeontx2 drivers/event/opdl > > + drivers/net/bnx2x drivers/net/hinic drivers/net/hns3 > > + drivers/net/memif drivers/net/thunderx > > + drivers/net/virtio examples/l2fwd-event" \ > > + -v EXPRESSIONS=3D"rte_atomic[0-9][0-9]_.*\\\(" \ > > + -v RET_ON_FAIL=3D1 \ > > + -v MESSAGE=3D'Use of rte_atomicNN_xxx APIs not allowed, > use > > __atomic_xxx APIs' \ > > + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ > > + "$1" || res=3D1 > > + > > + # refrain from using compiler __sync built-ins > > + awk -v FOLDERS=3D"lib drivers app examples" \ > > + -v EXPRESSIONS=3D"__sync_.*\\\(" \ > > + -v RET_ON_FAIL=3D1 \ > > + -v MESSAGE=3D'Use of __sync_xxx built-ins not allowed, use > > __atomic_xxx APIs' \ > > + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ > > + "$1" || res=3D1 > Can you please add rte_smp_*mb as well? Sure. Will do. Thanks, Phil >=20 > > + > > + # refrain from using compiler > > __atomic_thread_fence(__ATOMIC_SEQ_CST) > > + # It should be avoided on x86 for SMP case. > > + awk -v FOLDERS=3D"lib drivers app examples" \ > > + -v > > EXPRESSIONS=3D"__atomic_thread_fence\\\(__ATOMIC_SEQ_CST" \ > > + -v RET_ON_FAIL=3D1 \ > > + -v MESSAGE=3D'Use of __atomic_thread_fence with SEQ_CST > > ordering is not allowed, use rte_atomic_thread_fence' \ > > + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ > > + "$1" || res=3D1 > > + > > # svg figures must be included with wildcard extension > > # because of png conversion for pdf docs > > awk -v FOLDERS=3D'doc' \ > > -- > > 2.7.4