DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Jerin Jacob <jerinjacobk@gmail.com>
Cc: dpdk-dev <dev@dpdk.org>, "Walsh, Conor" <conor.walsh@intel.com>,
	"Laatz, Kevin" <kevin.laatz@intel.com>,
	fengchengwen <fengchengwen@huawei.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Satananda Burla <sburla@marvell.com>
Subject: Re: [dpdk-dev] [PATCH v2 3/6] app/test: add basic dmadev copy tests
Date: Thu, 2 Sep 2021 09:06:26 +0100	[thread overview]
Message-ID: <YTCGAua0r+j/Z6Mw@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <CALBAE1P-84=KOyiiqZvb8aD=Yg2qVvXtNnwnUnSCBHDUeWsvxA@mail.gmail.com>

On Thu, Sep 02, 2021 at 01:14:38PM +0530, Jerin Jacob wrote:
> On Wed, Sep 1, 2021 at 10:02 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > For each dmadev instance, perform some basic copy tests to validate that
> > functionality.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  app/test/test_dmadev.c | 174 +++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 174 insertions(+)
> >
> > diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c
> > index 12f7c69629..261f45db71 100644
> > --- a/app/test/test_dmadev.c
> > +++ b/app/test/test_dmadev.c
> > @@ -2,12 +2,15 @@
> >   * Copyright(c) 2021 HiSilicon Limited.
> >   * Copyright(c) 2021 Intel Corporation.
> >   */
> > +#include <unistd.h>
> >  #include <inttypes.h>
> >
> >  #include <rte_common.h>
> >  #include <rte_dev.h>
> >  #include <rte_dmadev.h>
> >  #include <rte_bus_vdev.h>
> > +#include <rte_mbuf.h>
> > +#include <rte_random.h>
> >
> >  #include "test.h"
> >
> > @@ -16,6 +19,11 @@ extern int test_dmadev_api(uint16_t dev_id);
> >
> >  #define PRINT_ERR(...) print_err(__func__, __LINE__, __VA_ARGS__)
> >
> > +#define COPY_LEN 1024
> > +
> > +static struct rte_mempool *pool;
> > +static uint16_t id_count;
> > +
> >  static inline int
> >  __rte_format_printf(3, 4)
> >  print_err(const char *func, int lineno, const char *format, ...)
> > @@ -31,6 +39,134 @@ print_err(const char *func, int lineno, const char *format, ...)
> >         return ret;
> >  }
> >
> > +static inline void
> > +await_hw(int dev_id, uint16_t vchan)
> > +{
> > +       int idle = rte_dmadev_vchan_idle(dev_id, vchan);
> > +       if (idle < 0) {
> > +               /* for drivers that don't support this op, just sleep for 25 microseconds */
> > +               usleep(25);
> > +               return;
> > +       }
> 
> Can following model eliminate the need for rte_dmadev_vchan_idle() API. Right?
> 
> static inline bool
> await_hw(int dev_id, uint16_t vchan, uint16_t  nb_req, uint16_t *last_idx)
> {
>              const uint64_t tmo =   rte_get_timer_hz();
>              bool has_error  = false;
> 
>              const uint64_t end_cycles = rte_get_timer_cycles() + tmo;
>               while (rte_get_timer_cycles() < end_cycles && nb_req > 0
> && has_error  == false) {
>                            rte_pause();
>                            nb_req -= rte_dmadev_completed(dev_id,
> nb_req, last_idx, &has_error);
>               }
> 
>               return has_error ;
> }
>
It would, but unfortunately it also removes the possibility of doing a
number of the tests in the set, particularly around failure handling. We
used runtime coverage tools to ensure we were hitting as many legs of code
as possible in drivers, and to cover these possibilities we need to do
various different types of completion gathering, e.g. gather multiple
bursts in one go, gathering a single burst in two halves, gathering a burst
using completion_status rather than completion, gathering completions
one-at-a-time with a call for each individually, and for error handling
gathering just the failing element alone, or gathering completions for all
remaining elements not just the failing one, etc. etc. 

These tests are useful both for finding bugs (and they did find ones in our
drivers), but also to ensure similar behaviour across different drivers
using the API. However, they really only can be done in a consistent way if
we are able to ensure that at certain points the hardware has finished
processing before we begin gathering completions. Therefore, having a way
to poll for idle is useful. As you see, I've also left in the delay as a
fallback in case drivers choose not to implement it, thereby making it an
optional API.

Beyond testing, I can see the API to poll for idleness being useful for the
device shutdown case. I was considering whether the "stop" API should also
use it to ensure that the hardware is idle before stopping. I decided
against it for now, but you could see applications making use of this -
waiting for the hardware to finish its work before stopping it.

Regards,
/Bruce

  reply	other threads:[~2021-09-02  8:06 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 18:32 [dpdk-dev] [RFC PATCH 0/7] add test suite for DMA drivers Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 1/7] app/test: take API tests from skeleton dmadev Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 2/7] dmadev: remove selftest support Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 3/7] app/test: add basic dmadev instance tests Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 4/7] app/test: add basic dmadev copy tests Bruce Richardson
