DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Chautru, Nicolas" <nicolas.chautru@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"thomas@monjalon.net" <thomas@monjalon.net>
Cc: "trix@redhat.com" <trix@redhat.com>,
	"mdr@ashroe.eu" <mdr@ashroe.eu>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
	"david.marchand@redhat.com" <david.marchand@redhat.com>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"Vargas, Hernan" <hernan.vargas@intel.com>
Subject: RE: [PATCH v3 01/13] baseband/acc100: refactor to segregate common code
Date: Wed, 21 Sep 2022 21:25:41 +0000	[thread overview]
Message-ID: <BY5PR11MB4451D1E44064D10E57B5DB89F84F9@BY5PR11MB4451.namprd11.prod.outlook.com> (raw)
In-Reply-To: <58a28ff9-03a5-450c-6cbb-438f25c5dc36@redhat.com>

Hi Maxime, 

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Wednesday, September 21, 2022 12:13 AM
> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
> thomas@monjalon.net
> Cc: trix@redhat.com; mdr@ashroe.eu; Richardson, Bruce
> <bruce.richardson@intel.com>; hemant.agrawal@nxp.com;
> david.marchand@redhat.com; stephen@networkplumber.org; Vargas,
> Hernan <hernan.vargas@intel.com>
> Subject: Re: [PATCH v3 01/13] baseband/acc100: refactor to segregate
> common code
> 
> 
> 
> On 9/16/22 03:34, Nic Chautru wrote:
> > Refactoring all shareable common code to be used by future PMD
> > (including ACC200 in  this patchset as well as taking into account
> > following PMDs in roadmap) by gathering such structures or inline
> methods.
> > Cleaning up the enum files to remove un-used registers definitions.
> > No functionality change.
> >
> > Signed-off-by: Nic Chautru <nicolas.chautru@intel.com>
> 
> You usually sign-off with Nicolas, but some of the patches of this series are
> with Nic.
> 

OK

> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >   app/test-bbdev/test_bbdev_perf.c             |    6 +-
> >   drivers/baseband/acc100/acc100_pf_enum.h     |  939 -------------
> >   drivers/baseband/acc100/acc100_pmd.h         |  449 +------
> >   drivers/baseband/acc100/acc101_pmd.h         |   10 -
> >   drivers/baseband/acc100/acc_common.h         | 1388
> +++++++++++++++++++
> >   drivers/baseband/acc100/rte_acc100_cfg.h     |   70 +-
> >   drivers/baseband/acc100/rte_acc100_pmd.c     | 1856 ++++++++-----------
> -------
> >   drivers/baseband/acc100/rte_acc_common_cfg.h |  101 ++
> >   8 files changed, 2069 insertions(+), 2750 deletions(-)
> >   create mode 100644 drivers/baseband/acc100/acc_common.h
> >   create mode 100644 drivers/baseband/acc100/rte_acc_common_cfg.h
> 
> Overall, I think the patch should be split.
> For example:
> - One patch for rings rework as it introduces new helpers (and this patch
> should make use of them in ACC100).

Actually that ring rework is on the other serie specific to ACC100. Still I can remove the function from acc_common.h which are not used yet, and only add them for ACC200. 

> - One patch for the structs renaming and move to common file.

This is 90% of the content of that commit

> - One patch for registers

Can do. 

> - ...

What else you have in mind?

> 
> It will make easier for the reviewer to identify discrepancies, and also will
> help to identify regressions when using git bisect.
> 
> I have not done a full review of this patch, but something caught my eye wrt
> to available entries calculation in rings:
> 
> > diff --git a/drivers/baseband/acc100/acc100_pf_enum.h
> > b/drivers/baseband/acc100/acc100_pf_enum.h
> > index 2fba667..f4e5002 100644
> > --- a/drivers/baseband/acc100/acc100_pf_enum.h
> > +++ b/drivers/baseband/acc100/acc100_pf_enum.h
> > @@ -14,32 +14,6 @@
> 
> ...
> 
> > +
> > +/* Number of available descriptor in ring to enqueue */ static inline
> > +uint32_t acc_ring_avail_enq(struct acc_queue *q) {
> > +	return (q->sw_ring_depth - 1 + q->sw_ring_tail - q->sw_ring_head) %
> > +q->sw_ring_depth; }
> > +
> > +/* Number of available descriptor in ring to dequeue */ static inline
> > +uint32_t acc_ring_avail_deq(struct acc_queue *q) {
> > +	return (q->sw_ring_depth + q->sw_ring_head - q->sw_ring_tail) %
> > +q->sw_ring_depth; }
> 
> It is surprising to me that the number of available descriptors calculation for
> enqueue and dequeue are différent. Could you please explain why there a
> off-by-one delta between enc and dec?
> 
> If we look at other avail calculations in ACC100 enqueue, we get this:
> int32_t avail = q->sw_ring_depth + q->sw_ring_tail - q->sw_ring_head; It
> looks like there is indeed a off-by-one delta even for different avail enqueue
> calculation.
> 
> Also, these new helpers are introduced but are not used in the patch.

I can remove and only add when ACC200 uses them.
With regards to the code itself they are different number on purpose and not just off by one, there are the quasi complement of each other (note head - tail vs tail -head).
There was a bug indeed in the ACC100 implementation. But again this not addressed by this serie.

Thanks
Nic



  reply	other threads:[~2022-09-21 21:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  1:34 From: Nic Chautru <nicolas.chautru@intel.com> Nic Chautru
2022-09-16  1:34 ` [PATCH v3 01/13] baseband/acc100: refactor to segregate common code Nic Chautru
2022-09-21  7:13   ` Maxime Coquelin
2022-09-21 21:25     ` Chautru, Nicolas [this message]
2022-09-16  1:34 ` [PATCH v3 02/13] baseband/acc200: introduce PMD for ACC200 Nic Chautru
2022-09-21  7:17   ` Maxime Coquelin
2022-09-21 23:34     ` Chautru, Nicolas
2022-09-16  1:34 ` [PATCH v3 03/13] baseband/acc200: add HW register definitions Nic Chautru
2022-09-16  1:34 ` [PATCH v3 04/13] baseband/acc200: add info get function Nic Chautru
2022-09-16  1:34 ` [PATCH v3 05/13] baseband/acc200: add queue configuration Nic Chautru
2022-09-16  1:34 ` [PATCH v3 06/13] baseband/acc200: add LDPC processing functions Nic Chautru
2022-09-16  1:35 ` [PATCH v3 07/13] baseband/acc200: add LTE " Nic Chautru
2022-09-16  1:35 ` [PATCH v3 08/13] baseband/acc200: add support for FFT operations Nic Chautru
2022-09-16  1:35 ` [PATCH v3 09/13] baseband/acc200: support interrupt Nic Chautru
2022-09-16  1:35 ` [PATCH v3 10/13] baseband/acc200: add device status and vf2pf comms Nic Chautru
2022-09-16  1:35 ` [PATCH v3 11/13] baseband/acc200: add PF configure companion function Nic Chautru
2022-09-16  1:35 ` [PATCH v3 12/13] baseband/acc: rename and merge directories into acc Nic Chautru
2022-09-16  1:35 ` [PATCH v3 13/13] baseband/acc: simplify meson dependency Nic Chautru

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=BY5PR11MB4451D1E44064D10E57B5DB89F84F9@BY5PR11MB4451.namprd11.prod.outlook.com \
    --to=nicolas.chautru@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=hernan.vargas@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mdr@ashroe.eu \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    --cc=trix@redhat.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).