DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	David Marchand <david.marchand@redhat.com>,
	 "dev@dpdk.org" <dev@dpdk.org>, "nd@arm.com" <nd@arm.com>,
	Gavin Hu <gavin.hu@arm.com>,
	 "Mcnamara, John" <john.mcnamara@intel.com>,
	"Kovacevic, Marko" <marko.kovacevic@intel.com>,
	 Jerin Jacob <jerinj@marvell.com>,
	Jan Viktorin <viktorin@rehivetech.com>
Subject: Re: [dpdk-dev] [PATCH v13 2/5] eal: add the APIs to wait until equal
Date: Mon, 11 Nov 2019 10:41:40 +0530	[thread overview]
Message-ID: <CALBAE1NgoA2uFs3OJwg1QjD7=PtSp8LH0BqzEqdT8KgDxVWfug@mail.gmail.com> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB97725801A8C83A2B@IRSMSX104.ger.corp.intel.com>

On Sat, Nov 9, 2019 at 12:07 AM Ananyev, Konstantin
<konstantin.ananyev@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Thomas Monjalon <thomas@monjalon.net>
> > Sent: Friday, November 8, 2019 5:00 PM
> > To: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> > Cc: David Marchand <david.marchand@redhat.com>; dev@dpdk.org; nd@arm.com; Gavin Hu <gavin.hu@arm.com>; Mcnamara, John
> > <john.mcnamara@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>; Jerin Jacob <jerinj@marvell.com>; Jan Viktorin
> > <viktorin@rehivetech.com>
> > Subject: Re: [PATCH v13 2/5] eal: add the APIs to wait until equal
> >
> > 08/11/2019 17:38, Ananyev, Konstantin:
> > > > From: Gavin Hu <gavin.hu@arm.com>
> > > > +static __rte_always_inline void
> > > > +rte_wait_until_equal_64(volatile uint64_t *addr, uint64_t expected,
> > > > +         int memorder)
> > > > +{
> > > > + uint64_t value;
> > > > +
> > > > + assert(memorder == __ATOMIC_ACQUIRE || memorder == __ATOMIC_RELAXED);
> > > > +
> > > > + /*
> > > > +  * Atomic exclusive load from addr, it returns the 64-bit content of
> > > > +  * *addr while making it 'monitored',when it is written by someone
> > > > +  * else, the 'monitored' state is cleared and a event is generated
> > > > +  * implicitly to exit WFE.
> > > > +  */
> > > > +#define __LOAD_EXC_64(src, dst, memorder) {              \
> > > > + if (memorder == __ATOMIC_RELAXED) {              \
> > > > +         asm volatile("ldxr %x[tmp], [%x[addr]]"  \
> > > > +                 : [tmp] "=&r" (dst)              \
> > > > +                 : [addr] "r"(src)                \
> > > > +                 : "memory");                     \
> > > > + } else {                                         \
> > > > +         asm volatile("ldaxr %x[tmp], [%x[addr]]" \
> > > > +                 : [tmp] "=&r" (dst)              \
> > > > +                 : [addr] "r"(src)                \
> > > > +                 : "memory");                     \
> > > > + } }
> > > > +
> > > > + __LOAD_EXC_64(addr, value, memorder)
> > > > + if (value != expected) {
> > > > +         __SEVL()
> > > > +         do {
> > > > +                 __WFE()
> > > > +                 __LOAD_EXC_64(addr, value, memorder)
> > > > +         } while (value != expected);
> > > > + }
> > > > +}
> > > > +#undef __LOAD_EXC_64
> > > > +
> > > > +#undef __SEVL
> > > > +#undef __WFE
> > >
> > > Personally I don't see how these define/undef are better then inline functions...
> >
> > The benefit it to not pollute the API namespace
> > with some functions which are used only locally.
> > After using a macro, it disappears with #undef.
> >
> > > Again I suppose they might be re-used in future some other ARM specific low-level primitvies.
> >
> > Do this low-level routines _LOAD_EXC_ need to be exposed in EAL for re-use?
>
> About load_exc don't know for sure...
> Though as I can see wfe/sevl are used here:
> http://patchwork.dpdk.org/patch/61779/
> Might be it is possible to reuse these functions/macros...
> But again, I am not arm expert, would be interested to know what arm guys think.


Considering WFE has a requirement on using load_exec on ARM so IMO, it
makes sense to expose
load_exec in conjunction with wfe/sevl to use it properly.



>
> >
> > > My preference would be to keep them as inline function - much cleaner code.
> > > But as I don't develop for/use, I wouldn't insist and let you and arm guys to decide.
> >
> >
>

  reply	other threads:[~2019-11-11  5:12 UTC|newest]

