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 563D1A034F; Wed, 10 Nov 2021 07:10:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 424584068B; Wed, 10 Nov 2021 07:10:52 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2055.outbound.protection.outlook.com [40.107.21.55]) by mails.dpdk.org (Postfix) with ESMTP id 4EB324014D for ; Wed, 10 Nov 2021 07:10:51 +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=sDbrJODcFEHpSR1SLepcpekz0/c3Iv+yf47spFrH5r0=; b=2l6Mzq+7y2wS+gzbwXTySqZkti3BRA/gEid8fqGjvRhCpJjjaO852//oDpqoCzg7LEnsRfdi9CGnjpU3oFF2rfWYa9OvbvCDfQmgoWkd4WZKjU8o2nu8FQ0fW8T17T7fBPgoKwikfih9Kurook3dwE9qRIzphfrR/1ZvOFyYbH4= Received: from AM6P191CA0103.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::44) by PR3PR08MB5705.eurprd08.prod.outlook.com (2603:10a6:102:93::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:10:48 +0000 Received: from AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::e1) by AM6P191CA0103.outlook.office365.com (2603:10a6:209:8a::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:10:48 +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 AM5EUR03FT040.mail.protection.outlook.com (10.152.17.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Wed, 10 Nov 2021 06:10:47 +0000 Received: ("Tessian outbound e7ce0d853b63:v108"); Wed, 10 Nov 2021 06:10:47 +0000 X-CR-MTA-TID: 64aa7808 Received: from 2f15f744f264.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 324462B3-0DB0-4ACF-A432-B1723F8453F3.1; Wed, 10 Nov 2021 06:10:37 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2f15f744f264.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 06:10:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oq1GuxjOIVEzMD6+duAd5CWUMEmdH4F6kDu2GGHanXwZL66sK40sDaefcg3k762JDAMFwlllCZmSEjduhehj1U71+fePAukgw/d+b+RCwbtIhAtbO4WT55zprH7ebcdA7AVqvELXVvF2ZuNvel6dDHL0jFppl/diXfLigIt/q7ke8zOGGh85MdHT75NotPZsln+i2bpFm0CRoMEX0ZlaPp3U65IpIwxYfsL0VskJs5OHYwQrI3a9Y0Orng7K3lwZYJ4bpydqL0+hgudB+34JSKi6GHm4rmAbpcdpRtyMg6XpD6JpGnWMH3emLPNlt4xV6ahAVn3POTB0rrK08+1IEg== 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=sDbrJODcFEHpSR1SLepcpekz0/c3Iv+yf47spFrH5r0=; b=YCAG0vKaRqk9D/X0WZQ9kGp5hGtC+awNe7b8hc441cgEywzQURngQlYubD+Kp2CvRI4uyJ8nK1tcZSnwy24yaNGnIYRbG3dn0f+D/8DmRANM+rQA588OjVSd8D4j5Z1N9vTlTgbcaGvIHFo2p65C5BCg37jrKAupe1HsHZ8L/FMbka2oq0jD0Sv308b6hGV5jvuTPD1WaOT2V95d7O5T7In0EzOHh8j1/MivIWpjFsMm24EWTRSVLivGVj+NQR9UVUdN46CcIfLH9aOKGv2I1Jf4pqixoZoFiLlCxPxwSFbzwBgZRtjiO1P2bH1eeMItBCrWPqfMhHUlOU/ZKxqDXA== 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=sDbrJODcFEHpSR1SLepcpekz0/c3Iv+yf47spFrH5r0=; b=2l6Mzq+7y2wS+gzbwXTySqZkti3BRA/gEid8fqGjvRhCpJjjaO852//oDpqoCzg7LEnsRfdi9CGnjpU3oFF2rfWYa9OvbvCDfQmgoWkd4WZKjU8o2nu8FQ0fW8T17T7fBPgoKwikfih9Kurook3dwE9qRIzphfrR/1ZvOFyYbH4= Received: from DU2PR08MB7287.eurprd08.prod.outlook.com (2603:10a6:10:2d6::20) by DU2PR08MB7341.eurprd08.prod.outlook.com (2603:10a6:10:2f0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 06:10:22 +0000 Received: from DU2PR08MB7287.eurprd08.prod.outlook.com ([fe80::455c:4503:6b3a:1b05]) by DU2PR08MB7287.eurprd08.prod.outlook.com ([fe80::455c:4503:6b3a:1b05%8]) with mapi id 15.20.4669.016; Wed, 10 Nov 2021 06:10:22 +0000 From: Joyce Kong To: Honnappa Nagarahalli , "thomas@monjalon.net" , "david.marchand@redhat.com" , Ruifeng Wang , "konstantin.ananyev@intel.com" , "rsanford@akamai.com" , "erik.g.carrillo@intel.com" , "olivier.matz@6wind.com" , "yipeng1.wang@intel.com" , "sameh.gobriel@intel.com" , "bruce.richardson@intel.com" , "vladimir.medvedkin@intel.com" , "anatoly.burakov@intel.com" , "andrew.rybchenko@oktetlabs.ru" , "jerinj@marvell.com" , "declan.doherty@intel.com" , "ciara.power@intel.com" , "xiaoyun.li@intel.com" , "nicolas.chautru@intel.com" , "maryam.tahhan@intel.com" , "reshma.pattan@intel.com" , "cristian.dumitrescu@intel.com" CC: "dev@dpdk.org" , nd Thread-Topic: [PATCH v1 01/12] test/pmd_perf: use compiler atomic builtins for polling sync Thread-Index: AQHX1PMUYMarL+tuakKJiPZMHCR4W6v8SARA Date: Wed, 10 Nov 2021 06:10:22 +0000 Message-ID: References: <20210802101847.3462-1-joyce.kong@arm.com> <20210802101847.3462-2-joyce.kong@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 889228E14E7DE246BDA7744DF0999F1D.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: 5d8db6fd-e2ef-4320-743d-08d9a410d6c5 x-ms-traffictypediagnostic: DU2PR08MB7341:|PR3PR08MB5705: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: /vCdTT3SU+qJZfduXfw97NArWgCaXuAEFpMegl4E23F7zL+3I+LhP1Bw8l0NECifrHDkDALGjxlIswkLlLt41nOq5Bm9+BL6fna4ZsRQAds8WnaSp971tkqxNCzP0omBG5SDYJd4/2hOlHoviGEOddoB/6racSsHkRO1i/HCk3+kt/4LyvPWaKy+4yf5Phw/y0xrTYnjB2X7FqKt6DWO2R3nsFwPz2QMl+nnNHDjv21QEWJfoky8s4dMyvFp1bIr9AY94QCsep7+4gbOsr10HTig6+DuyXgs7URcOHpwaIL6mldATGhgp+pq9sUtgL4TD7B1ZqMiuZIRaVELMnzsBluVlFjOKR7JHUtfLLfzpwdnmvlbaqH+OQrzosyCqOLAkzxrzV/DOOmoFSnedjlZF1zLW4K/nwLV+EPqdMyfwkXhBLFYfFKKiN6vFiaJpPnA7LqOIepOYTDPTdOb1vAh7SQQLFfUf+TBWIckT7jXsA1QhRms7RfMsC7REckmWSg1+hfWGqOZ2K571j9AjHSQbaSNgabmY6H/sD/qexUNcXPFN1u8w4cMAYqqH5AYtW1JlVoaBR/acxTvjBQY22a656A7APrUzwNIH+WA6ClxOYrX9dx2ZJW7zalusHMujUHfjEDZt+wwOrXmvF3riIFDaYof1m4YAXbY169UeWaHFOH2dtsfWO99sLk9h5JDNhYor2NZcDQ5zlF+ntZgEnuOSPcNy7eJ7xFynI/bFKHAkDU= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR08MB7287.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(508600001)(2906002)(110136005)(8676002)(7416002)(5660300002)(8936002)(4326008)(52536014)(7696005)(33656002)(86362001)(38070700005)(76116006)(9686003)(71200400001)(66946007)(66476007)(186003)(55016002)(6506007)(38100700002)(66446008)(66556008)(54906003)(64756008)(26005)(122000001)(83380400001)(921005); 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: DU2PR08MB7341 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: AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 8079f4b2-d691-4264-4666-08d9a410c7cf X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mPk25mSsiVT65m5Q1shF5tbhRv/K0QNAAR3dwpDV0c28lEmg3KesiRopzs0epdF8JNO1bisJE6uMKQGI75XItxnmMC7Wwh0AdE3H4A/UcYNO8rnCMfSgj3eM2/Vo1zzzsBJcEnTxeGq3tUnBGbBIJ+V0/fKG/DpK0QX/TgLhS5L+zDn/49niVJXYZYafuFtt1rh9Keaxl5iIY9wJlqICGw1jOr2q1VYqgwXB5T1qHX9fXdoFDPKBY1yY3F0e0MPD4HC8fJ8+okCSdt4u2zfa6IoQgao0SEFjW3j0ConANv9MG4WMIN9rgcODYJfy27IBe8vy6W32no+U07RjlIXViQBI4CGRRUrzeBA+kDUuaZ4+YeJcV3aG1nCm2BXOEKqoxsDSMnBYeyqOh2pqfycHONDxUPvbvKf3pio0Esruf2RK8gJDPLW7Q1rm7OReRpSl5EEwLwk0e/MSuWkA4OO5MyRas1uYFv67Nsfbr2oBu/jCRzwohU01ZrbrLBf2CYVHtRlpoJMfEbo6Ie0f17eHsalCWxWcjOoKMb/eI/kjmK+1LRyYqWGw3fGKNBHVR3Gow5+EPQWz2gNJDqco9InwGwIkzEhjFvM6oDSy+3E8W9Ici6HeNVx7qAYGZGSreT/2uHk2kYrHxi7fIRvXvPD/WqxNEyRehP91DR4Qis+KvQHTiOqtr4juj33zDxCzMveJYnKf13hsBpTrPxf1WqU/HxUfWfFQLHLIClUxZ451QpY= 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)(36840700001)(46966006)(26005)(86362001)(70206006)(47076005)(82310400003)(356005)(83380400001)(8936002)(70586007)(8676002)(336012)(81166007)(52536014)(186003)(508600001)(9686003)(316002)(55016002)(33656002)(5660300002)(7696005)(110136005)(36860700001)(54906003)(2906002)(921005)(6506007)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:10:47.8742 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d8db6fd-e2ef-4320-743d-08d9a410d6c5 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: AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5705 Subject: Re: [dpdk-dev] [PATCH v1 01/12] test/pmd_perf: use compiler atomic builtins for polling sync 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 Sender: "dev" > >=20 > > > > Convert rte_atomic usages to compiler atomic built-ins for polling > > sync in pmd_perf test cases. > > > > Signed-off-by: Joyce Kong > > Reviewed-by: Ruifeng Wang > > --- > > app/test/test_pmd_perf.c | 12 +++++------- > > 1 file changed, 5 insertions(+), 7 deletions(-) > > > > diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index > > 3a248d512c..41ef001b90 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" > > @@ -526,7 +525,7 @@ main_loop(__rte_unused void *args) > > return 0; > > } > > > > -static rte_atomic64_t start; > > +static uint64_t start; > > > > static inline int > > poll_burst(void *args) > > @@ -564,8 +563,7 @@ poll_burst(void *args) > > num[portid] =3D pkt_per_port; > > } > > > > - while (!rte_atomic64_read(&start)) > > - ; > > + rte_wait_until_equal_64(&start, 1, __ATOMIC_RELAXED); > This needs to be ACQUIRE. Please see comments below for function > 'exec_burst'. >=20 > > > > cur_tsc =3D rte_rdtsc(); > > while (total) { > > @@ -617,7 +615,7 @@ exec_burst(uint32_t flags, int lcore) > > pkt_per_port =3D MAX_TRAFFIC_BURST; > > num =3D pkt_per_port * conf->nb_ports; > > > > - rte_atomic64_init(&start); > > + __atomic_store_n(&start, 0, __ATOMIC_RELAXED); > > > > /* start polling thread, but not actually poll yet */ > > rte_eal_remote_launch(poll_burst, > > @@ -625,7 +623,7 @@ exec_burst(uint32_t flags, int lcore) > > > > /* Only when polling first */ > > if (flags =3D=3D SC_BURST_POLL_FIRST) > > - rte_atomic64_set(&start, 1); > > + __atomic_store_n(&start, 1, __ATOMIC_RELAXED); > This line can be combined with initialization of 'start'. i.e. > if (flags =3D=3D SC_BURST_POLL_FIRST) { > __atomic_store_n(&start, 1, __ATOMIC_RELAXED); } else { > __atomic_store_n(&start, 0, __ATOMIC_RELAXED); } It is ok to use > RELAXED here as it is part of initialization and 'rte_eal_remote_launch' = will > ensure that the store to 'start' is visible to the worker thread. >=20 > > > > /* start xmit */ > > i =3D 0; > > @@ -642,7 +640,7 @@ exec_burst(uint32_t flags, int lcore) > > > > /* only when polling second */ > > if (flags =3D=3D SC_BURST_XMIT_FIRST) > > - rte_atomic64_set(&start, 1); > > + __atomic_store_n(&start, 1, __ATOMIC_RELAXED); > This store should happen after transmitting the packets. It is better to = use > RELEASE here. Thanks, Honnappa, will make the changes in next version. Joyce >=20 > > > > /* wait for polling finished */ > > diff_tsc =3D rte_eal_wait_lcore(lcore); > > -- > > 2.17.1