* [dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk segments for DMA
@ 2020-05-15 11:01 wangyunjian
2020-09-21 13:04 ` Burakov, Anatoly
2021-04-06 5:24 ` Xia, Chenbo
0 siblings, 2 replies; 3+ messages in thread
From: wangyunjian @ 2020-05-15 11:01 UTC (permalink / raw)
To: dev; +Cc: anatoly.burakov, jerry.lilijun, xudingke, Yunjian Wang
From: Yunjian Wang <wangyunjian@huawei.com>
As all vfio_cfgs need to map all dpdk segments for DMA, but now only
default_vfio_cfg map it. This patch changes rte_vfio_setup_device()
as a default map, so that IOMMU progrming does notneed to map dpdk
segments separately.
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
lib/librte_eal/linux/eal_vfio.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c
index d26e1649a..46160c328 100644
--- a/lib/librte_eal/linux/eal_vfio.c
+++ b/lib/librte_eal/linux/eal_vfio.c
@@ -807,10 +807,7 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr,
* after registering callback, to prevent races
*/
rte_mcfg_mem_read_lock();
- if (vfio_cfg == default_vfio_cfg)
- ret = t->dma_map_func(vfio_container_fd);
- else
- ret = 0;
+ ret = t->dma_map_func(vfio_container_fd);
if (ret) {
RTE_LOG(ERR, EAL,
" %s DMA remapping failed, error %i (%s)\n",
--
2.23.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk segments for DMA
2020-05-15 11:01 [dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk segments for DMA wangyunjian
@ 2020-09-21 13:04 ` Burakov, Anatoly
2021-04-06 5:24 ` Xia, Chenbo
1 sibling, 0 replies; 3+ messages in thread
From: Burakov, Anatoly @ 2020-09-21 13:04 UTC (permalink / raw)
To: wangyunjian, dev, zhihong.wang; +Cc: jerry.lilijun, xudingke
On 15-May-20 12:01 PM, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> As all vfio_cfgs need to map all dpdk segments for DMA, but now only
> default_vfio_cfg map it. This patch changes rte_vfio_setup_device()
> as a default map, so that IOMMU progrming does notneed to map dpdk
> segments separately.
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
I'm pretty sure this was intentional. The other containers were supposed
to call DMA maps manually. That said, i would probably ask the original
submitter for the multi-container feature as i have only a vague idea of
usages for this API.
+Zhihong, as that's the closest i could find to a maintainer for this
functionality :)
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk segments for DMA
2020-05-15 11:01 [dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk segments for DMA wangyunjian
2020-09-21 13:04 ` Burakov, Anatoly
@ 2021-04-06 5:24 ` Xia, Chenbo
1 sibling, 0 replies; 3+ messages in thread
From: Xia, Chenbo @ 2021-04-06 5:24 UTC (permalink / raw)
To: wangyunjian, dev
Cc: Burakov, Anatoly, jerry.lilijun, xudingke, David Marchand, Wang,
Xiao W, 王志宏
Hi, Yunjian
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of wangyunjian
> Sent: Friday, May 15, 2020 7:02 PM
> To: dev@dpdk.org
> Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; jerry.lilijun@huawei.com;
> xudingke@huawei.com; Yunjian Wang <wangyunjian@huawei.com>
> Subject: [dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk
> segments for DMA
>
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> As all vfio_cfgs need to map all dpdk segments for DMA, but now only
> default_vfio_cfg map it. This patch changes rte_vfio_setup_device()
> as a default map, so that IOMMU progrming does notneed to map dpdk
> segments separately.
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
> lib/librte_eal/linux/eal_vfio.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c
> index d26e1649a..46160c328 100644
> --- a/lib/librte_eal/linux/eal_vfio.c
> +++ b/lib/librte_eal/linux/eal_vfio.c
> @@ -807,10 +807,7 @@ rte_vfio_setup_device(const char *sysfs_base, const char
> *dev_addr,
> * after registering callback, to prevent races
> */
> rte_mcfg_mem_read_lock();
> - if (vfio_cfg == default_vfio_cfg)
> - ret = t->dma_map_func(vfio_container_fd);
> - else
> - ret = 0;
> + ret = t->dma_map_func(vfio_container_fd);
Anatoly is correct, this is intentional for ifc vdpa. For vdpa/ifc, we need another vfio container
for vdpa device and the dma map info comes from QEMU/virtio-user, so this container will not use dpdk
memsegs. Your patch will break current ifc vdpa driver.
Thanks,
Chenbo
> if (ret) {
> RTE_LOG(ERR, EAL,
> " %s DMA remapping failed, error %i (%s)\n",
> --
> 2.23.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-06 5:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 11:01 [dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk segments for DMA wangyunjian
2020-09-21 13:04 ` Burakov, Anatoly
2021-04-06 5:24 ` Xia, Chenbo
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).