From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5AAE5A0C53; Tue, 16 Nov 2021 22:30:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FA4640141; Tue, 16 Nov 2021 22:30:12 +0100 (CET) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10074.outbound.protection.outlook.com [40.107.1.74]) by mails.dpdk.org (Postfix) with ESMTP id 1E22440040 for ; Tue, 16 Nov 2021 22:30:11 +0100 (CET) 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=bsm3Wd1RjBtQThQDUtd3DizgPoDxyS+mYR9HWt5s63o=; b=m/DH7FyI9SPEhBIliDOWigcredj3ic4zMHzgRKPYc69bkYp/LQZOfkc99FdUmCzKQcK2b5cvgbLvs2eBFLSVf5tvQKurb+ZsNhpQqEYOKZgmLKmb5UkZ4feXDi7qI2tC/6fnPBR8dJeRXgfnfyBLcVueldS308EmZGSy3KoP4js= Received: from DB6PR07CA0199.eurprd07.prod.outlook.com (2603:10a6:6:42::29) by VI1PR08MB3565.eurprd08.prod.outlook.com (2603:10a6:803:84::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.26; Tue, 16 Nov 2021 21:30:09 +0000 Received: from DB5EUR03FT051.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:42:cafe::8e) by DB6PR07CA0199.outlook.office365.com (2603:10a6:6:42::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.14 via Frontend Transport; Tue, 16 Nov 2021 21:30:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass 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 DB5EUR03FT051.mail.protection.outlook.com (10.152.21.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.19 via Frontend Transport; Tue, 16 Nov 2021 21:30:08 +0000 Received: ("Tessian outbound c61f076cbd30:v110"); Tue, 16 Nov 2021 21:30:08 +0000 X-CR-MTA-TID: 64aa7808 Received: from 11e4ec85ce20.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 328BCDAA-CE97-431F-BDCF-F61634AD2DBE.1; Tue, 16 Nov 2021 21:30:03 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 11e4ec85ce20.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 16 Nov 2021 21:30:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GoVc+Zqi284S36/IVRKYyIoNs7xvwZ4t1gn7WThZxc+nGlJ2hgbN55i0Y6P2MRf3Gye9Bh5Y2ueOXK1gfsQikfnV80oEvfztotYLdPF6znawJEz5RdzmKy/qomtu0d+UIx6z5vxNAzfnuG11eAiTsM5CkZF8FuhDlpanP5wHEsFoJHI5aqj97sKY1c/rbbJaEH1EZlMHihb/tcTFFmoaZcctIamfQKYYmN+MoKsh9wTkW5ArAjPtEXC2/E9EYP8SlppNkD+XBHjcoidTEZOS63cUP+Cw5Wuqz+yrn0YkN8zp2TRgj3p8LgmeMMgs6H05fl8wMXG6e7paAXo87MPgEg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bsm3Wd1RjBtQThQDUtd3DizgPoDxyS+mYR9HWt5s63o=; b=gU8aFdrlYYIPes/VCfUWHUmRdvuahnKfkEmztlohZrYaLzuKEPhfoDdeR4Cn+hFPwgihHR/tQGfj3VYG8hr1bIHr6KrqSBgsZR8RT+oBQj5y54bNVaDndeA6G8HbGBLgztbdcICvLhJdA0vaw/RxMurcMDZtiYL01v4g/3cr7jjY3fMHEztPZSWOBaZ5SqJAP6nMKu4ns+gYhu/71YYaNth9Nh1zIpWvOEGuGuXGjMnpVUcEjgZRS8J8zXX958iVaAgEu9dJ2XGhYmo/uDJWN7sXmCdwZmipTqh1lKT15v+0WJW1/wWrzInP0B7JQLRoeU64f9HXc1oHWwqoIFOD2A== 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=bsm3Wd1RjBtQThQDUtd3DizgPoDxyS+mYR9HWt5s63o=; b=m/DH7FyI9SPEhBIliDOWigcredj3ic4zMHzgRKPYc69bkYp/LQZOfkc99FdUmCzKQcK2b5cvgbLvs2eBFLSVf5tvQKurb+ZsNhpQqEYOKZgmLKmb5UkZ4feXDi7qI2tC/6fnPBR8dJeRXgfnfyBLcVueldS308EmZGSy3KoP4js= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB6PR0801MB1702.eurprd08.prod.outlook.com (2603:10a6:4:2f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Tue, 16 Nov 2021 21:30:01 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::8501:86ca:a393:17b7]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::8501:86ca:a393:17b7%9]) with mapi id 15.20.4713.019; Tue, 16 Nov 2021 21:30:01 +0000 From: Honnappa Nagarahalli To: Joyce Kong CC: "dev@dpdk.org" , nd , Joyce Kong , Ruifeng Wang , nd Subject: RE: [PATCH v2 01/12] test/pmd_perf: use compiler atomic builtins for polling sync Thread-Topic: [PATCH v2 01/12] test/pmd_perf: use compiler atomic builtins for polling sync Thread-Index: AQHX2s5m60pRCBHedEyOo1CGeXQug6wGqs6w Date: Tue, 16 Nov 2021 21:30:01 +0000 Message-ID: References: <20211116094205.750359-1-joyce.kong@arm.com> <20211116094205.750359-2-joyce.kong@arm.com> In-Reply-To: <20211116094205.750359-2-joyce.kong@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 7D2C469EF3468843995BB2E21B870E83.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 76d2c871-4fec-47a1-785b-08d9a94843be x-ms-traffictypediagnostic: DB6PR0801MB1702:|VI1PR08MB3565: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:5797;OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: pLogfrv3+YIjjU9LoclclwUTRItUZ5yRm0UQRQAhqaSHDBvMRMV+IQcu8StS/+o5TQk9jmOvcj0Q98eX7DUR5Myb0uTDgVnqjXkiJvfhNMPIfnVid7RsQtKbVCSUx0fAUafiYW+DYKu4sNsxAi73YmhEfcl+jjHAv1V4ywNtkdRzdr+96KdIejmYUcQanmtqzqn8U9D5NUzqZ4UiOBoddbWT9HGAwg5YTw5yqh0j1bgjDi+zk8JQLqTxvqVJ253navlwICVwshxP7ghUnh0J2Vybsn8ovMrfnhIe/hyiODU9S3f8NCfaQan9Xg5aWhr10TGTyzJMa4cyvS7MKpCAXCxk3SrTBRjMpBjhIM1DYyfa4NgnTm3YS8FJK28/j/nhIThuGQcjbUYN5DpmcPHnL5gqtl9wW/uD8RJHg4mzlxLpkZlHkgqBLRVEhatu8j6D26wcvSyvAqfKVYJflkH8BYivC8sYdwlIeuJwEMmYObO/8EGLLuz3NsYrabVKBOERW4Um0qcOYmn4QBU9Yd1FcE2wg5yyJaTeu60SymLRB+iH8sIeHk4jsMbGyHADqK0mniHQ8GrflApMhvEcL0dPlUkI5sRH4M5HoNvomQhCBbI1vkpMpSLmtWOsQkxuhagDNzh9f3I+TZtmSdNpF05vl8zLN8LO42/tsHopKRAhhoVtc75vlqrAnFZWjgSxdUCwNYHvE/ACZicwUb+3W+DxEQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(508600001)(7696005)(2906002)(66946007)(33656002)(316002)(6862004)(38070700005)(83380400001)(66476007)(66556008)(66446008)(64756008)(122000001)(76116006)(186003)(8936002)(54906003)(4326008)(71200400001)(6506007)(5660300002)(86362001)(52536014)(38100700002)(26005)(6636002)(9686003)(8676002)(55016002); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1702 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT051.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 443870c7-4503-4b98-bd9d-08d9a9483f78 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4EgM/rs+KVsHDggYr0SOqMmx7svjZvNTmdgIhXi5k5wfOUxgqt7eQpCyXtCJ09QqgxUW1N0idEc7muzQrWMIf/otN6/0CvQSjVHUWeVFOYSWjf1F8HjxMf4wONdOAq0/S6xcldhVD4HbLBwOl3D2VQLvEabu6d5qOjXXFqZkgdVa6gAje137Em2Cv9rCCv8s4j6/23IZ8o0Z1SPYC2WM4vM9f8jVh9x4odQCuQEbrTptDkbq1Y+dUeAOR56R24ePUniritGwYdUXPJSkVVrgJZ4q7g3jae3FdP/bzxyvcW2tH8nyB/wIEXJS+kAiOkalCvJsqQLa5HSjeqwoSZMcrBa7+ZXtVgAj0oJfb7RX4oGRVWZJH8QeQN91IAswC2aA4J6K15V4wkFgLVBOKmyFvsx7fAHOmrZrpTxS0E11GezV/bhpwS64ITTK6jzkFzL2mXGV1Wy9JcA+NI3/IfDJJ9tuqcv3fay02DkWT4rOwbPpD6RKjkYuVWIdVDdXKTY2vHZ33CIxPsQqcuA++waSTGc7s5CG0DyxZedclcGUkhtD3t0xNaZSfUuYCOWe3L3tS5iMr4sRa3XailHOPrWPdbWHeYzurBir6p7YGRTb11F1RVbukLYlFqOpzUiwVlH5Fp4OdC5ttnEnx2Ik0u3gQv1MZkkToWFddm7zng2MZsnmAkHb14qY4QGBpByunP//5nE04S7VexGzNFfOEuRnHw== 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; SFS:(4636009)(46966006)(36840700001)(81166007)(316002)(6636002)(5660300002)(83380400001)(9686003)(33656002)(52536014)(55016002)(26005)(6862004)(4326008)(47076005)(356005)(70586007)(86362001)(70206006)(54906003)(6506007)(508600001)(36860700001)(82310400003)(8936002)(186003)(7696005)(336012)(8676002)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2021 21:30:08.8861 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 76d2c871-4fec-47a1-785b-08d9a94843be 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: DB5EUR03FT051.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3565 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org >=20 > Convert rte_atomic usages to compiler atomic built-ins for polling sync i= n > pmd_perf test cases. >=20 > Signed-off-by: Joyce Kong > Reviewed-by: Ruifeng Wang > --- > app/test/test_pmd_perf.c | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) >=20 > diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index > 1df86ce080..546384a50d 100644 > --- a/app/test/test_pmd_perf.c > +++ b/app/test/test_pmd_perf.c > @@ -10,7 +10,6 @@ > #include > #include > #include > -#include > #include > #include "packet_burst_generator.h" > #include "test.h" > @@ -525,7 +524,7 @@ main_loop(__rte_unused void *args) > return 0; > } >=20 > -static rte_atomic64_t start; > +static uint64_t start; >=20 > static inline int > poll_burst(void *args) > @@ -563,8 +562,7 @@ poll_burst(void *args) > num[portid] =3D pkt_per_port; > } >=20 > - while (!rte_atomic64_read(&start)) > - ; > + rte_wait_until_equal_64(&start, 1, __ATOMIC_ACQUIRE); >=20 > cur_tsc =3D rte_rdtsc(); > while (total) { > @@ -616,15 +614,15 @@ exec_burst(uint32_t flags, int lcore) > pkt_per_port =3D MAX_TRAFFIC_BURST; > num =3D pkt_per_port * conf->nb_ports; >=20 > - rte_atomic64_init(&start); > - > /* start polling thread, but not actually poll yet */ > rte_eal_remote_launch(poll_burst, > (void *)&pkt_per_port, lcore); >=20 > /* Only when polling first */ > if (flags =3D=3D SC_BURST_POLL_FIRST) > - rte_atomic64_set(&start, 1); > + __atomic_store_n(&start, 1, __ATOMIC_RELAXED); > + else > + __atomic_store_n(&start, 0, __ATOMIC_RELAXED); These lines need to be moved up before calling rte_eal_remote_launch, so th= at update to start is visible to the worker threads. >=20 > /* start xmit */ > i =3D 0; > @@ -641,7 +639,7 @@ exec_burst(uint32_t flags, int lcore) >=20 > /* only when polling second */ > if (flags =3D=3D SC_BURST_XMIT_FIRST) > - rte_atomic64_set(&start, 1); > + __atomic_store_n(&start, 1, __ATOMIC_RELEASE); >=20 > /* wait for polling finished */ > diff_tsc =3D rte_eal_wait_lcore(lcore); > -- > 2.25.1