Message ID | 20210902053253.3017858-1-feifei.wang2@arm.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 249FCA0C4D; Thu, 2 Sep 2021 07:33:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F5D44013F; Thu, 2 Sep 2021 07:33:06 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 4E6AB40041 for <dev@dpdk.org>; Thu, 2 Sep 2021 07:33:05 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AABA41FB; Wed, 1 Sep 2021 22:33:04 -0700 (PDT) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.115]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 55F443F5A1; Wed, 1 Sep 2021 22:33:03 -0700 (PDT) From: Feifei Wang <feifei.wang2@arm.com> To: Cc: dev@dpdk.org, nd@arm.com, Feifei Wang <feifei.wang2@arm.com> Date: Thu, 2 Sep 2021 13:32:48 +0800 Message-Id: <20210902053253.3017858-1-feifei.wang2@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [RFC PATCH v1 0/5] add new API for wait until scheme X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
add new API for wait until scheme
|
|
Message
Feifei Wang
Sept. 2, 2021, 5:32 a.m. UTC
Add new API for wait_until scheme, and apply this new API into lib to replace rte_pause. Feifei Wang (5): eal: add new API for wait until scheme eal: use wait until scheme for read pflock eal: use wait until scheme for mcslock lib/bpf: use wait until scheme for Rx/Tx iteration lib/distributor: use wait until scheme lib/bpf/bpf_pkt.c | 11 +- lib/distributor/rte_distributor_single.c | 10 +- lib/eal/arm/include/rte_pause_64.h | 271 ++++++++++++++++---- lib/eal/include/generic/rte_mcslock.h | 9 +- lib/eal/include/generic/rte_pause.h | 309 +++++++++++++++++++++++ lib/eal/include/generic/rte_pflock.h | 5 +- 6 files changed, 543 insertions(+), 72 deletions(-)
Comments
On Thu, 2 Sep 2021 13:32:48 +0800 Feifei Wang <feifei.wang2@arm.com> wrote: > Add new API for wait_until scheme, and apply this new API into lib to > replace rte_pause. > > Feifei Wang (5): > eal: add new API for wait until scheme > eal: use wait until scheme for read pflock > eal: use wait until scheme for mcslock > lib/bpf: use wait until scheme for Rx/Tx iteration > lib/distributor: use wait until scheme > > lib/bpf/bpf_pkt.c | 11 +- > lib/distributor/rte_distributor_single.c | 10 +- > lib/eal/arm/include/rte_pause_64.h | 271 ++++++++++++++++---- > lib/eal/include/generic/rte_mcslock.h | 9 +- > lib/eal/include/generic/rte_pause.h | 309 +++++++++++++++++++++++ > lib/eal/include/generic/rte_pflock.h | 5 +- > 6 files changed, 543 insertions(+), 72 deletions(-) > Since these are all inline, would it be possible to make this a macro and have the caller pass a condition function? Look at Linux wait_event() for an example of that.
Hi, Stephen Thanks for the reviewing. I think it is a good comment. According to the comments, we plan to change this API as follow: #define wait_until_event_16(addr, mask, expected, op, memorder) uint16_t value __LOAD_EXC_16(addr, value, memorder) if ((value&mask) op expected) { __SEVL() do { __WFE() __LOAD_EXC_16(addr, value, memorder) } while ((value&mask) op expected); 1. According to the size, there will be three definitions: 16/32/64 bits 2. op is defined for a symbol(!= or ==), I'm not sure whether it is legal in dpdk. 3. If the case is not 'wait_part_equal/unequal', mask can be 0xFF. Have you any more comments for this change? Best Regards Feifei > -----邮件原件----- > 发件人: Stephen Hemminger <stephen@networkplumber.org> > 发送时间: Thursday, September 2, 2021 11:22 PM > 收件人: Feifei Wang <Feifei.Wang2@arm.com> > 抄送: dev@dpdk.org; nd <nd@arm.com> > 主题: Re: [dpdk-dev] [RFC PATCH v1 0/5] add new API for wait until scheme > > On Thu, 2 Sep 2021 13:32:48 +0800 > Feifei Wang <feifei.wang2@arm.com> wrote: > > > Add new API for wait_until scheme, and apply this new API into lib to > > replace rte_pause. > > > > Feifei Wang (5): > > eal: add new API for wait until scheme > > eal: use wait until scheme for read pflock > > eal: use wait until scheme for mcslock > > lib/bpf: use wait until scheme for Rx/Tx iteration > > lib/distributor: use wait until scheme > > > > lib/bpf/bpf_pkt.c | 11 +- > > lib/distributor/rte_distributor_single.c | 10 +- > > lib/eal/arm/include/rte_pause_64.h | 271 ++++++++++++++++---- > > lib/eal/include/generic/rte_mcslock.h | 9 +- > > lib/eal/include/generic/rte_pause.h | 309 +++++++++++++++++++++++ > > lib/eal/include/generic/rte_pflock.h | 5 +- > > 6 files changed, 543 insertions(+), 72 deletions(-) > > > > Since these are all inline, would it be possible to make this a macro and have > the caller pass a condition function? > > Look at Linux wait_event() for an example of that.