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 5561EA0547; Thu, 28 Oct 2021 15:15:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E01A411ED; Thu, 28 Oct 2021 15:15:30 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 0D4DE411DD for ; Thu, 28 Oct 2021 15:15:27 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10150"; a="230349093" X-IronPort-AV: E=Sophos;i="5.87,189,1631602800"; d="scan'208";a="230349093" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 06:15:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,189,1631602800"; d="scan'208";a="573744623" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 28 Oct 2021 06:15:26 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 28 Oct 2021 06:15:26 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 28 Oct 2021 06:15:26 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 28 Oct 2021 06:15:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NDlW6fuXcFPLUTjgwIBtDia8Vn9RpvCA984plt/7z8VjfVlPqpkyreOx6RbnXhKJb7/CzMTArt035a4lqm2VENM37nWcqwReMnHzznKT+RdQXb74a0m80qzG5OG2pr4G1e7CTKKqdcKMoo4hEt3mu2uB2u0hOtoBMwhQKtEgsDKcPruGwoTU1RShQLQLfdIu8ZWhkj41i6mZXucUAeDfO7U37SBi1S4q/VcKB+jDREjnn1PIpn+4tWF+r1nqaaf4rcpu8I/oOTU82suhGOFyQl9PY+z74V0ljOIKIM8ClFA8dVN+YpFrgPIjFKvgoRd3IB9xmrEvrzdpHARnIVC2hw== 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=agd+Ktu1+tCL/yRnJTiAL7aTlaUeL4g9WX/wn1okAFQ=; b=BnzNnZ0PbeugxJJfj7wb0naZ/vxd64CbmrV2wv+xcGHHpPCokIBZq7dlmpcEkSw2KOq0xBboTzvmFWyuHzfZZVNSp4sexzWnnoXty3EMBDclsbUl452rnaEHjwHcJUKxdaWyEnXDCycYe0qNZGmW307eeCFY86kULSJgyZPOEKu/IL5t/MOwWy0P8qE5zKWac8pgDJtde+D984ZPoR4rXIXNNuHR5Q6w5+VMIKKcB/p2v8dNTFZrqs3ItOJdyzuZGGvY/qPwmDR7MlecBPfWf/yEfPUQP8iGyiiOpLmrro1bNcl7S8RzFexSnO90WEcaQUlUp42UHMwd5Z2kXh3MgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=agd+Ktu1+tCL/yRnJTiAL7aTlaUeL4g9WX/wn1okAFQ=; b=su8BkKghUdDOpCqRItF/0MCwFxzO4bs71WEZbCGh7JRqNHPZgkjEe9FIBiLpDJlP7dxRG985DmMU6AdBRHNc9aRTmZ8562xV400l7GVKxpdq4fafXAB7A1pt7ez0NWiny/kzeLobAWbxLRVhLPcOCHeJHtCGo29qaLm79hnb9Fg= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB4516.namprd11.prod.outlook.com (2603:10b6:5:2a5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Thu, 28 Oct 2021 13:15:25 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::2c0c:5383:f814:3b4e]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::2c0c:5383:f814:3b4e%6]) with mapi id 15.20.4649.015; Thu, 28 Oct 2021 13:15:25 +0000 From: "Ananyev, Konstantin" To: Feifei Wang CC: "dev@dpdk.org" , "nd@arm.com" , "jerinjacobk@gmail.com" , "stephen@networkplumber.org" , "david.marchand@redhat.com" , "thomas@monjalon.net" , mattias.ronnblom , Ruifeng Wang Thread-Topic: [PATCH v7 4/5] lib/bpf: use wait event scheme for Rx/Tx iteration Thread-Index: AQHXy8kNDoiZ5e+UqUei6batkk8aaqvoZBIg Date: Thu, 28 Oct 2021 13:15:25 +0000 Message-ID: References: <20210902053253.3017858-1-feifei.wang2@arm.com> <20211028065640.139655-1-feifei.wang2@arm.com> <20211028065640.139655-5-feifei.wang2@arm.com> In-Reply-To: <20211028065640.139655-5-feifei.wang2@arm.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5bf84bfa-18e1-4efe-f785-08d99a150148 x-ms-traffictypediagnostic: DM6PR11MB4516: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1824; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UvIp2lEa6RTQjPNAUdOuLOWBtE4+/sBAtxtWtwthAa3sa1mmAbTeoWuNGtRMSv6nneHCB+zvs6Mv8DILgnk/kftx8KDEiiGRxaT3cTSLB7YcDxtz6oGaiJjJD1jKPGQegnWSd/1OauVAwWcpgiW7Sedv+4nvTbRuxZ5tQP03WrURGHgjxXqliSPnT66uOEmEb0VJX/hZe/xOrNn2psK8QD2XpQTwwE49sgq2q43sxuKO4ag+a7N7bXEObV7wVCX91cP+/iph02hX8Yj/jbeAfhb7QDQ+7PyXkPX4TSCTOFzIcM76vGXmdTBw/d9uWWTWrftE61Q/mG+acVLmlnTI/zxreFtwIMUvp9GjYqS4qATMxyfYI01pxRUYsygWFzFM//QOYnSaU1TlFK2QXAxY0aBVjZkBclSe3Cq4Y5tSuJiVBdWqJM6stEpzEHNuQRBlZQ5OAUvmcEJJtwg2iKSXNmXCr7UteC9c8FZ3IrETk6pXkAXBCHhPDHNYaBsJRnDk0rOkYqvLirzfK5YYQKnvcFt8MNOesy0p2w9+5wlp4lwl6glk4m28NX46zLDyA6PhiDKSkWtFQP+cU56VPwAGOpyp+9J+cjhJIJavFt4oFScWoJKzwuf8R3tLuzicSTMWpPJQqtFzOdq/O0mHPoG8pLkicp2vB44Bx7hirxlpcGUnJttvXGX2m/8T5YBj+ySfR4inpEh2IzNIcroDnW4sww== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(55016002)(7696005)(4326008)(66946007)(54906003)(76116006)(33656002)(122000001)(26005)(6506007)(38070700005)(52536014)(9686003)(508600001)(82960400001)(8676002)(8936002)(86362001)(83380400001)(2906002)(6916009)(71200400001)(64756008)(186003)(66476007)(55236004)(316002)(5660300002)(38100700002)(66446008)(66556008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?6GkKTzK//gL5eUneC2zO94rxq6dhJlTky83dl63xHRD8VtmExu3QRwXO/dob?= =?us-ascii?Q?ff8MY44uExLuR8arRwrYMbmNd3Ncg9wOcLhvPmcZn2KhMOiL57d84j5MkCxg?= =?us-ascii?Q?uBNRH382N0CftvFwEnpQBUhMFLrqRdNIS/4/y160Vkz0D+t2M4AvgkNuYOCL?= =?us-ascii?Q?D3PYvtOFfejE6aiWOKdoN3UfwBREKI5cLO1avFPCIqsrCJMEvIYoy3SsR5rE?= =?us-ascii?Q?ImKox92vxM0VwO1l41g7IxkQ7xIVxe3lKcIBrMiaK1wg+WJ57LFQTaQdr/YD?= =?us-ascii?Q?J7VxFZhJtAoX85QqRVELAUoFbr48+iHhNxvR8hHqnXPVnGLuuv3Y+59GC90B?= =?us-ascii?Q?JojitLJazNHkkZ8ryeMFrttoosc5xWQCYdmu4usF39JuPGCWIUklvs+a43VH?= =?us-ascii?Q?Aa/RJ7Swm9P1jImICjCODxbQ8P5Rv3LkSNiimcnHylZZuVmOIgNltq310IWA?= =?us-ascii?Q?J0wXPQGz+j//yBcCrX8WsVNMX46oKlby6x5y2TkJ9wq9F2/KE2IiZteWUPDi?= =?us-ascii?Q?lxONVo1OAoJhSyS8UjC7qpfK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tBIT4lLQD1HoF6hGzS6BU3YGVJHo9ktV6rmI6XBCpaiG2gSPmut7?= =?us-ascii?Q?WYBwGkhNZHLP5v2Kw7S3eRhpS/N7kqZnDicSjWT7FBXpjDU18nigcLJ4J9PU?= =?us-ascii?Q?NnskdwGmSLjWpHk0acMEQBjWT/R+wsNBP5ICBRcXWpIwFh7av8+DLGwGns4m?= =?us-ascii?Q?VIZnpFtW267DUzIRXs/JwySx6I6tIIGtRc6uss6MHtFb483IQ0hiu3lWy23c?= =?us-ascii?Q?zmzCsw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bf84bfa-18e1-4efe-f785-08d99a150148 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Oct 2021 13:15:25.4736 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jJeAkAL/EFATBeh8BdS768RsUtdIg7tBtUO/uxBEouJ4IzzoFFLmyqoQQqcBxpMeRlCZq00u9+BOwf+dUhLCRlxy+oALpQOCetvQWkNVr5w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4516 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v7 4/5] lib/bpf: use wait event scheme for Rx/Tx iteration 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" > Instead of polling for cbi->use to be updated, use wait event scheme. >=20 > Signed-off-by: Feifei Wang > Reviewed-by: Ruifeng Wang > --- > lib/bpf/bpf_pkt.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) >=20 > diff --git a/lib/bpf/bpf_pkt.c b/lib/bpf/bpf_pkt.c > index 6e8248f0d6..c8a1cd1eb8 100644 > --- a/lib/bpf/bpf_pkt.c > +++ b/lib/bpf/bpf_pkt.c > @@ -113,7 +113,7 @@ bpf_eth_cbi_unuse(struct bpf_eth_cbi *cbi) > static void > bpf_eth_cbi_wait(const struct bpf_eth_cbi *cbi) > { > - uint32_t nuse, puse; > + uint32_t puse; >=20 > /* make sure all previous loads and stores are completed */ > rte_smp_mb(); > @@ -122,11 +122,8 @@ bpf_eth_cbi_wait(const struct bpf_eth_cbi *cbi) >=20 > /* in use, busy wait till current RX/TX iteration is finished */ > if ((puse & BPF_ETH_CBI_INUSE) !=3D 0) { > - do { > - rte_pause(); > - rte_compiler_barrier(); > - nuse =3D cbi->use; > - } while (nuse =3D=3D puse); > + rte_wait_event((uint32_t *)(uintptr_t)&cbi->use, UINT32_MAX, > + =3D=3D, puse, __ATOMIC_RELAXED); > } > } >=20 > -- Acked-by: Konstantin Ananyev > 2.25.1