2021-08-27  7:14   ` Jerin Jacob
2021-08-27 10:41     ` Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 5/7] app/test: add more comprehensive " Bruce Richardson
2021-08-26 18:33 ` [dpdk-dev] [RFC PATCH 6/7] app/test: test dmadev instance failure handling Bruce Richardson
2021-08-26 18:33 ` [dpdk-dev] [RFC PATCH 7/7] app/test: add dmadev fill tests Bruce Richardson
2021-09-01 16:32 ` [dpdk-dev] [PATCH v2 0/6] add test suite for DMA drivers Bruce Richardson
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 1/6] dmadev: add device idle check for testing use Bruce Richardson
2021-09-02 12:54     ` fengchengwen
2021-09-02 14:21       ` Bruce Richardson
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 2/6] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-01 19:24     ` Mattias Rönnblom
2021-09-02 10:30       ` Bruce Richardson
2021-09-03 16:07     ` Conor Walsh
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 3/6] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-02  7:44     ` Jerin Jacob
2021-09-02  8:06       ` Bruce Richardson [this message]
2021-09-02 10:54         ` Jerin Jacob
2021-09-02 11:43           ` Bruce Richardson
2021-09-02 13:05             ` Jerin Jacob
2021-09-02 14:21               ` Bruce Richardson
2021-09-03 16:05     ` Kevin Laatz
2021-09-03 16:07     ` Conor Walsh
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 4/6] app/test: add more comprehensive " Bruce Richardson
2021-09-03 16:08     ` Conor Walsh
2021-09-03 16:11     ` Kevin Laatz
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 5/6] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-01 19:53     ` Mattias Rönnblom
2021-09-03 16:08     ` Conor Walsh
2021-09-03 16:21     ` Kevin Laatz
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 6/6] app/test: add dmadev fill tests Bruce Richardson
2021-09-03 16:09     ` Conor Walsh
2021-09-03 16:17       ` Conor Walsh
2021-09-03 16:33         ` Bruce Richardson
2021-09-07 16:49 ` [dpdk-dev] [PATCH v3 0/8] add test suite for DMA drivers Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 1/8] dmadev: add channel status check for testing use Bruce Richardson
2021-09-08 10:50     ` Walsh, Conor
2021-09-08 13:20     ` Kevin Laatz
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 2/8] dmadev: add burst capacity API Bruce Richardson
2021-09-08 10:53     ` Walsh, Conor
2021-09-08 18:17     ` Jerin Jacob
2021-09-09  8:16       ` Bruce Richardson
2021-09-17 13:54         ` Jerin Jacob
2021-09-17 14:37           ` Pai G, Sunil
2021-09-18 12:18             ` Jerin Jacob
2021-09-18  1:06           ` Hu, Jiayu
2021-09-18 12:12             ` Jerin Jacob
2021-09-21 13:57               ` Pai G, Sunil
2021-09-21 14:56                 ` Jerin Jacob
2021-09-21 15:34                   ` Pai G, Sunil
2021-09-21 16:58                     ` Jerin Jacob
2021-09-21 17:12                       ` Pai G, Sunil
2021-09-21 18:11                         ` Jerin Jacob
2021-09-22  1:51                           ` fengchengwen
2021-09-22  7:56                             ` Bruce Richardson
2021-09-22 16:35                               ` Bruce Richardson
2021-09-22 17:29                                 ` Jerin Jacob
2021-09-23 13:24                                   ` fengchengwen
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 3/8] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-08 13:21     ` Kevin Laatz
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 4/8] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 5/8] app/test: add more comprehensive " Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 6/8] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 7/8] app/test: add dmadev fill tests Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 8/8] app/test: add dmadev burst capacity API test Bruce Richardson
2021-09-08 11:03     ` Walsh, Conor
2021-09-17 13:30 ` [dpdk-dev] [PATCH v4 0/9] add test suite for DMA drivers Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 1/9] dmadev: add channel status check for testing use Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 2/9] dmadev: add burst capacity API Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 3/9] dmadev: add device iterator Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 4/9] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 5/9] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 6/9] app/test: add more comprehensive " Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 7/9] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 8/9] app/test: add dmadev fill tests Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 9/9] app/test: add dmadev burst capacity API test Bruce Richardson
2021-09-17 13:54 ` [dpdk-dev] [PATCH v5 0/9] add test suite for DMA drivers Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 1/9] dmadev: add channel status check for testing use Bruce Richardson
2021-09-22  8:25     ` fengchengwen
2021-09-22  8:31       ` Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 2/9] dmadev: add burst capacity API Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 3/9] dmadev: add device iterator Bruce Richardson
2021-09-22  8:46     ` fengchengwen
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 4/9] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 5/9] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 6/9] app/test: add more comprehensive " Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 7/9] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 8/9] app/test: add dmadev fill tests Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 9/9] app/test: add dmadev burst capacity API test Bruce Richardson
2021-09-24 10:29 ` [dpdk-dev] [PATCH v6 00/13] add test suite for DMA drivers Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 01/13] dmadev: add channel status check for testing use Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 02/13] dma/skeleton: add channel status function Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 03/13] dmadev: add burst capacity API Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 04/13] dma/skeleton: add burst capacity function Bruce Richardson
2021-09-24 14:51     ` Conor Walsh
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 05/13] dmadev: add device iterator Bruce Richardson
2021-09-24 14:52     ` Conor Walsh
2021-09-24 15:58     ` Kevin Laatz
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 06/13] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 07/13] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 08/13] app/test: run test suite on skeleton driver Bruce Richardson
2021-09-24 15:58     ` Kevin Laatz
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 09/13] app/test: add more comprehensive dmadev copy tests Bruce Richardson
2021-09-24 10:31   ` [dpdk-dev] [PATCH v6 10/13] dmadev: add flag for error handling support Bruce Richardson
2021-09-24 14:52     ` Conor Walsh
2021-09-24 15:58     ` Kevin Laatz
2021-09-24 10:31   ` [dpdk-dev] [PATCH v6 11/13] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-24 10:31   ` [dpdk-dev] [PATCH v6 12/13] app/test: add dmadev fill tests Bruce Richardson
2021-09-24 10:31   ` [dpdk-dev] [PATCH v6 13/13] app/test: add dmadev burst capacity API test Bruce Richardson
2021-10-13 15:17   ` [dpdk-dev] [PATCH v7 00/13] add test suite for DMA drivers Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 01/13] dmadev: add channel status check for testing use Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 02/13] dma/skeleton: add channel status function Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 03/13] dmadev: add burst capacity API Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 04/13] dma/skeleton: add burst capacity function Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 05/13] dmadev: add device iterator Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 06/13] app/test: add basic dmadev instance tests Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 07/13] app/test: add basic dmadev copy tests Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 08/13] app/test: run test suite on skeleton driver Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 09/13] app/test: add more comprehensive dmadev copy tests Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 10/13] dmadev: add flag for error handling support Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 11/13] app/test: test dmadev instance failure handling Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 12/13] app/test: add dmadev fill tests Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 13/13] app/test: add dmadev burst capacity API test Bruce Richardson
2021-10-18  9:20     ` [dpdk-dev] [PATCH v7 00/13] add test suite for DMA drivers Thomas Monjalon
2021-10-21 12:06       ` fengchengwen
2021-10-21 14:55         ` Bruce Richardson

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=YTCGAua0r+j/Z6Mw@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=conor.walsh@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=jerinj@marvell.com \
    --cc=jerinjacobk@gmail.com \
    --cc=kevin.laatz@intel.com \
    --cc=sburla@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).