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 C920DA0350; Mon, 29 Jun 2020 06:38:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 151331B13C; Mon, 29 Jun 2020 06:38:31 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80054.outbound.protection.outlook.com [40.107.8.54]) by dpdk.org (Postfix) with ESMTP id 9493D1150 for ; Mon, 29 Jun 2020 06:38:29 +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=floLEsVjw+oSZIlZ95KxKR2a08zKBLFeRbXGxcY/Ahc=; b=HSLPZ29lYG6M8vbeIPIdrz5zS+tmhJxxeoaV+XoqsYC+oZA3qInA6MozEM5WOc29/gTDnoVOfyHjYav9c/QEYWqVFSSG6s0Npn3Olm9sqDbFaQNJr19+iSFM0796GR6+SD9UMmds8B5O2m8AC3CsSdhlMfYhZqGfRcl3FlwncIs= Received: from DB7PR03CA0088.eurprd03.prod.outlook.com (2603:10a6:10:72::29) by HE1PR0802MB2395.eurprd08.prod.outlook.com (2603:10a6:3:db::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.25; Mon, 29 Jun 2020 04:38:26 +0000 Received: from DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:72:cafe::9d) by DB7PR03CA0088.outlook.office365.com (2603:10a6:10:72::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Mon, 29 Jun 2020 04:38:26 +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 DB5EUR03FT049.mail.protection.outlook.com (10.152.20.191) 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 04:38:26 +0000 Received: ("Tessian outbound c90b0f113c0c:v60"); Mon, 29 Jun 2020 04:38:26 +0000 X-CR-MTA-TID: 64aa7808 Received: from 18454952a4a1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9E5D44FC-AA2B-46E4-84AA-5283252DB81C.1; Mon, 29 Jun 2020 04:38:21 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 18454952a4a1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 29 Jun 2020 04:38:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=joNExSl1fqnD4deI/9gwIHhcBwgDaHiPhPfaJRGu9yjSCVwy+3l2iVYU1Dz5LW4ygDoIVaMhaVzNiuA2wlxJZOy+sbrtyzM3mSq9wW6CxsucV+cZGtM0cbuMIBIZUDAlklk7/KB0/rH8j/YonkubqN6MUgtLxqDs9CSI1cW/iFVwDDLdr186iV5qt2cYsyHWFoo1nGFBeWBFD6atyIyrD7/jjEDmvEtypWu/OWYV7aApQRytMCqAPK7Ihv2X73Lm2TUp70te7CF1v7K/f+myn1RKK9HQxcbD37vrnNEy4kOYQLiPhIBWhR4xYr/fw7vRWSYaAEMdpvYOf8zbA7E8NA== 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=floLEsVjw+oSZIlZ95KxKR2a08zKBLFeRbXGxcY/Ahc=; b=AbgzPnh1OX/4ZBoef+fKl7Rjzt9H+6qlALFAlD7w2ts6UZCA9ET2SMaPs0UppHFEDChadz7dBn27fZG1mAql+EBtdUOcS5FZSWUibxfxRdXfufuuX72DMeCbdepDmqo4SO8/Cs5EcIpPz04Iy/aa/sRxYoGcQPkAf4zj7H9eUoO6MAVZkVcqo/u75Vn4w39SBkq6Z21lhde/Kli1lY39y5CLSmA8vJZUaJrObwl/rTRGKwpSiF3trGcjS8jJDBjy3ndyTHDYVp9i9yWvczbvl++bQx4jj9Mgh80qayUq9+cV1gFDrBF3Iw0wGL9B8l+1ebxiakYBpKPWaOIurdYXvg== 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=floLEsVjw+oSZIlZ95KxKR2a08zKBLFeRbXGxcY/Ahc=; b=HSLPZ29lYG6M8vbeIPIdrz5zS+tmhJxxeoaV+XoqsYC+oZA3qInA6MozEM5WOc29/gTDnoVOfyHjYav9c/QEYWqVFSSG6s0Npn3Olm9sqDbFaQNJr19+iSFM0796GR6+SD9UMmds8B5O2m8AC3CsSdhlMfYhZqGfRcl3FlwncIs= Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com (2603:10a6:4:85::9) by DB8PR08MB5513.eurprd08.prod.outlook.com (2603:10a6:10:f8::14) 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 04:38:17 +0000 Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::9d1d:207b:e89d:199d]) by DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::9d1d:207b:e89d:199d%10]) with mapi id 15.20.3131.026; Mon, 29 Jun 2020 04:38:17 +0000 From: Honnappa Nagarahalli 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 Thread-Topic: [PATCH v5 3/4] devtools: prevent use of rte atomic APIs in future patches Thread-Index: AQHWMzxk2qk4rxuvA0a0/kcUAQ7HU6jvN1ng Date: Mon, 29 Jun 2020 04:38:16 +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: <1590483667-10318-4-git-send-email-phil.yang@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: fe2ae787-375f-4dfd-99bb-9c7c6c00340d.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: [70.112.90.121] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0614fbb6-b42f-44a0-801d-08d81be64385 x-ms-traffictypediagnostic: DB8PR08MB5513:|HE1PR0802MB2395: 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:8882;OLM:8882; x-forefront-prvs: 044968D9E1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: BHSTvvC8aGR1V8upzTATtkn+iITTE43+1AYoTl1BujBoPj82CEwvJDaw9E2i9oYFIMmhfQC7T7/7xXke+4KryGzQHo1ySz8Mvl3HlhhzN8QjoHo2M1AA+x870x/m6AesEKx0pce9y3SZ2xNeKQQGste52aF1pmsTJAAVnZ+LXROqyCTKM1qf59P2cs1nJRLYNO73c+rHPk2UUKe5EVMFx84+EeKg6WaOhZSMisds7pgKXWbcxksHl8x85973W415niPYcigXLTX0I7VSgXnQofWH8luXurXTNHLJg55gZIMVIwqAmm2IKIpf3GBiVGvgYubHiYjOghKIZNqxx56wh4TZ5XMBJmRa1+nuOb1c2EeoCgOL0UQa1LNKr6QRTdTX X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0802MB2216.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39850400004)(396003)(346002)(366004)(136003)(376002)(71200400001)(8936002)(86362001)(8676002)(26005)(186003)(83380400001)(2906002)(33656002)(7416002)(6506007)(7696005)(5660300002)(66556008)(9686003)(76116006)(66946007)(55016002)(478600001)(64756008)(66476007)(52536014)(66446008)(4326008)(316002)(54906003)(110136005)(21314003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: KCjRMOYss37i2qfbSVBfroSTTloqcVfwX95U2MIrZMUtOtA3wA76ZJgqmVDzaK7L9qP2tty2p+W8HRMp5wExr93FNmwe9rxY/LNSbw/KgQ1qr0bg40ovlhzeOfUqkK3F3rAIiJLVYltla501ttxUo2ZFGlEGwmIfos+7BT53nwKwHnzr+GLYuK+ao+F8hZpAcd+Hdyc1mVinoUvQJn9MSe0R1BsqyGHd0bJtHRXoLBVzaIK9vozZTNYs4ySNnzlwHO2YhzlyAgQg4WC2u0gkCm2LWWT4cOdF9tvbLTeIQnI4mwdMiVclfB/Apu7M648+SNku6mmaS35AZQSSrXGu64zrqAw1oWpCzBYKhiyze0VqRE4s9ppl+0rGfdprr5H6aVA2cHY8oYYVEZl13dzFL+cY8Z/Z9TWtby7/HBaf5Mv7lK3jSsAVzSe8NN/KN+RYVq/dr+yiOrQDDSGQzmZFckVX/8PPQlG5k8PhhU1uSFA= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5513 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: DB5EUR03FT049.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)(39850400004)(346002)(136003)(396003)(376002)(46966005)(316002)(356005)(336012)(8936002)(70206006)(4326008)(81166007)(7696005)(52536014)(8676002)(70586007)(26005)(186003)(47076004)(82740400003)(55016002)(9686003)(83380400001)(82310400002)(478600001)(54906003)(2906002)(33656002)(110136005)(6506007)(86362001)(5660300002)(21314003); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 1ed515c1-3685-4f91-eaec-08d81be63e53 X-Forefront-PRVS: 044968D9E1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mY1xg8RJ3m/ofFCEn91OWQ27jY+I5AEfN8LHcDrCI26PZlEbLaBUoRd5LJtPVne8m1++9dbmoK7FF2zQqTIhAMcHA7Te/PCBgQEYZvr0UCZ95kRQXqIbB9fWfOPEbMzZ/MMiE9DYO0CgNFI3Kp1qWcaamVqQmfMAD65+n5LQojbahbG2onXk9YfcEh4n9S+ngBf4Ltf7o1yqxxE8+K4XfjWTaxGR+cn1i0EhFzcQsejidcUyrw+q3paAJE5nPyGP6NSTD/BmxL9mWES19gQsQRcWSMP4aCYlsklztdjIWTfKR3AXMwzrNAiBlvkzq5WDiL02S0shlNFLFzI3JKj3Ufj0uoCz3mz+IPjfHBxPaQqDg+ZF50FBZf/qdpYgEyW+Fg8UHSJNu9HY9l73OO0ikpLT5a4X5yRycR1Ev7faP9c= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2020 04:38:26.2055 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0614fbb6-b42f-44a0-801d-08d81be64385 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: DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2395 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" > Subject: [PATCH v5 3/4] devtools: prevent use of rte atomic APIs in futur= e > patches >=20 > In order to deprecate the rte_atomic APIs, prevent the patches from using > rte_atomic APIs in the converted modules and compilers __sync built-ins i= n > all modules. >=20 > 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 >=20 > 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. >=20 > Signed-off-by: Phil Yang > Reviewed-by: Ruifeng Wang > Reviewed-by: Honnappa Nagarahalli > --- > devtools/checkpatches.sh | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) >=20 > 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 >=20 > + # 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_kni > + 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? > + > + # 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