Hi Maxime,

> -----Original Message-----
> From: Maxime Coquelin <maxime.coque...@redhat.com>
> Sent: Wednesday, April 7, 2021 3:48 PM
> To: Jiang, Cheng1 <cheng1.ji...@intel.com>; Xia, Chenbo
> <chenbo....@intel.com>; Thomas Monjalon <tho...@monjalon.net>
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu...@intel.com>; Yang, YvonneX
> <yvonnex.y...@intel.com>; Wang, Yinan <yinan.w...@intel.com>;
> sta...@dpdk.org
> Subject: Re: [PATCH] examples/vhost: fix ioat ring space in callbacks
> 
> 
> 
> On 3/17/21 6:40 AM, Cheng Jiang wrote:
> > We use ioat ring space for determining if ioat callbacks can enqueue a
> > packet to ioat device. But there is one slot can't be used in ioat
> > ring due to the ioat driver design, so we need to reduce one slot in
> > ioat ring to prevent ring size mismatch in ioat callbacks.
> >
> > Fixes: 2aa47e94bfb2 ("examples/vhost: add ioat ring space count and
> check")
> > Cc: sta...@dpdk.org
> >
> > Signed-off-by: Cheng Jiang <cheng1.ji...@intel.com>
> > ---
> >  examples/vhost/ioat.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c
> > index 60b73be93..9cb5e0d50 100644
> > --- a/examples/vhost/ioat.c
> > +++ b/examples/vhost/ioat.c
> > @@ -113,7 +113,7 @@ open_ioat(const char *value)
> >                     goto out;
> >             }
> >             rte_rawdev_start(dev_id);
> > -           cb_tracker[dev_id].ioat_space = IOAT_RING_SIZE;
> > +           cb_tracker[dev_id].ioat_space = IOAT_RING_SIZE - 1;
> 
> That really comforts me in thinking we need a generic abstraction for
> DMA devices. How is the application developer supposed to know that
> the DMA driver has such weird limitations?
> 
> Can the driver be fixed to have a proper behavior?

Here is the patch of providing capacity check API for DMA:
http://patches.dpdk.org/project/dpdk/patch/20210318182042.43658-6-bruce.richard...@intel.com/

Thanks,
Jiayu
> 
> >             dma_info->nr++;
> >             i++;
> >     }
> >

Reply via email to