DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	Shijith Thotton <sthotton@marvell.com>,
	Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar Kokkilagadda <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Koteswara Rao Kottidi <skoteshwar@marvell.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [EXT] Re: [PATCH v2 3/3] event/cnxk: use WFE in Tx fc wait
Date: Fri, 16 Jun 2023 06:46:00 +0000	[thread overview]
Message-ID: <PH0PR18MB4086D36718002CA46E409419DE58A@PH0PR18MB4086.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20230615082857.6c76120d@hermes.local>

=
> On Tue, 13 Jun 2023 14:55:48 +0530
> <pbhagavatula@marvell.com> wrote:
> 
> >  static __rte_always_inline void
> >  cn10k_sso_txq_fc_wait(const struct cn10k_eth_txq *txq)
> >  {
> > +#ifdef RTE_ARCH_ARM64
> > +	uint64_t space;
> > +
> > +	asm volatile(PLT_CPU_FEATURE_PREAMBLE
> > +		     "		ldxr %[space], [%[addr]]		\n"
> > +		     "		cmp %[adj], %[space] 			\n"
> > +		     "		b.hi .Ldne%=				\n"
> > +		     "		sevl					\n"
> > +		     ".Lrty%=:	wfe					\n"
> > +		     "		ldxr %[space], [%[addr]]		\n"
> > +		     "		cmp %[adj], %[space]			\n"
> > +		     "		b.ls .Lrty%=				\n"
> > +		     ".Ldne%=:						\n"
> > +		     : [space] "=&r"(space)
> > +		     : [adj] "r"(txq->nb_sqb_bufs_adj), [addr] "r"(txq-
> >fc_mem)
> > +		     : "memory");
> > +#else
> >  	while ((uint64_t)txq->nb_sqb_bufs_adj <=
> >  	       __atomic_load_n(txq->fc_mem, __ATOMIC_RELAXED))
> >  		;
> > +#endif
> >  }
> 
> Rather than introduce assembly here, please extend existing rte_pause
> functions and then other drivers could benefit and it would fit
> existing WFE usage.
> 

Yes, a future patch is planned to replace this and other occurrences with 
RTE_WAIT_UNTIL_MASKED

> Something like:
> 
> static __rte_always_inline void
> rte_wait_until_le_32(volatile uint32_t *addr, uint32_t expected,
> 		int memorder);
> 
> Direct assembly in drivers is hard to maintain and should be forbidden.


      reply	other threads:[~2023-06-16  6:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 14:37 [PATCH 1/3] event/cnxk: align TX queue buffer adjustment pbhagavatula
2023-05-16 14:37 ` [PATCH 2/3] event/cnxk: use local labels in asm intrinsic pbhagavatula
2023-05-16 14:37 ` [PATCH 3/3] event/cnxk: use WFE in Tx fc wait pbhagavatula
2023-06-12 15:52 ` [PATCH 1/3] event/cnxk: align TX queue buffer adjustment Jerin Jacob
2023-06-13  9:25 ` [PATCH v2 " pbhagavatula
2023-06-13  9:25   ` [PATCH v2 2/3] event/cnxk: use local labels in asm intrinsic pbhagavatula
2023-06-13  9:25   ` [PATCH v2 3/3] event/cnxk: use WFE in Tx fc wait pbhagavatula
2023-06-14 10:33     ` Jerin Jacob
2023-06-14 18:27       ` Patrick Robb
2023-06-14 20:24         ` [EXT] " Pavan Nikhilesh Bhagavatula
2023-06-15  5:49         ` Jerin Jacob Kollanukkaran
2023-06-15 15:28     ` Stephen Hemminger
2023-06-16  6:46       ` Pavan Nikhilesh Bhagavatula [this message]

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=PH0PR18MB4086D36718002CA46E409419DE58A@PH0PR18MB4086.namprd18.prod.outlook.com \
    --to=pbhagavatula@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=stephen@networkplumber.org \
    --cc=sthotton@marvell.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).