From: Jason Wang <jasowang@redhat.com>
To: mst@redhat.com, virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Cc: rob.miller@broadcom.com, lingshan.zhu@intel.com,
eperezma@redhat.com, lulu@redhat.com, shahafs@mellanox.com,
hanand@xilinx.com, mhabets@solarflare.com, gdawar@xilinx.com,
saugatm@xilinx.com, vmireyno@marvell.com,
zhangweining@ruijie.com.cn, eli@mellanox.com,
Jason Wang <jasowang@redhat.com>
Subject: [PATCH 0/5]
Date: Wed, 1 Jul 2020 17:08:34 +0800 [thread overview]
Message-ID: <20200701090839.12994-1-jasowang@redhat.com> (raw)
Hi all:
This series tries to support batched IOTLB updating vhost-vdpa.
Currently vhost-vdpa accepts userspace mapping via IOTLB API, and it
can only forward one mapping to IOMMU or device through IOMMU API or
dma_map(). Though set_map() is designed to have the capability to pass
an rbtree based mapping to vDPA device, it's still be called at least
once for each VHOST_IOTLB_UPDATE or VHOST_IOTLB_INVALIDATE. This is
because vhost-vdpa doesn't know the userspace start or stop then
updating.
So this patch introduces two flags as hints for vhost-vdpa to call
set_map() only when userspace finish a batch of IOTLB updating.
So instead of:
1) VHOST_IOTLB_UPDATE/VHOST_IOTLB_INVALIDATE -> set_map() (s)
2) VHOST_IOTLB_UPDATE/VHOST_IOTLB_INVALIDATE -> set_map() (s)
...
n) VHOST_IOTLB_UPDATE/VHOST_IOTLB_INVALIDATE -> set_map() (s)
With the help of hints, we do:
0) VHOST_IOTLB_BATCH_START
1) VHOST_IOTLB_UPDATE/INVALIDATE
...
n) VHOST_IOTLB_UPDATE/INVALIDATE
n+1) VHOST_IOTLB_BATCH_END -> set_map()
One one call of set_map() to vDPA device for a batch of IOTLB
mappings. So for the device that has its own DMA translation logic, it
can efficiently structure the memory mapping to get best performance.
Note, this only impacts the devices that want its own DMA
translation (less times of set_map() call). For other type of devices,
there's no changes in the behaviour.
Changes from RFCV1:
- tweak the comments per Michael's request
Jason Wang (5):
vhost-vdpa: refine ioctl pre-processing
vhost: generialize backend features setting/getting
vhost-vdpa: support get/set backend features
vhost-vdpa: support IOTLB batching hints
vdpasim: support batch updating
drivers/vdpa/vdpa_sim/vdpa_sim.c | 40 +++++++++++++++++++++--
drivers/vhost/net.c | 18 ++---------
drivers/vhost/vdpa.c | 55 ++++++++++++++++++++++++++------
drivers/vhost/vhost.c | 15 +++++++++
drivers/vhost/vhost.h | 2 ++
include/uapi/linux/vhost.h | 2 ++
include/uapi/linux/vhost_types.h | 11 +++++++
7 files changed, 114 insertions(+), 29 deletions(-)
--
2.20.1
next reply other threads:[~2020-07-01 9:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-01 9:08 Jason Wang [this message]
2020-07-01 9:08 ` [PATCH 1/5] vhost-vdpa: refine ioctl pre-processing Jason Wang
2020-07-01 9:08 ` [PATCH 2/5] vhost: generialize backend features setting/getting Jason Wang
2020-07-01 9:08 ` [PATCH 3/5] vhost-vdpa: support get/set backend features Jason Wang
2020-07-01 9:08 ` [PATCH 4/5] vhost-vdpa: support IOTLB batching hints Jason Wang
2020-07-01 9:08 ` [PATCH 5/5] vdpasim: support batch updating Jason Wang
-- strict thread matches above, loose matches on Subject: below --
2015-07-24 4:38 [PATCH 0/5] Joshua Clayton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200701090839.12994-1-jasowang@redhat.com \
--to=jasowang@redhat.com \
--cc=eli@mellanox.com \
--cc=eperezma@redhat.com \
--cc=gdawar@xilinx.com \
--cc=hanand@xilinx.com \
--cc=lingshan.zhu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lulu@redhat.com \
--cc=mhabets@solarflare.com \
--cc=mst@redhat.com \
--cc=rob.miller@broadcom.com \
--cc=saugatm@xilinx.com \
--cc=shahafs@mellanox.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=vmireyno@marvell.com \
--cc=zhangweining@ruijie.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®