[dpdk-dev] 回复: [PATCH v1 2/2] test/ring: fix wrong param passed to the enqueue APIs

Feifei Wang Feifei.Wang2 at arm.com
Wed Jul 29 16:16:08 CEST 2020


Hi, David

> -----邮件原件-----
> 发件人: David Marchand <david.marchand at redhat.com>
> 发送时间: 2020年7月29日 21:48
> 收件人: Feifei Wang <Feifei.Wang2 at arm.com>
> 抄送: Honnappa Nagarahalli <Honnappa.Nagarahalli at arm.com>; Konstantin
> Ananyev <konstantin.ananyev at intel.com>; Gavin Hu <Gavin.Hu at arm.com>;
> Olivier Matz <olivier.matz at 6wind.com>; dev <dev at dpdk.org>; nd
> <nd at arm.com>; dpdk stable <stable at dpdk.org>
> 主题: Re: [dpdk-dev] [PATCH v1 2/2] test/ring: fix wrong param passed to the
> enqueue APIs
> 
> Hello Feifei,
> 
> On Wed, Jul 29, 2020 at 8:32 AM Feifei Wang <feifei.wang2 at arm.com>
> wrote:
> >
> > When enqueue one element (object of type void*) to ring in the
> > performance test, a pointer (the object to be enqueued) should be
> > passed to rte_ring_[sp|mp]enqueue APIs, not the pointer to a table of
> > void *pointers (objects).
> 
> Good catch.
Thanks very much.
> Are we missing a check in the UT so that dequeued object is what had been
> enqueued?
> 
>  
Dequeue is not necessary to change because the param defined in rte_ring_dequeue
is different from that in rte_ring_enqueue:
rte_ring_enqueue(struct rte_ring *r, void *obj): obj is a pointer (object) to be added in the ring
rte_ring_dequeue(struct rte_ring *r, void **obj_p): obj_p is a pointer to a void * pointer
(object) that will be filled.
> >
> > Fixes: a9fe152363e2 ("test/ring: add custom element size functional
> > tests")
> > Cc: honnappa.nagarahalli at arm.com
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: Feifei Wang <feifei.wang2 at arm.com>
> > Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
> > ---
> >  app/test/test_ring.h | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/app/test/test_ring.h b/app/test/test_ring.h index
> > aa6ae67ca..d4b15af7c 100644
> > --- a/app/test/test_ring.h
> > +++ b/app/test/test_ring.h
> > @@ -50,11 +50,11 @@ test_ring_enqueue(struct rte_ring *r, void **obj,
> int esize, unsigned int n,
> >         if ((esize) == -1)
> >                 switch (api_type) {
> >                 case (TEST_RING_THREAD_DEF | TEST_RING_ELEM_SINGLE):
> > -                       return rte_ring_enqueue(r, obj);
> > +                       return rte_ring_enqueue(r, *obj);
> >                 case (TEST_RING_THREAD_SPSC | TEST_RING_ELEM_SINGLE):
> > -                       return rte_ring_sp_enqueue(r, obj);
> > +                       return rte_ring_sp_enqueue(r, *obj);
> >                 case (TEST_RING_THREAD_MPMC | TEST_RING_ELEM_SINGLE):
> > -                       return rte_ring_mp_enqueue(r, obj);
> > +                       return rte_ring_mp_enqueue(r, *obj);
> >                 case (TEST_RING_THREAD_DEF | TEST_RING_ELEM_BULK):
> >                         return rte_ring_enqueue_bulk(r, obj, n, NULL);
> >                 case (TEST_RING_THREAD_SPSC | TEST_RING_ELEM_BULK):
> > --
> > 2.17.1
> >
> 
> 
> --
> David Marchand



More information about the dev mailing list