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 0E454A0C41; Thu, 7 Oct 2021 19:40:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD38041217; Thu, 7 Oct 2021 19:40:23 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id EB219411DB for ; Thu, 7 Oct 2021 19:40:21 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="223719769" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="223719769" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 10:40:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="440352537" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga003.jf.intel.com with ESMTP; 07 Oct 2021 10:40:13 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 7 Oct 2021 10:40:12 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx602.amr.corp.intel.com (10.18.126.82) 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, 7 Oct 2021 10:40:12 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.46) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 7 Oct 2021 10:40:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PUQZmbuYDIFvbSP2VjUtdUY4DamOhEs1WW+alrUx7P/Vpmm9LAYCOJln/wAgkul9ydQFoc3PNPczEN4LBbPE0xfSx/UJ/zodVZrkwvlRXGFfo+4YiOOshIpfN4paLEjYL2B7BBUMhBDmYaMpZk1q7A6uByMhSrXnYtqUrQZHMvbCpvEzPmQu0rynzktjAJT4xkuAq2deQ91+ChEk8N8HGnV3GC2f5qZZv6F6+C1+zOXtOo6n7Zr4pc3HndSVrKMYFF0+GixtSydczRVmX8PhsfDSF1b6Nbp8hEE2F91KR2bxzAlPu7Etsz9V+INAXK8Mf/4yeKL4MnHdZ+SYa1Y3mw== 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=Px/qtH52tJARx6qVG8uWHJnP3qQEWQQsg6QiPYpJhXg=; b=LFPzaeB3e3ta425/cdlBleqgwQXWmg+EqhaQgsuGdHKfKeVm5D4W1jis6YEulHMJ9AtNGCoI/zLNCdmWISdb8p/bDT2x2n00I8lEsr4bkFbTWEwb9b9KidsC0tAG1R4TSD69XXS28gQOAoHv4nz+c3gAdGpzAtyjQd+NKaIfLCWPCqZkHC287rFPCXdB9E+gbJotlEPQ3PS1F1qZWAYzlvI7Q8/TngUmOJzOYCpYIUDbrRK/qL2j5Y0cHy94FvNBjUoHh77krzgscMI4Ny/gf/95dP7TTdEWnk1T6Gjw2eExX1TCH91irTRcYNdJtArvGQmFKTqGnIPacWF3U8TVDA== 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=Px/qtH52tJARx6qVG8uWHJnP3qQEWQQsg6QiPYpJhXg=; b=pSZ7kQPvwlSCseoFX4lsIE4f6gce5E59sJueauyHSga/lwucDmNVeL6p8j0+ALMKRg4LWIvbAzBjLMF6NnjkxqUOOHjI4ri5POlVtlah7b780vGD2h95Zt6VhkuGAAibjI2Aj48noTE2PgxEhWtSZo3BGPINIKsp8mSWBYCyIQ8= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3626.namprd11.prod.outlook.com (2603:10b6:5:146::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Thu, 7 Oct 2021 17:40:10 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::740e:126e:c785:c8fd%4]) with mapi id 15.20.4587.019; Thu, 7 Oct 2021 17:40:10 +0000 From: "Ananyev, Konstantin" To: Feifei Wang CC: "dev@dpdk.org" , "nd@arm.com" , Ruifeng Wang Thread-Topic: [RFC PATCH v3 4/5] lib/bpf: use wait event scheme for Rx/Tx iteration Thread-Index: AQHXsqBsnW3elibFRUmGfKTf8L8+M6vHwIVQgAAeygA= Date: Thu, 7 Oct 2021 17:40:10 +0000 Message-ID: References: <20210902053253.3017858-1-feifei.wang2@arm.com> <20210926063302.1541193-1-feifei.wang2@arm.com> <20210926063302.1541193-5-feifei.wang2@arm.com> In-Reply-To: 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: b3ab92d0-e1e4-4f6a-c8c4-08d989b982e8 x-ms-traffictypediagnostic: DM6PR11MB3626: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1201; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: beRqfv8A5fSwNDhOZrgSPfqYUrvTdxgaxdNI5J2oqf42mm8l40/uaUgiedpfaVkn53zyg9xAxWBBPQE0bkI6d/UY5l37x3rPorqirvat2LdGev0b5yqIlz+ZSkThiaE97wILlKpzPNaK+oZRvzMYQrrf0H07SvWdLXRPN+F8b8bU+zUWidkCBXV7m+OwCPZVFnlx88/kC1baJfpMrXlWB91/EK2ujey1SU+rl9q4eDG+zCnkNRgSWIZh6F79GAe0kcvdS5BDRbGFmQmxSsgk+b9fS3zeU0D1MriQP435MwENajc7TBMPNDWfTxkmGyyf1bTqsvkurBItSg1lf5fPp+kQ3LFXiPod+TUNkjOltSenygHsUtZkFuESpz4kifum6QaTeqdQGQFCEJQL/4DjVGi0TycNVaGOP89rQdMCgC7VxOeX6g2LQ/N6o5OUseXTMlwjs0p2Azfv9Nm4cUz5mEA7ir8/LN/XaRwf70P5183lQ4jWX9A76MQ2tyFFBnBAonPptOi3toAxb6gi3M+2yUCiMQA8GaBwY/FZgbQbPWcfh63YsRCots1EII9YEf4XJBTkID9esHZPR8G/7hKibOmohis76xXpPV+lS5+XF7mjSvrsT0IHDT12wjuYGZNVB7TA5BXxPYOMtoLjS7PhSg1R458Wf5i7Lx8p1IhaH0es21iTpi+bzpvFWZyaWpclGbo2mCODqH591VMqCur8Aw== 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:(4636009)(366004)(2906002)(52536014)(122000001)(38100700002)(55016002)(2940100002)(6506007)(55236004)(9686003)(53546011)(26005)(186003)(86362001)(83380400001)(64756008)(6916009)(66556008)(66446008)(66476007)(76116006)(8676002)(66946007)(8936002)(33656002)(71200400001)(54906003)(7696005)(4326008)(316002)(508600001)(5660300002)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5xlgdLcea97DzmHTwpoi/MCQwNioDhI0eHbmHL0isex3/5Kpgc5ZXXkP2YXR?= =?us-ascii?Q?ES8ejyIx7yMOM4og8HG8h8IwmL2tH4wyyhAXeTM7HTUng6wZIeU4lzs+cfm+?= =?us-ascii?Q?RX8DjWHUtClyG6yx8glBVpbF+TQoZvr8W93JTpjLyKTrXXTTC2iCGqrXY4bG?= =?us-ascii?Q?llUOIjh/9OKXD13ptGxrr88ESJ+xK1ataxPjyBBikJFl9k4mU4D50QJf9X3r?= =?us-ascii?Q?9oSGHuW0EcrhT+yKMzdizE+diH7An0cZSNBavDA9jt5tKE002j7cIc0BkZ9t?= =?us-ascii?Q?daZZ7VoVqyx4CIqGCPP+VKj9hwevJlLaypKlEnXmgDUEHa5EQJjugykb+wc0?= =?us-ascii?Q?h8JZDqMFQSiTtX+mdTzNbLehE+KvgQD0MIDaRNg1ZBD+fWnJvCxbptXORz+J?= =?us-ascii?Q?HnQNqI5JIWEDSOgFSP4ll2OYf/GpZB/9jnoVVfZijKSfdX+ijSDoO829xDja?= =?us-ascii?Q?9sDTbVk9QFjzpS8u5ZPaC8lYi6IpJT8+E8PnEbJ4O2JmSUJ+nPYtfvss8AnI?= =?us-ascii?Q?CQfL/vijsbed0JHEqON7PW5DPodozmLSqnPj6Ul12J3vwqpMRZ8Rhf324FBn?= =?us-ascii?Q?bG/VqY4n2acZfRCgqCd/eKFHFRDE0fnUCMlHcWn8XMZx7M5Y5185qWgfGhhN?= =?us-ascii?Q?j34JvL1Y+8I8E+4eTvH7SgHNfWMyARyV5YZUKj3D2DfOYWNf9d7r4l+hzKl6?= =?us-ascii?Q?0G9CeDXy897f16BG2pHcAYTQKw6AzG7vym98nE4e0Hq8DFrkJXn8cCtR1+Po?= =?us-ascii?Q?5heBauPYvcuyJKLacXZwGL6lvjGwv2RFms6rAr9WWGo3E5lV1B9zjyjDKnAT?= =?us-ascii?Q?ms6r1ZMldL0NHjyqMcCdDDq2CmoJfIix+wTJrgQzlCZxuw7kzn+OU+Pg8WjH?= =?us-ascii?Q?o2PN8Q1dBaxATM9G/PKCHmsqlfeXmcMbfOz8x1V35a2l+0WXlw9xaGhk6X0Q?= =?us-ascii?Q?Mc0lmHLJokl8ohbU7ja54PbEGg29v/vgrl3ElXZhnKgymaAERGBXTCtgxBef?= =?us-ascii?Q?cA21EKx5u0co/yEEpmZit+TGckuPVokMqbwRo5Q6wui+4W1FSN12grlhcCR4?= =?us-ascii?Q?WsaLvztyhzj5OfhzI6WrBQxlZ9fWlkYejmaj7K0f1isQOBAcCQx/6Otltamd?= =?us-ascii?Q?Um4oWHUQzNts0NUTVl8hx2SleMSK0dwipxesNfNiGYSfo1LisTYBF2FiqVRD?= =?us-ascii?Q?k5Z6C+I201Zjk+8VPPoqkYNHIDoSVRCjkYVRnVOAfEc3ver3LEzf91XGHyuL?= =?us-ascii?Q?Pr4oJgRXuzVR7Drt9CWJYh5Ymoap5NYWxFNDoH1z0GCKXnPNR4a2D5vD7NIR?= =?us-ascii?Q?C/UoxAsIbNnEhrHOXxVbS39e?= x-ms-exchange-transport-forked: True 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: b3ab92d0-e1e4-4f6a-c8c4-08d989b982e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2021 17:40:10.6645 (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: TXz0Ls6qaHaS5wG9WVpKhySrsQVVQzsy/jNXI61Sb+AKB/LGrhsorr9JIG/7cATvxPA0GVHJByg6rX5chy4G+YYExRbzQg0kX55GFP+7iIY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3626 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [RFC PATCH v3 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" > -----Original Message----- > From: Ananyev, Konstantin > Sent: Thursday, October 7, 2021 4:50 PM > To: Feifei Wang > Cc: dev@dpdk.org; nd@arm.com; Ruifeng Wang > Subject: RE: [RFC PATCH v3 4/5] lib/bpf: use wait event scheme for Rx/Tx = iteration >=20 >=20 >=20 > > > > Signed-off-by: Feifei Wang > > Reviewed-by: Ruifeng Wang > > --- > > lib/bpf/bpf_pkt.c | 9 +++------ > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > diff --git a/lib/bpf/bpf_pkt.c b/lib/bpf/bpf_pkt.c > > index 6e8248f0d6..3af15ae97b 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; > > > > /* 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) > > > > /* 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_compiler_barrier(); > > + rte_wait_event_32(&cbi->use, UINT_MAX, puse, =3D=3D, __ATOMIC_RELAXE= D); Probably UINT32_MAX will be a bit better here. >=20 > If we do use atomic load, while we still need a compiler_barrier() here? >=20 > > } > > } > > > > -- > > 2.25.1