This series implements doorbell mapping feature for ifcvf.
Please help review
Thanks!
Chagnes from V1:
calculate the doorbell address per vq than per device(Jason)
let upper layer driver decide how to use the non page_size
aligned doorbell(Jason)
Zhu Lingshan (2):
vDPA/ifcvf: record virtio notify base
vDPA/ifcvf: implement doorbell mapping for ifcvf
drivers/vdpa/ifcvf/ifcvf_base.c | 4 ++++
drivers/vdpa/ifcvf/ifcvf_base.h | 2 ++
drivers/vdpa/ifcvf/ifcvf_main.c | 17 +++++++++++++++++
3 files changed, 23 insertions(+)
--
2.27.0
This commit implements doorbell mapping feature for ifcvf.
This feature maps the notify page to userspace, to eliminate
vmexit when kick a vq.
Signed-off-by: Zhu Lingshan <redacted>
---
drivers/vdpa/ifcvf/ifcvf_main.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
From: Jason Wang <hidden> Date: 2021-05-31 07:56:25
在 2021/5/31 下午3:33, Zhu Lingshan 写道:
quoted hunk
This commit implements doorbell mapping feature for ifcvf.
This feature maps the notify page to userspace, to eliminate
vmexit when kick a vq.
Signed-off-by: Zhu Lingshan <redacted>
---
drivers/vdpa/ifcvf/ifcvf_main.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
This commit implements doorbell mapping feature for ifcvf.
This feature maps the notify page to userspace, to eliminate
vmexit when kick a vq.
Signed-off-by: Zhu Lingshan <redacted>
---
drivers/vdpa/ifcvf/ifcvf_main.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c
b/drivers/vdpa/ifcvf/ifcvf_main.c
index ab0ab5cf0f6e..effb0e549135 100644
Let's leave the decision to upper layer by: (see
vp_vdpa_get_vq_notification)
area.addr = notify_pa;
area.size = notify_offset_multiplier;
Thanks
Hi Jason,
notify_offset_multiplier can be zero, means vqs share the same doorbell
address, distinguished by qid.
and in vdpa.c:
if (vma->vm_end - vma->vm_start != notify.size)
return -ENOTSUPP;
so a zero size would cause this feature failure.
mmap should work on at least a page, so if we really want "area.size =
notify_offset_multiplier;"
I think we should add some code in vdpa.c, like:
if(!notify.size)
notify.size = PAGE_SIZE;
sounds good?
Thanks
Zhu Lingshan
quoted
+
+ return area;
+}
+
/*
* IFCVF currently does't have on-chip IOMMU, so not
* implemented set_map()/dma_map()/dma_unmap()
From: Jason Wang <hidden> Date: 2021-06-01 03:32:07
在 2021/6/1 上午11:27, Zhu, Lingshan 写道:
On 5/31/2021 3:56 PM, Jason Wang wrote:
quoted
在 2021/5/31 下午3:33, Zhu Lingshan 写道:
quoted
This commit implements doorbell mapping feature for ifcvf.
This feature maps the notify page to userspace, to eliminate
vmexit when kick a vq.
Signed-off-by: Zhu Lingshan <redacted>
---
drivers/vdpa/ifcvf/ifcvf_main.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c
b/drivers/vdpa/ifcvf/ifcvf_main.c
index ab0ab5cf0f6e..effb0e549135 100644
Let's leave the decision to upper layer by: (see
vp_vdpa_get_vq_notification)
area.addr = notify_pa;
area.size = notify_offset_multiplier;
Thanks
Hi Jason,
notify_offset_multiplier can be zero, means vqs share the same
doorbell address, distinguished by qid.
and in vdpa.c:
if (vma->vm_end - vma->vm_start != notify.size)
return -ENOTSUPP;
so a zero size would cause this feature failure.
mmap should work on at least a page, so if we really want "area.size =
notify_offset_multiplier;"
I think we should add some code in vdpa.c, like:
if(!notify.size)
notify.size = PAGE_SIZE;
sounds good?
It's the responsibility of the driver to report a correct one. So I
think it's better to tweak it as:
area.size = notify_offset_multiplier ?: PAGE_SIZE;
Thanks
Thanks
Zhu Lingshan
quoted
quoted
+
+ return area;
+}
+
/*
* IFCVF currently does't have on-chip IOMMU, so not
* implemented set_map()/dma_map()/dma_unmap()