Thread overview: 168+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-30 16:21 [dpdk-dev] [RFC 0/5] use WFE for locks and ring on aarch64 Gavin Hu
2019-06-30 16:21 ` [dpdk-dev] [RFC 1/5] eal: add the APIs to wait until equal Gavin Hu
2019-06-30 20:27   ` Stephen Hemminger
2019-07-01  7:16     ` Gavin Hu (Arm Technology China)
2019-07-01  7:43       ` Thomas Monjalon
2019-07-02 14:07         ` Gavin Hu (Arm Technology China)
2019-07-01  9:58   ` Pavan Nikhilesh Bhagavatula
2019-07-02 14:08     ` Gavin Hu (Arm Technology China)
2019-06-30 16:21 ` [dpdk-dev] [RFC 2/5] ticketlock: use new API to reduce contention on aarch64 Gavin Hu
2019-06-30 16:21 ` [dpdk-dev] [RFC 3/5] ring: use wfe to wait for ring tail update " Gavin Hu
2019-06-30 16:21 ` [dpdk-dev] [RFC 4/5] spinlock: use wfe to reduce contention " Gavin Hu
2019-06-30 16:21 ` [dpdk-dev] [RFC 5/5] config: add WFE config entry for aarch64 Gavin Hu
2019-06-30 20:29 ` [dpdk-dev] [RFC 0/5] use WFE for locks and ring on aarch64 Stephen Hemminger
2019-07-01  9:12   ` Gavin Hu (Arm Technology China)
2019-07-03  8:58 ` [dpdk-dev] [RFC v2 " Gavin Hu
2019-07-03  8:58 ` [dpdk-dev] [RFC v2 1/5] eal: add the APIs to wait until equal Gavin Hu
2019-07-20  6:46   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2019-07-03  8:58 ` [dpdk-dev] [RFC v2 2/5] ticketlock: use new API to reduce contention on aarch64 Gavin Hu
2019-07-20  6:57   ` Pavan Nikhilesh Bhagavatula
2019-07-03  8:58 ` [dpdk-dev] [RFC v2 3/5] ring: use wfe to wait for ring tail update " Gavin Hu
2019-07-03  8:58 ` [dpdk-dev] [RFC v2 4/5] spinlock: use wfe to reduce contention " Gavin Hu
2019-07-20  6:59   ` Pavan Nikhilesh Bhagavatula
2019-07-03  8:58 ` [dpdk-dev] [RFC v2 5/5] config: add WFE config entry for aarch64 Gavin Hu
2019-07-20  7:03   ` Pavan Nikhilesh Bhagavatula
2019-07-23 15:47     ` Gavin Hu (Arm Technology China)
2019-07-23 15:43 ` [dpdk-dev] [PATCH v3 0/5] use WFE for locks and ring on aarch64 Gavin Hu
2019-07-23 19:15   ` Honnappa Nagarahalli
2019-07-23 21:27     ` Thomas Monjalon
2019-07-24  2:44       ` Honnappa Nagarahalli
2019-07-24  7:43         ` Thomas Monjalon
2019-07-23 15:43 ` [dpdk-dev] [PATCH v3 1/5] eal: add the APIs to wait until equal Gavin Hu
2019-07-24 11:52   ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
2019-07-24 18:10     ` Gavin Hu (Arm Technology China)
2019-07-23 15:43 ` [dpdk-dev] [PATCH v3 2/5] ticketlock: use new API to reduce contention on aarch64 Gavin Hu
2019-07-23 15:43 ` [dpdk-dev] [PATCH v3 3/5] ring: use wfe to wait for ring tail update " Gavin Hu
2019-07-23 15:43 ` [dpdk-dev] [PATCH v3 4/5] spinlock: use wfe to reduce contention " Gavin Hu
2019-07-24 12:17   ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
2019-07-23 15:43 ` [dpdk-dev] [PATCH v3 5/5] config: add WFE config entry for aarch64 Gavin Hu
2019-07-23 18:05   ` Stephen Hemminger
2019-07-23 19:10     ` Honnappa Nagarahalli
2019-07-24 17:59       ` Gavin Hu (Arm Technology China)
2019-07-24 12:25   ` [dpdk-dev] [EXT] " Jerin Jacob Kollanukkaran
2019-08-22  6:12 ` [dpdk-dev] [PATCH v4 0/6] use WFE for locks and ring on aarch64 Gavin Hu
2019-10-16  8:08   ` David Marchand
2019-10-24 20:26     ` David Christensen
2019-08-22  6:12 ` [dpdk-dev] [PATCH v4 1/6] bus/fslmc: fix the conflicting dmb function Gavin Hu
2019-08-22  6:12 ` [dpdk-dev] [PATCH v4 2/6] eal: add the APIs to wait until equal Gavin Hu
2019-09-11 12:26   ` Jerin Jacob
2019-09-12  8:25     ` Gavin Hu (Arm Technology China)
2019-08-22  6:12 ` [dpdk-dev] [PATCH v4 3/6] ticketlock: use new API to reduce contention on aarch64 Gavin Hu
2019-08-22  6:12 ` [dpdk-dev] [PATCH v4 4/6] ring: use wfe to wait for ring tail update " Gavin Hu
2019-08-22  6:12 ` [dpdk-dev] [PATCH v4 5/6] spinlock: use wfe to reduce contention " Gavin Hu
     [not found]   ` <CY4PR1801MB1863AF9695BB10930E817D78DEB00@CY4PR1801MB1863.namprd18.prod.outlook.com>
     [not found]     ` <VI1PR08MB5376BEBCC1FD1E03F0B8A8848FB00@VI1PR08MB5376.eurprd08.prod.outlook.com>
2019-09-14 15:21       ` [dpdk-dev] [EXT] " Gavin Hu (Arm Technology China)
2019-08-22  6:12 ` [dpdk-dev] [PATCH v4 6/6] config: add WFE config entry for aarch64 Gavin Hu
2019-09-12 11:24 ` [dpdk-dev] [PATCH v5 0/8] use WFE " Gavin Hu
2019-09-12 11:24 ` [dpdk-dev] [PATCH v5 1/8] config: add WFE config entry " Gavin Hu
2019-09-12 15:48   ` Jerin Jacob
2019-09-13 16:01     ` Gavin Hu (Arm Technology China)
2019-09-12 11:24 ` [dpdk-dev] [PATCH v5 2/8] bus/fslmc: fix the conflicting dmb function Gavin Hu
2019-09-12 11:24 ` [dpdk-dev] [PATCH v5 3/8] eal: add the APIs to wait until equal Gavin Hu
2019-09-12 16:11   ` Jerin Jacob
2019-09-13 17:05     ` Gavin Hu (Arm Technology China)
2019-09-12 11:24 ` [dpdk-dev] [PATCH v5 4/8] spinlock: use wfe to reduce contention on aarch64 Gavin Hu
2019-09-12 11:24 ` [dpdk-dev] [PATCH v5 5/8] ticketlock: use new API " Gavin Hu
2019-09-12 16:14   ` Jerin Jacob
2019-09-12 11:24 ` [dpdk-dev] [PATCH v5 6/8] ring: use wfe to wait for ring tail update " Gavin Hu
2019-09-12 11:24 ` [dpdk-dev] [PATCH v5 7/8] net/thunderx: use new API to save cycles " Gavin Hu
2019-09-12 16:15   ` Jerin Jacob
2019-09-12 11:24 ` [dpdk-dev] [PATCH v5 8/8] event/opdl: " Gavin Hu
2019-09-12 16:16   ` Jerin Jacob
2019-09-14 14:59 ` [dpdk-dev] [PATCH v6 0/7] use WFE for aarch64 Gavin Hu
2019-09-26 13:41   ` Jerin Jacob
2019-09-27  5:45     ` Gavin Hu (Arm Technology China)
2019-09-14 14:59 ` [dpdk-dev] [PATCH v6 1/7] bus/fslmc: fix the conflicting dmb function Gavin Hu
2019-09-14 14:59 ` [dpdk-dev] [PATCH v6 2/7] eal: add the APIs to wait until equal Gavin Hu
2019-09-14 14:59 ` [dpdk-dev] [PATCH v6 3/7] spinlock: use wfe to reduce contention on aarch64 Gavin Hu
2019-09-14 14:59 ` [dpdk-dev] [PATCH v6 4/7] ticketlock: use new API " Gavin Hu
2019-09-14 14:59 ` [dpdk-dev] [PATCH v6 5/7] ring: use wfe to wait for ring tail update " Gavin Hu
2019-09-14 14:59 ` [dpdk-dev] [PATCH v6 6/7] net/thunderx: use new API to save cycles " Gavin Hu
2019-09-14 14:59 ` [dpdk-dev] [PATCH v6 7/7] event/opdl: " Gavin Hu
2019-09-27  5:41 ` [dpdk-dev] [PATCH v7 0/7] use WFE for aarch64 Gavin Hu
2019-10-17 18:37   ` David Marchand
2019-09-27  5:41 ` [dpdk-dev] [PATCH v7 1/7] bus/fslmc: fix the conflicting dmb function Gavin Hu
2019-09-27  8:24   ` Hemant Agrawal
2019-10-17 15:06   ` David Marchand
2019-09-27  5:41 ` [dpdk-dev] [PATCH v7 2/7] eal: add the APIs to wait until equal Gavin Hu
2019-09-27 11:03   ` Jerin Jacob
2019-10-17 13:14   ` Ananyev, Konstantin
2019-10-21  7:21     ` Gavin Hu (Arm Technology China)
2019-10-17 15:45   ` David Marchand
2019-10-21  7:38     ` Gavin Hu (Arm Technology China)
2019-10-21 19:17       ` David Marchand
2019-10-17 16:44   ` Ananyev, Konstantin
2019-10-23 16:20     ` Gavin Hu (Arm Technology China)
2019-10-23 16:29       ` Gavin Hu (Arm Technology China)
2019-10-24 10:21         ` Ananyev, Konstantin
2019-10-24 10:52           ` Gavin Hu (Arm Technology China)
2019-09-27  5:41 ` [dpdk-dev] [PATCH v7 3/7] spinlock: use wfe to reduce contention on aarch64 Gavin Hu
2019-10-17 18:27   ` David Marchand
2019-10-18  5:45     ` Gavin Hu (Arm Technology China)
2019-10-21  7:27     ` Gavin Hu (Arm Technology China)
2019-09-27  5:41 ` [dpdk-dev] [PATCH v7 4/7] ticketlock: use new API " Gavin Hu
2019-09-27  5:41 ` [dpdk-dev] [PATCH v7 5/7] ring: use wfe to wait for ring tail update " Gavin Hu
2019-09-27  5:41 ` [dpdk-dev] [PATCH v7 6/7] net/thunderx: use new API to save cycles " Gavin Hu
2019-09-27  5:41 ` [dpdk-dev] [PATCH v7 7/7] event/opdl: " Gavin Hu
2019-10-21  9:47 ` [dpdk-dev] [PATCH v8 0/6] use WFE for aarch64 Gavin Hu
2019-10-21  9:47 ` [dpdk-dev] [PATCH v8 1/6] bus/fslmc: fix the conflicting dmb function Gavin Hu
2019-10-21 19:00   ` David Marchand
2019-10-21  9:47 ` [dpdk-dev] [PATCH v8 2/6] eal: add the APIs to wait until equal Gavin Hu
2019-10-21 19:19   ` David Marchand
2019-10-22  9:36     ` Ananyev, Konstantin
2019-10-22 10:17       ` David Marchand
2019-10-22 16:05         ` Gavin Hu (Arm Technology China)
2019-10-22 16:03       ` Gavin Hu (Arm Technology China)
2019-10-21  9:47 ` [dpdk-dev] [PATCH v8 3/6] spinlock: use wfe to reduce contention on aarch64 Gavin Hu
2019-10-21  9:47 ` [dpdk-dev] [PATCH v8 4/6] ticketlock: use new API " Gavin Hu
2019-10-21  9:47 ` [dpdk-dev] [PATCH v8 5/6] net/thunderx: use new API to save cycles " Gavin Hu
2019-10-21  9:47 ` [dpdk-dev] [PATCH v8 6/6] event/opdl: " Gavin Hu
2019-10-24 10:42 ` [dpdk-dev] [PATCH v9 0/5] use WFE for aarch64 Gavin Hu
2019-10-24 10:42 ` [dpdk-dev] [PATCH v9 1/5] bus/fslmc: fix the conflicting dmb function Gavin Hu
2019-10-24 10:42 ` [dpdk-dev] [PATCH v9 2/5] eal: add the APIs to wait until equal Gavin Hu
2019-10-24 13:52   ` Ananyev, Konstantin
2019-10-24 13:57     ` Ananyev, Konstantin
2019-10-24 17:00     ` Gavin Hu (Arm Technology China)
2019-10-24 10:42 ` [dpdk-dev] [PATCH v9 3/5] ticketlock: use new API to reduce contention on aarch64 Gavin Hu
2019-10-24 10:42 ` [dpdk-dev] [PATCH v9 4/5] net/thunderx: use new API to save cycles " Gavin Hu
2019-10-24 10:42 ` [dpdk-dev] [PATCH v9 5/5] event/opdl: " Gavin Hu
2019-10-25 15:39 ` [dpdk-dev] [PATCH v10 0/5] use WFE for aarch64 Gavin Hu
2019-10-25 15:39 ` [dpdk-dev] [PATCH v10 1/5] bus/fslmc: fix the conflicting dmb function Gavin Hu
2019-10-25 15:39 ` [dpdk-dev] [PATCH v10 2/5] eal: add the APIs to wait until equal Gavin Hu
2019-10-25 17:27   ` Ananyev, Konstantin
2019-10-27 13:03     ` Gavin Hu (Arm Technology China)
2019-10-25 15:39 ` [dpdk-dev] [PATCH v10 3/5] ticketlock: use new API to reduce contention on aarch64 Gavin Hu
2019-10-25 15:39 ` [dpdk-dev] [PATCH v10 4/5] net/thunderx: use new API to save cycles " Gavin Hu
2019-10-25 15:39 ` [dpdk-dev] [PATCH v10 5/5] event/opdl: " Gavin Hu
2019-10-27 12:52 ` [dpdk-dev] [PATCH v11 0/5] use WFE for aarch64 Gavin Hu
2019-10-27 12:52 ` [dpdk-dev] [PATCH v11 1/5] bus/fslmc: fix the conflicting dmb function Gavin Hu
2019-10-27 12:52 ` [dpdk-dev] [PATCH v11 2/5] eal: add the APIs to wait until equal Gavin Hu
2019-10-27 20:49   ` David Marchand
2019-10-28  5:08     ` Gavin Hu (Arm Technology China)
2019-10-27 22:19   ` Ananyev, Konstantin
2019-10-28  5:04     ` Gavin Hu (Arm Technology China)
2019-10-27 12:52 ` [dpdk-dev] [PATCH v11 3/5] ticketlock: use new API to reduce contention on aarch64 Gavin Hu
2019-10-27 12:52 ` [dpdk-dev] [PATCH v11 4/5] net/thunderx: use new API to save cycles " Gavin Hu
2019-10-27 12:52 ` [dpdk-dev] [PATCH v11 5/5] event/opdl: " Gavin Hu
2019-11-04 15:32 ` [dpdk-dev] [PATCH v12 0/5] use WFE for aarch64 Gavin Hu
2019-11-04 15:32 ` [dpdk-dev] [PATCH v12 1/5] bus/fslmc: fix the conflicting dmb function Gavin Hu
2019-11-04 15:32 ` [dpdk-dev] [PATCH v12 2/5] eal: add the APIs to wait until equal Gavin Hu
2019-11-07 15:03   ` Ananyev, Konstantin
2019-11-04 15:32 ` [dpdk-dev] [PATCH v12 3/5] ticketlock: use new API to reduce contention on aarch64 Gavin Hu
2019-11-04 15:32 ` [dpdk-dev] [PATCH v12 4/5] net/thunderx: use new API to save cycles " Gavin Hu
2019-11-04 15:32 ` [dpdk-dev] [PATCH v12 5/5] event/opdl: " Gavin Hu
2019-11-07 21:35 ` [dpdk-dev] [PATCH v13 0/5] use WFE for aarch64 David Marchand
2019-11-07 21:35   ` [dpdk-dev] [PATCH v13 1/5] bus/fslmc: fix the conflicting dmb function David Marchand
2019-12-10  6:13     ` Honnappa Nagarahalli
2019-11-07 21:35   ` [dpdk-dev] [PATCH v13 2/5] eal: add the APIs to wait until equal David Marchand
2019-11-08 16:38     ` Ananyev, Konstantin
2019-11-08 17:00       ` Thomas Monjalon
2019-11-08 18:36         ` Ananyev, Konstantin
2019-11-11  5:11           ` Jerin Jacob [this message]
2019-11-11  5:51             ` Gavin Hu (Arm Technology China)
2019-12-10  7:51               ` Honnappa Nagarahalli
2020-01-16 21:38                 ` David Marchand
2020-01-17  2:46                   ` Gavin Hu
2019-11-07 21:35   ` [dpdk-dev] [PATCH v13 3/5] ticketlock: use new API to reduce contention on aarch64 David Marchand
2019-11-07 21:35   ` [dpdk-dev] [PATCH v13 4/5] net/thunderx: use new API to save cycles " David Marchand
2019-11-07 21:35   ` [dpdk-dev] [PATCH v13 5/5] event/opdl: " David Marchand
2020-01-17 11:15   ` [dpdk-dev] [PATCH v13 0/5] use WFE for aarch64 David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALBAE1NgoA2uFs3OJwg1QjD7=PtSp8LH0BqzEqdT8KgDxVWfug@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gavin.hu@arm.com \
    --cc=jerinj@marvell.com \
    --cc=john.mcnamara@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=nd@arm.com \
    --cc=thomas@monjalon.net \
    --cc=viktorin@rehivetech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).