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 5D1A1A0C47; Thu, 7 Oct 2021 17:50:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44C314121E; Thu, 7 Oct 2021 17:50:20 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 8743D4121A for ; Thu, 7 Oct 2021 17:50:18 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="226185493" X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="226185493" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 08:50:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,355,1624345200"; d="scan'208";a="522643472" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga001.jf.intel.com with ESMTP; 07 Oct 2021 08:50:17 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) 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, 7 Oct 2021 08:50:17 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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 via Frontend Transport; Thu, 7 Oct 2021 08:50:17 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (192.55.55.70) 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 08:50:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KCI89ju4i13Kumsj0DSF/UlkiGYmMYfT7v8CBuYJrHJIbN9axeqB2TlBd7LrBU5WfzbavgcY56jPAigN4R1aBWeOZABqCvMb1cVphYm7V8GI867h2MHLJgZAsl4Sdmamyv/TAOvsLZ6nzchN0oYmiw9xEVw0PJK33LkUkT0CH++YWX0wEBg8ZPYmdoadcF3AF4LVkCnlyYCZPfTL43R8M4rMKn5XXJbFcN6QOeiDGpzpUgf0umep3GRSkNRV2YuxH00aADCQ+E5fLHBIjwi8YL0PxG9y1+hsoOoFlYpppksdDtUO9fzKBZImQdcZ9+4mcinQ+MOFGfNDSAuIYxwATA== 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=5LkG2/orYHRUmoFmV+3TyfNcMpym0T3G1y3D8lNh5Kg=; b=mKrpsaWspfRBgFJdC9yaYQtDO8PnY58yC3a3w8MFHGBy/ZhUawYE2It/v9g9CNZurOtyA2EtBhhoJPbvbapXpN8meV94Gvvwk/4nDFfaIKir8vP6STOcMbunp7pPI8tSjgAQiuwo5B3VJwQJzJ9mi8SG9n9iGfCIUOygpsTwHO79QB/av6KUVDlOcHRm+xOsQbjoZQc0UJTiaAZZxyiDNYuub6HgAf3lzL1gHGbaJORYYletb8Dem9kPnDEPTjILJpx23kOy3QkcxU/mkwDZjJz9gWCGxzKqVDhtRpwErofYPYeNmeTXewsgH5ean2zpTJXH+jV2yeaOgLyZWNhhuw== 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=5LkG2/orYHRUmoFmV+3TyfNcMpym0T3G1y3D8lNh5Kg=; b=OzTJCOUcpj71spyoBoQ6+1q75nsNFB0nqhbmRpkLXc3nY9ELrqsOkanOBTXnhfOqIqPbd7UvTYIbdRxBQe0KR1KMga9Ro+X1ix6S73skR8xgmOSfOofmDS9I5E+D7mG7Vgqxd12F1wXL6bzIeVhBmvrV/Pf+D2eCzSazblE3KqM= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM8PR11MB5686.namprd11.prod.outlook.com (2603:10b6:8:21::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Thu, 7 Oct 2021 15:50:16 +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 15:50:15 +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+M6vHwIVQ Date: Thu, 7 Oct 2021 15:50:15 +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: <20210926063302.1541193-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: d483a953-3648-464c-a6a8-08d989aa280d x-ms-traffictypediagnostic: DM8PR11MB5686: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:785; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nFf0Ibt0xOgdRKoU5/O0VKYTZNDtjwyFh2rcNpZwdRV8dmmzY5ok1a210XMAxg9Jj0yBQxk85PVDEDs9a9+Fa5f0OlPwrw3NSIqulrp85XNithNxy5+2o622g1xx1vQ2548/MapSr9zXt02b44yPxdtVB3vcrzS+ocWPnEThehYt1VlvdkcZFd5h11ZnJXNwdLJF+aZ1Q5cs6oSAdApsn5Q12ZSRqohbx0IjZ4+F4bQpr7vS3MODuoruCaF08DZdMqoNI+c9Za/KdIsZEAFQAKXGzwyEskEBffVkgld6l4dd2Afj+ry0A+hEmdM1MS0rGbr1Yfo7xMCuFclo+pOlGxvQkAiXQvIl8iqyukvs+gltoEwnFiMMHOE3uQtbEKbvFeGAp2Mt8H45tBlfeFHFiz0d+rxkrkwYuIHhLtJO/r82+mx4cg0VZV8jG2F/V3NsSrjqBu/Ox3dFdCz9eKnBCHF2aBEN5nmeNO9XZ+G0V34UCRC5mH2r2jGZdNkIlXO95yq7Ni3uBBDFXgCOD5U9GzjV71o9fYjkZJUc8HLsgjo1e5gdGJ/Q8pRYZ8Efn1IOOoOEqzRQALxTtfwmUlm/Gb3/d/GzmDyoy616MjmLSYAEcwszbGrCTfA4j3DDGHJ+4YX7kr+yng0zH0HYx3KEism/Uu7OvbsDVbdjpwAqzIZqxzCJ/hxWYsOEEHuSTKucqo4cQeel1vTOn4/DR9JyOA== 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)(508600001)(54906003)(71200400001)(316002)(66446008)(76116006)(38070700005)(66946007)(66556008)(83380400001)(64756008)(66476007)(33656002)(186003)(6916009)(26005)(52536014)(38100700002)(4326008)(2906002)(8936002)(8676002)(6506007)(55236004)(122000001)(7696005)(9686003)(86362001)(55016002)(5660300002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?km9A6ZK5XxcAcYANomUfd3a/5I3dsT4DYjnO1xqyRIGxbJkmX56IdGIdGNfh?= =?us-ascii?Q?/s2SoSzE/IqUownV8dp/tVi9ZKz8+lkl8TLwrze3LHfHjijHrF3Nc7NoYDuE?= =?us-ascii?Q?de+RilWOQqMk+habrew7vvFSgJTeQSwlBU9YLNSMGEqXBhnnjge6u50Ql4wd?= =?us-ascii?Q?TCEgruP4bYUpoWAah9wtvCaR8Fq0a3PRm2MDVfQcmMwxgnfsf8XGgCCGDjTD?= =?us-ascii?Q?ON8wmhUW4zo4i2fsz2gvwJrfLPtUv2y5mf7b6zpSiBxH9SJzXdyT9FPq5acq?= =?us-ascii?Q?iKJu89LVxJ61rkNP58zVt32tlyVObM64SGEJmeZ/RHJ+JMyomH7hZu5NQ4ls?= =?us-ascii?Q?UT26xB0E4WnYrH8pDWccDYH+Xcuq1ArCE9KUh1GNtCCmoKRTp77tBqe4LY7L?= =?us-ascii?Q?J7JROaWWGQPo9CsJYyezS4bIaXK26k5ggV3HpS4P4I+39HhPZta2HQQHeG6Q?= =?us-ascii?Q?uu1YL/T5oB0O1N0nrgyZYdqqn3KpWMz68U5RWIzH1yAyK9Z3DN2wx9hxYWDJ?= =?us-ascii?Q?UtB/ua7oG+0dqEOtlv3Uew/afKiFUGKvAjFwOUzbhfIcW2RQAj+0q5zSbPGD?= =?us-ascii?Q?dUgKuKitJR0rS0BZU9tO69vTTUlJWLM7WSK0ifLY2MOCEvAVSu0gsGalZq2T?= =?us-ascii?Q?ZhHfbr0eZP/goxa0sllXNOKbddwrWdhScBwWkhQO9gQemsShVJ1u16iNNDT9?= =?us-ascii?Q?sGyK6QlejVLtz2LdVM5SQSELdtVDMJWwussHuT46+B1g7vZ54wllXEGExO4b?= =?us-ascii?Q?A+ndYjPefM9tt3j7bu+gkve4INk+i4tcH554PN2URVu14fqUerxd5KEnLn4x?= =?us-ascii?Q?eXnyAyCqnuSedQPSlKxrBnuBwd3XhoCuJkmvKxNZYpl1Z5weX6UmaO9qe8Pr?= =?us-ascii?Q?VzJ/2UKEaj1vc5sEyOXuLPCncGEMOk2SyXhzebBnCQaoF1BrBfJXQCpkF56X?= =?us-ascii?Q?f5DPb/T/Dvfafr+Z5VmS+c5V3i4aPqs/TnCglMfhOmUWdEWZMyOUJT12eYlJ?= =?us-ascii?Q?3hD49ueyG/q9Almt++efOt7+2K34Q7NJAO4n6bhVwlAxQFZYrvKbZ99bdZpN?= =?us-ascii?Q?D+sITTObgksOglRQT2v6FlDr6ouezOMMM7nBgVvoptD0mbthm8brRvY2rHjQ?= =?us-ascii?Q?ic2SlvbYBZPEd82Mr3I+zrQpduY8AkGsADaFVCa5tlPvFJprmJ717sEdmG7p?= =?us-ascii?Q?fR7nqGhhg3RmxP4mYAje+EZFXxDBItntyzRkNXEMFUq3/003y141WYkb9Na1?= =?us-ascii?Q?gQOZgpDTjcET+hPMS5RFCL/S4EVqkIomlulHBXeI2HRckVnG7CSTuEhSBeqg?= =?us-ascii?Q?UVH6O0BwrtrkOnfE9hqsrEho?= 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: d483a953-3648-464c-a6a8-08d989aa280d X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2021 15:50:15.7845 (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: clN5gQAF7Ykch/9BkISZLsmmCkozoAosoidc5VuGMjwuXuio8lt12bTYR2hkUFNiUf8mntXAPlTjMJm0yBooz99ifiS4lI+Ibs/UlXgZIac= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5686 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" >=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..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; >=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_compiler_barrier(); > + rte_wait_event_32(&cbi->use, UINT_MAX, puse, =3D=3D, __ATOMIC_RELAXED)= ; If we do use atomic load, while we still need a compiler_barrier() here? > } > } >=20 > -- > 2.25.1