From: Jiayu Hu <jiayu.hu@intel.com>
To: dev@dpdk.org
Cc: maxime.coquelin@redhat.com, i.maximets@ovn.org,
chenbo.xia@intel.com, xuan.ding@intel.com,
cheng1.jiang@intel.com, liangma@liangbit.com,
Jiayu Hu <jiayu.hu@intel.com>
Subject: [PATCH v3 0/1] integrate dmadev in vhost
Date: Tue, 8 Feb 2022 05:40:30 -0500 [thread overview]
Message-ID: <20220208104031.1885640-1-jiayu.hu@intel.com> (raw)
In-Reply-To: <20220124164011.1402593-2-jiayu.hu@intel.com>
Since dmadev is introduced in 21.11, to avoid the overhead of vhost DMA
abstraction layer and simplify application logics, this patch integrates
dmadev in vhost.
To enable the flexibility of using DMA devices in different function
modules, not limited in vhost, vhost doesn't manage DMA devices.
Applications, like OVS, need to manage and configure DMA devices and
tell vhost what DMA device to use in every dataplane function call.
In addition, vhost supports M:N mapping between vrings and DMA virtual
channels. Specifically, one vring can use multiple different DMA channels
and one DMA channel can be shared by multiple vrings at the same time.
The reason of enabling one vring to use multiple DMA channels is that
it's possible that more than one dataplane threads enqueue packets to
the same vring with their own DMA virtual channels. Besides, the number
of DMA devices is limited. For the purpose of scaling, it's necessary to
support sharing DMA channels among vrings.
As only enqueue path is enabled DMA acceleration, the new dataplane
functions are like:
1). rte_vhost_submit_enqueue_burst(vid, queue_id, pkts, count, dma_id,
dma_vchan):
Get descriptors and submit copies to DMA virtual channel for the
packets that need to be send to VM.
2). rte_vhost_poll_enqueue_completed(vid, queue_id, pkts, count, dma_id,
dma_vchan):
Check completed DMA copies from the given DMA virtual channel and
write back corresponding descriptors to vring.
OVS needs to call rte_vhost_poll_enqueue_completed to clean in-flight
copies on previous call and it can be called inside rxq_recv function,
so that it doesn't require big change in OVS datapath. For example:
netdev_dpdk_vhost_rxq_recv() {
...
qid = rxq->queue_id * VIRTIO_QNUM + VIRTIO_RXQ;
rte_vhost_poll_enqueue_completed(vid, qid, ...);
}
Change log
==========
v2 -> v3:
- remove SW fallback
- remove middle-packet dma submit
- refactor rte_async_dma_configure() and remove poll_factor
- introduce vhost_async_dma_transfer_one()
- rename rte_vhost_iov_iter and rte_vhost_iovec and place them in vhost.h
- refactor LOG format
- print error log for rte_dma_copy() failure with avoiding log flood
- avoid log flood for rte_dma_completed() failure
- fix some typo and update comment and doc
v1 -> v2:
- add SW fallback if rte_dma_copy() reports error
- print error if rte_dma_completed() reports error
- add poll_factor while call rte_dma_completed() for scatter-gaher packets
- use trylock instead of lock in rte_vhost_poll_enqueue_completed()
- check if dma_id and vchan_id valid
- input dma_id in rte_vhost_async_dma_configure()
- remove useless code, brace and hardcode in vhost example
- redefine MAX_VHOST_DEVICE to RTE_MAX_VHOST_DEVICE
- update doc and comments
rfc -> v1:
- remove useless code
- support dynamic DMA vchannel ring size (rte_vhost_async_dma_configure)
- fix several bugs
- fix typo and coding style issues
- replace "while" with "for"
- update programmer guide
- support share dma among vhost in vhost example
- remove "--dma-type" in vhost example
Jiayu Hu (1):
vhost: integrate dmadev in asynchronous data-path
doc/guides/prog_guide/vhost_lib.rst | 97 +++++-----
examples/vhost/Makefile | 2 +-
examples/vhost/ioat.c | 218 ----------------------
examples/vhost/ioat.h | 63 -------
examples/vhost/main.c | 252 +++++++++++++++++++++-----
examples/vhost/main.h | 11 ++
examples/vhost/meson.build | 6 +-
lib/vhost/meson.build | 2 +-
lib/vhost/rte_vhost.h | 2 +
lib/vhost/rte_vhost_async.h | 145 ++++-----------
lib/vhost/version.map | 3 +
lib/vhost/vhost.c | 122 +++++++++----
lib/vhost/vhost.h | 85 ++++++++-
lib/vhost/virtio_net.c | 271 +++++++++++++++++++++++-----
14 files changed, 689 insertions(+), 590 deletions(-)
delete mode 100644 examples/vhost/ioat.c
delete mode 100644 examples/vhost/ioat.h
--
2.25.1
next prev parent reply other threads:[~2022-02-08 2:37 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 10:54 [RFC " Jiayu Hu
2021-11-22 10:54 ` [RFC 1/1] vhost: integrate dmadev in asynchronous datapath Jiayu Hu
2021-12-24 10:39 ` Maxime Coquelin
2021-12-28 1:15 ` Hu, Jiayu
2022-01-03 10:26 ` Maxime Coquelin
2022-01-06 5:46 ` Hu, Jiayu
2021-12-03 3:49 ` [RFC 0/1] integrate dmadev in vhost fengchengwen
2021-12-30 21:55 ` [PATCH v1 " Jiayu Hu
2021-12-30 21:55 ` [PATCH v1 1/1] vhost: integrate dmadev in asynchronous datapath Jiayu Hu
2021-12-31 0:55 ` Liang Ma
2022-01-14 6:30 ` Xia, Chenbo
2022-01-17 5:39 ` Hu, Jiayu
2022-01-19 2:18 ` Xia, Chenbo
2022-01-20 17:00 ` Maxime Coquelin
2022-01-21 1:56 ` Hu, Jiayu
2022-01-24 16:40 ` [PATCH v2 0/1] integrate dmadev in vhost Jiayu Hu
2022-01-24 16:40 ` [PATCH v2 1/1] vhost: integrate dmadev in asynchronous datapath Jiayu Hu
2022-02-03 13:04 ` Maxime Coquelin
2022-02-07 1:34 ` Hu, Jiayu
2022-02-08 10:40 ` Jiayu Hu [this message]
2022-02-08 10:40 ` [PATCH v3 1/1] vhost: integrate dmadev in asynchronous data-path Jiayu Hu
2022-02-08 17:46 ` Maxime Coquelin
2022-02-09 12:51 ` [PATCH v4 0/1] integrate dmadev in vhost Jiayu Hu
2022-02-09 12:51 ` [PATCH v4 1/1] vhost: integrate dmadev in asynchronous data-path Jiayu Hu
2022-02-10 7:58 ` Yang, YvonneX
2022-02-10 13:44 ` Maxime Coquelin
2022-02-10 15:14 ` Maxime Coquelin
2022-02-10 20:50 ` Ferruh Yigit
2022-02-10 21:01 ` Maxime Coquelin
2022-02-10 20:56 ` Ferruh Yigit
2022-02-10 21:00 ` Maxime Coquelin
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=20220208104031.1885640-1-jiayu.hu@intel.com \
--to=jiayu.hu@intel.com \
--cc=chenbo.xia@intel.com \
--cc=cheng1.jiang@intel.com \
--cc=dev@dpdk.org \
--cc=i.maximets@ovn.org \
--cc=liangma@liangbit.com \
--cc=maxime.coquelin@redhat.com \
--cc=xuan.ding@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).