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 45BABA0548; Thu, 11 Nov 2021 00:19:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0853940E03; Thu, 11 Nov 2021 00:19:21 +0100 (CET) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20073.outbound.protection.outlook.com [40.107.2.73]) by mails.dpdk.org (Postfix) with ESMTP id F1B3A40DF5 for ; Thu, 11 Nov 2021 00:19:19 +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=FVKTL49o+CXsiT72RM1ZAYVU68nGh/eXuR0zrVID7zA=; b=8MAfV+NkPwwdI10Y7YceWmqBvI5Hm7BrcJC1k6AVFvrip1XNp8rgwWKvEch5JBJbzWrvSgyeH3jA6sFsch2WCX2aM5SdS3bJLukcGpUATdR/X1l8EBeCWRqZs3iCk6bhOVkiD5sn2j42wnIBaol7oqlR7Hr5tOCT8n9gxwyBJTM= Received: from DB6PR07CA0018.eurprd07.prod.outlook.com (2603:10a6:6:2d::28) by PA4PR08MB5951.eurprd08.prod.outlook.com (2603:10a6:102:ee::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Wed, 10 Nov 2021 23:19:17 +0000 Received: from DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2d:cafe::6f) by DB6PR07CA0018.outlook.office365.com (2603:10a6:6:2d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.4 via Frontend Transport; Wed, 10 Nov 2021 23:19:16 +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 DB5EUR03FT010.mail.protection.outlook.com (10.152.20.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 23:19:16 +0000 Received: ("Tessian outbound 6ebd41198c5d:v108"); Wed, 10 Nov 2021 23:19:16 +0000 X-CR-MTA-TID: 64aa7808 Received: from a24c6b911a52.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3DF9DDB3-9BD1-476C-A73F-EF69ABD1486C.1; Wed, 10 Nov 2021 23:19:06 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a24c6b911a52.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 Nov 2021 23:19:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lFljeUWectzmT9lKG6ZdRk1SdMjU2MwpPKEwzO5bTPdLB5/GXhsDrHkLGfkS4m31ZcRNGzmQi/F07Uun/8oBoWhKEavYFn/PyGbkHJW5mbPNb4Mu9bCyatSuFzymoTlC2lIS7ROsYy4vir/Qo05v/DZ81a90Rx1nPdpStwIyFXET1qkDiyIn7ecASKKN2uZJfL2ULFJosOPPonGrrjzWuqKsWKSmt/dLu9NGAToOuejw2sg86VBRYUxGrqsdR5+YRlYRhqiUqYxYP1fYp64vsTS8/SwN0HJbWmMNyUcbh55Wn7PmCcg/vMTsy1NZWiHO7H9O4B4P1Wmzq5U6w47p6w== 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=FVKTL49o+CXsiT72RM1ZAYVU68nGh/eXuR0zrVID7zA=; b=OGoWSa1SpzO3A7IvH+ycILWDGn4cr399Hjj7FrMCBcn56CMohlRG8JcRwe3+uu/cyO4PunedNC8DCt6Vm7wsOYv9Ant62z/oMvYB7NgME5zqqQu46O2pFZjRS4L/Lm0dkhCkqbD9L66FrkK7yskydqErdlSAoz+CskGALFEfgglsTcyFqncPymXDyJhMM6kPf7Cqa9fleNgaepag5MtGo+eYskd46oM/OCBysqed6fs3vRQtFXRw7RrHHriLpJaHGGmSuV7cBTB1iNuD7MI/goT7zfTg/dhjHIIK+E3JMINUJBfatPODagPOlYWI8pU7C5yWAF9aDkrXG+19zCcdHg== 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=FVKTL49o+CXsiT72RM1ZAYVU68nGh/eXuR0zrVID7zA=; b=8MAfV+NkPwwdI10Y7YceWmqBvI5Hm7BrcJC1k6AVFvrip1XNp8rgwWKvEch5JBJbzWrvSgyeH3jA6sFsch2WCX2aM5SdS3bJLukcGpUATdR/X1l8EBeCWRqZs3iCk6bhOVkiD5sn2j42wnIBaol7oqlR7Hr5tOCT8n9gxwyBJTM= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB6PR0801MB1991.eurprd08.prod.outlook.com (2603:10a6:4:71::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 23:19:04 +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.4690.016; Wed, 10 Nov 2021 23:19:04 +0000 From: Honnappa Nagarahalli To: Joyce Kong , "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 , nd Subject: RE: [PATCH v1 07/12] app/eventdev: use compiler atomic builtins for packets sync Thread-Topic: [PATCH v1 07/12] app/eventdev: use compiler atomic builtins for packets sync Thread-Index: AQHXh4gVQdrlZGOE60utc1gyHRYOMav+AoMQ Date: Wed, 10 Nov 2021 23:19:04 +0000 Message-ID: References: <20210802101847.3462-1-joyce.kong@arm.com> <20210802101847.3462-8-joyce.kong@arm.com> In-Reply-To: <20210802101847.3462-8-joyce.kong@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 9973966D94A8A643AC050D7921D65C5E.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: b5561987-2ac9-40c9-3dc5-08d9a4a08431 x-ms-traffictypediagnostic: DB6PR0801MB1991:|PA4PR08MB5951: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 9xh0GKA3orTxOopM7OItfm5UsvaW1EvSM7TUuShYJL6xrkmwx29E5mAg0+ASUUi+BR0EdTPC9fs+Y8acO1XW/+XDsgxpRVcpsj6sZl3p8fTovEqY6zppthsRtm32sApy/kzPYXj5j6F8fdY9hP0kjHzpTTk1u2qWwkiww08nees8QFyqGk+8pcJsw/EloqqzvKosYdoap2XXlvdG4ENTV4UI5oVpTK3Na5bus/oZ9w+U0fbx0Rh5N+nLBqvh6QwXYy0oUGwkeMafaP2pTWjiHV1xIVBtNHc5hZEaGqz3L7pGQl7GH313SCgdP6OYvPSofT2qWoaQCam4nw9bVzl65NO2LEdfzHW9C+/Oi4iZDsEWQ4GBkppUcS8F0A41GiGRod5buOgyAQKhti4IPLdCmxDVNmK1ymXnIsUigYjgqDj/EiIosvSRyYwpEbixeSDL2Q5ApNmOb7vqaX6dhKcdtVV6x40z2+7O6Lm+VchjBeaQT7h9S8Q+tONFu6auZuRSgwBdrSHzmdTq1fXJrcvLzrWljvGczu38KR4brOpk/JeW8vCLRfKS09Z+aCRvlU43ORSxZOTuLAY9uNCSsGQ7JRwqMLIDya38NoAkOKZMzCltVWIchKh3mEJT536aSLYYw7uc38PSTuhP2LhvWhdiEaJvE+ZeQscghQhvUlPiTUU5gNgqRtEc1OMCjjAnj57z9IidqNIEPdYHNk4ofpPPg+KBjlIIZzptGlhQkakRI8Y= 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)(38100700002)(66476007)(66446008)(76116006)(83380400001)(316002)(54906003)(921005)(2906002)(38070700005)(122000001)(7416002)(71200400001)(55016002)(64756008)(186003)(5660300002)(33656002)(66556008)(508600001)(6506007)(66946007)(8936002)(110136005)(7696005)(26005)(9686003)(52536014)(4326008)(86362001)(8676002); 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: DB6PR0801MB1991 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: DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 22dd4bf9-b80f-4af4-2e2c-08d9a4a07cb4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 20met1rKIQgt8iLELCf9me3HqAXZFU6LB71PqY8WPkROFRr/udjiMjWimovjO/a3AEG4TjA+OUxp634PcQSmo9D9oP6ItQhezcMt0jIVL4aEVWQsSuxhdOqnVZmtgkW/C69CQkRkv5MxS3/3hX7kWAH3a8P6FGQXnjQeK+lmCVip1H/ec8q6zp4jOkVNjebfSHkiDykSuZLv2vLaFU68ZzEmKOn1ezqM1iUuhPK7/p09cm+dw5xkL2U3K31rcmh069EHl7pgdUCeFUhZKlxFo0j6dXwN7CwEOxMJ8bfulbP1mAXL/Cn6+Zi3V0jnTtEk97X91FPxpqE1NaoYtVJFctHvOnSTrX9UHIBS+f4aR6SzCXzpH1r+wH+knon9rLhLju/bi91MS/tmPSx9mvF9PXgMkm7Ut8rh/0TshuXZK9zGx4Tkg33k0P/9PdQW0Z2XxJptOvdF/+osjYB5ZFtMbKw+oDP8VhOu1sOQjsv7MudqpRs6ZKF/RL/GcLy6gu9GDxuIVRoS1a8Pj/BsfLQ30SbSCo7PFRls0fviWo5oTZ0gLp0MTdtBa4oldMhMxPSWvuBZ9D0VaPknicpJmYR3rpA1zgiY35h5t1dF24/R1CLI314qgyWV2mvep/wc7A15nyuufQKM2ZkuDJYd5Eh97BKxG+KeiPqdw4sas6P98iPt2ZlrImsluQ4Px/yBpye/RhT+/1PmjZ95ePT/kPhga6m7XYqXQOIAxJzo6JEeyC8= 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)(82310400003)(316002)(33656002)(26005)(356005)(110136005)(54906003)(36860700001)(5660300002)(52536014)(2906002)(70586007)(86362001)(186003)(921005)(8676002)(7696005)(9686003)(83380400001)(4326008)(70206006)(55016002)(47076005)(6506007)(8936002)(508600001)(336012)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 23:19:16.9103 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5561987-2ac9-40c9-3dc5-08d9a4a08431 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: DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5951 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 > Subject: [PATCH v1 07/12] app/eventdev: use compiler atomic builtins for > packets sync How about the following: app/eventdev: use compiler atomic builtins for shared data synchronization >=20 > Convert rte_atomic usages to compiler atomic built-ins for outstanding_pk= ts > sync in eventdev cases. >=20 > Signed-off-by: Joyce Kong > Reviewed-by: Ruifeng Wang > --- > app/test-eventdev/evt_main.c | 1 - > app/test-eventdev/test_order_atq.c | 4 ++-- > app/test-eventdev/test_order_common.c | 4 ++-- app/test- > eventdev/test_order_common.h | 8 ++++---- app/test- > eventdev/test_order_queue.c | 4 ++-- > 5 files changed, 10 insertions(+), 11 deletions(-) >=20 > diff --git a/app/test-eventdev/test_order_common.h b/app/test- > eventdev/test_order_common.h > index cd9d6009ec..1507265928 100644 > --- a/app/test-eventdev/test_order_common.h > +++ b/app/test-eventdev/test_order_common.h > @@ -48,7 +48,7 @@ struct test_order { > * The atomic_* is an expensive operation,Since it is a functional test= , > * We are using the atomic_ operation to reduce the code complexity. > */ > - rte_atomic64_t outstand_pkts; > + uint64_t outstand_pkts; > enum evt_test_result result; > uint32_t nb_flows; > uint64_t nb_pkts; > @@ -95,7 +95,7 @@ static __rte_always_inline void > order_process_stage_1(struct test_order *const t, > struct rte_event *const ev, const uint32_t nb_flows, > uint32_t *const expected_flow_seq, > - rte_atomic64_t *const outstand_pkts) > + uint64_t *const outstand_pkts) > { > const uint32_t flow =3D (uintptr_t)ev->mbuf % nb_flows; > /* compare the seqn against expected value */ @@ -113,7 +113,7 > @@ order_process_stage_1(struct test_order *const t, > */ > expected_flow_seq[flow]++; > rte_pktmbuf_free(ev->mbuf); > - rte_atomic64_sub(outstand_pkts, 1); > + __atomic_fetch_sub(outstand_pkts, 1, __ATOMIC_RELAXED); > } >=20 > static __rte_always_inline void > @@ -132,7 +132,7 @@ order_process_stage_invalid(struct test_order *const > t, > const uint8_t port =3D w->port_id;\ > const uint32_t nb_flows =3D t->nb_flows;\ > uint32_t *expected_flow_seq =3D t->expected_flow_seq;\ > - rte_atomic64_t *outstand_pkts =3D &t->outstand_pkts;\ > + uint64_t *outstand_pkts =3D &t->outstand_pkts;\ We could use the atomic built-in to set this? We have been doing that in ot= her places. > if (opt->verbose_level > 1)\ > printf("%s(): lcore %d dev_id %d port=3D%d\n",\ > __func__, rte_lcore_id(), dev_id, port) diff --git