* [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks
@ 2021-03-17 5:40 Cheng Jiang
2021-03-17 6:58 ` Hu, Jiayu
2021-04-07 7:47 ` Maxime Coquelin
0 siblings, 2 replies; 7+ messages in thread
From: Cheng Jiang @ 2021-03-17 5:40 UTC (permalink / raw)
To: maxime.coquelin, chenbo.xia
Cc: dev, jiayu.hu, yvonnex.yang, yinan.wang, Cheng Jiang, stable
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: stable@dpdk.org
Signed-off-by: Cheng Jiang <Cheng1.jiang@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;
dma_info->nr++;
i++;
}
--
2.29.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks
2021-03-17 5:40 [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks Cheng Jiang
@ 2021-03-17 6:58 ` Hu, Jiayu
2021-04-07 7:47 ` Maxime Coquelin
1 sibling, 0 replies; 7+ messages in thread
From: Hu, Jiayu @ 2021-03-17 6:58 UTC (permalink / raw)
To: Jiang, Cheng1, maxime.coquelin, Xia, Chenbo
Cc: dev, Yang, YvonneX, Wang, Yinan, stable
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
> -----Original Message-----
> From: Jiang, Cheng1 <cheng1.jiang@intel.com>
> Sent: Wednesday, March 17, 2021 1:41 PM
> To: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; Yang, YvonneX
> <yvonnex.yang@intel.com>; Wang, Yinan <yinan.wang@intel.com>; Jiang,
> Cheng1 <cheng1.jiang@intel.com>; stable@dpdk.org
> Subject: [PATCH] examples/vhost: fix ioat ring space in callbacks
>
> 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: stable@dpdk.org
>
> Signed-off-by: Cheng Jiang <Cheng1.jiang@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;
> dma_info->nr++;
> i++;
> }
> --
> 2.29.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks
2021-03-17 5:40 [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks Cheng Jiang
2021-03-17 6:58 ` Hu, Jiayu
@ 2021-04-07 7:47 ` Maxime Coquelin
2021-04-07 7:54 ` Hu, Jiayu
2021-04-07 8:26 ` Thomas Monjalon
1 sibling, 2 replies; 7+ messages in thread
From: Maxime Coquelin @ 2021-04-07 7:47 UTC (permalink / raw)
To: Cheng Jiang, chenbo.xia, Thomas Monjalon
Cc: dev, jiayu.hu, yvonnex.yang, yinan.wang, stable
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: stable@dpdk.org
>
> Signed-off-by: Cheng Jiang <Cheng1.jiang@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?
> dma_info->nr++;
> i++;
> }
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks
2021-04-07 7:47 ` Maxime Coquelin
@ 2021-04-07 7:54 ` Hu, Jiayu
2021-04-07 8:26 ` Thomas Monjalon
1 sibling, 0 replies; 7+ messages in thread
From: Hu, Jiayu @ 2021-04-07 7:54 UTC (permalink / raw)
To: Maxime Coquelin, Jiang, Cheng1, Xia, Chenbo, Thomas Monjalon
Cc: dev, Yang, YvonneX, Wang, Yinan, stable
Hi Maxime,
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Wednesday, April 7, 2021 3:48 PM
> To: Jiang, Cheng1 <cheng1.jiang@intel.com>; Xia, Chenbo
> <chenbo.xia@intel.com>; Thomas Monjalon <thomas@monjalon.net>
> Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; Yang, YvonneX
> <yvonnex.yang@intel.com>; Wang, Yinan <yinan.wang@intel.com>;
> stable@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: stable@dpdk.org
> >
> > Signed-off-by: Cheng Jiang <Cheng1.jiang@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.richardson@intel.com/
Thanks,
Jiayu
>
> > dma_info->nr++;
> > i++;
> > }
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks
2021-04-07 7:47 ` Maxime Coquelin
2021-04-07 7:54 ` Hu, Jiayu
@ 2021-04-07 8:26 ` Thomas Monjalon
2021-04-07 8:43 ` Thomas Monjalon
2021-04-07 8:48 ` Maxime Coquelin
1 sibling, 2 replies; 7+ messages in thread
From: Thomas Monjalon @ 2021-04-07 8:26 UTC (permalink / raw)
To: Cheng Jiang, Maxime Coquelin, bruce.richardson
Cc: chenbo.xia, dev, jiayu.hu, yvonnex.yang, yinan.wang, alexr, shahafs
07/04/2021 09:47, Maxime Coquelin:
>
> 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: stable@dpdk.org
> >
> > Signed-off-by: Cheng Jiang <Cheng1.jiang@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?
Having a generic DMA API may be interesting.
Do you know any other HW candidate for such an API?
Do you think rte_memcpy can be used as a SW driver?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks
2021-04-07 8:26 ` Thomas Monjalon
@ 2021-04-07 8:43 ` Thomas Monjalon
2021-04-07 8:48 ` Maxime Coquelin
1 sibling, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2021-04-07 8:43 UTC (permalink / raw)
To: Maxime Coquelin, bruce.richardson, jerinj, andrew.rybchenko,
hemant.agrawal, nipun.gupta, g.singh, radhac, vburru
Cc: Cheng Jiang, dev, chenbo.xia, dev, jiayu.hu, yvonnex.yang,
yinan.wang, alexr, shahafs
+Cc more people to start a discussion about a potential DMA API.
If you think it is interesting, we can start a fresh discussion thread.
07/04/2021 10:26, Thomas Monjalon:
> 07/04/2021 09:47, Maxime Coquelin:
> >
> > 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.
[...]
> > > --- 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?
>
> Having a generic DMA API may be interesting.
> Do you know any other HW candidate for such an API?
> Do you think rte_memcpy can be used as a SW driver?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks
2021-04-07 8:26 ` Thomas Monjalon
2021-04-07 8:43 ` Thomas Monjalon
@ 2021-04-07 8:48 ` Maxime Coquelin
1 sibling, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2021-04-07 8:48 UTC (permalink / raw)
To: Thomas Monjalon, Cheng Jiang, bruce.richardson
Cc: chenbo.xia, dev, jiayu.hu, yvonnex.yang, yinan.wang, alexr, shahafs
On 4/7/21 10:26 AM, Thomas Monjalon wrote:
> 07/04/2021 09:47, Maxime Coquelin:
>>
>> 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: stable@dpdk.org
>>>
>>> Signed-off-by: Cheng Jiang <Cheng1.jiang@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?
>
> Having a generic DMA API may be interesting.
> Do you know any other HW candidate for such an API?
> Do you think rte_memcpy can be used as a SW driver?
Yes, I guess we could create a vdev driver with MEM_TO_MEM capability
using rte_memcpy().
Note that IOAT in the Kernel is supported by the DMA framework.
Regards,
Maxime
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-04-07 8:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17 5:40 [dpdk-dev] [PATCH] examples/vhost: fix ioat ring space in callbacks Cheng Jiang
2021-03-17 6:58 ` Hu, Jiayu
2021-04-07 7:47 ` Maxime Coquelin
2021-04-07 7:54 ` Hu, Jiayu
2021-04-07 8:26 ` Thomas Monjalon
2021-04-07 8:43 ` Thomas Monjalon
2021-04-07 8:48 ` Maxime Coquelin
DPDK patches and discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
dev@dpdk.org
public-inbox-index dev
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://inbox.dpdk.org/inbox.dpdk.dev
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git