Message ID | 20220505062335.25445-1-xuan.ding@intel.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 934A0A00BE; Thu, 5 May 2022 08:30:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 352CC40E5A; Thu, 5 May 2022 08:30:48 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 4F05540042 for <dev@dpdk.org>; Thu, 5 May 2022 08:30:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651732246; x=1683268246; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=v+CNsPefYlmZc/v3iztnMBVHOsB6e2tNFxealVzDlwk=; b=jSmduZRpCtsj2hJ8O150oeiCGB+FpBj7+1s1ZoBEkxqlCcnCIveWZAul fkQaT/mnBq962hVkQef68Ze0CjDb17yWWitx4tGylQ/LuXFxrJIFZJ3u9 jRDwTBLDVazCvIFy+CsR3AlQJsjlxAdnNtipMPMsjgwqhY2+9LV2FAjI2 BnLtwXOQbAglXQsdFgG7XFJZjuU+frIJs44gd8ksLVbyy/OPdEXIdjlL3 4OTvSwTV8T8w20X9FXL0s5V6Xzen2an8ewF041NJQeYj45F3yHItCJ2Ey wspslw+BTBDUaFMsiIZIsXP/pr0kI0+5m0YtZR0x/Di/hTm2IvySHh5cC w==; X-IronPort-AV: E=McAfee;i="6400,9594,10337"; a="255488220" X-IronPort-AV: E=Sophos;i="5.91,200,1647327600"; d="scan'208";a="255488220" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 23:27:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,200,1647327600"; d="scan'208";a="563092906" Received: from npg-dpdk-xuan-cbdma.sh.intel.com ([10.67.110.228]) by orsmga007.jf.intel.com with ESMTP; 04 May 2022 23:27:04 -0700 From: xuan.ding@intel.com To: maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, cheng1.jiang@intel.com, sunil.pai.g@intel.com, liangma@liangbit.com, Xuan Ding <xuan.ding@intel.com> Subject: [PATCH v4 0/5] vhost: support async dequeue data path Date: Thu, 5 May 2022 06:23:30 +0000 Message-Id: <20220505062335.25445-1-xuan.ding@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220407152546.38167-1-xuan.ding@intel.com> References: <20220407152546.38167-1-xuan.ding@intel.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
vhost: support async dequeue data path
|
|
Message
Ding, Xuan
May 5, 2022, 6:23 a.m. UTC
From: Xuan Ding <xuan.ding@intel.com>
The presence of asynchronous path allows applications to offload memory
copies to DMA engine, so as to save CPU cycles and improve the copy
performance. This patch set implements vhost async dequeue data path
for split ring. The code is based on latest enqueue changes [1].
This patch set is a new design and implementation of [2]. Since dmadev
was introduced in DPDK 21.11, to simplify application logics, this patch
integrates dmadev in vhost. With dmadev integrated, 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.
A new asynchronous dequeue function is introduced:
1) rte_vhost_async_try_dequeue_burst(int vid, uint16_t queue_id,
struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts,
uint16_t count, int *nr_inflight,
uint16_t dma_id, uint16_t vchan_id)
Receive packets from the guest and offloads copies to DMA
virtual channel.
[1] https://mails.dpdk.org/archives/dev/2022-February/234555.html
[2] https://mails.dpdk.org/archives/dev/2021-September/218591.html
v3->v4:
* fix CI build warnings
* adjust some indentation
* pass vq instead of queue_id
v2->v3:
* fix mbuf not updated correctly for large packets
v1->v2:
* fix a typo
* fix a bug in desc_to_mbuf filling
RFC v3 -> v1:
* add sync and async path descriptor to mbuf refactoring
* add API description in docs
RFC v2 -> RFC v3:
* rebase to latest DPDK version
RFC v1 -> RFC v2:
* fix one bug in example
* rename vchan to vchan_id
* check if dma_id and vchan_id valid
* rework all the logs to new standard
Xuan Ding (5):
vhost: prepare sync for descriptor to mbuf refactoring
vhost: prepare async for descriptor to mbuf refactoring
vhost: merge sync and async descriptor to mbuf filling
vhost: support async dequeue for split ring
examples/vhost: support async dequeue data path
doc/guides/prog_guide/vhost_lib.rst | 7 +
doc/guides/rel_notes/release_22_07.rst | 4 +
doc/guides/sample_app_ug/vhost.rst | 9 +-
examples/vhost/main.c | 292 +++++++++++-----
examples/vhost/main.h | 35 +-
examples/vhost/virtio_net.c | 16 +-
lib/vhost/rte_vhost_async.h | 33 ++
lib/vhost/version.map | 3 +
lib/vhost/vhost.h | 1 +
lib/vhost/virtio_net.c | 467 ++++++++++++++++++++++---
10 files changed, 716 insertions(+), 151 deletions(-)
Comments
Hi Xuan, On 5/5/22 08:23, xuan.ding@intel.com wrote: > From: Xuan Ding <xuan.ding@intel.com> > > The presence of asynchronous path allows applications to offload memory > copies to DMA engine, so as to save CPU cycles and improve the copy > performance. This patch set implements vhost async dequeue data path > for split ring. The code is based on latest enqueue changes [1]. > > This patch set is a new design and implementation of [2]. Since dmadev > was introduced in DPDK 21.11, to simplify application logics, this patch > integrates dmadev in vhost. With dmadev integrated, 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. > > A new asynchronous dequeue function is introduced: > 1) rte_vhost_async_try_dequeue_burst(int vid, uint16_t queue_id, > struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, > uint16_t count, int *nr_inflight, > uint16_t dma_id, uint16_t vchan_id) > > Receive packets from the guest and offloads copies to DMA > virtual channel. > > [1] https://mails.dpdk.org/archives/dev/2022-February/234555.html > [2] https://mails.dpdk.org/archives/dev/2021-September/218591.html > > v3->v4: > * fix CI build warnings > * adjust some indentation > * pass vq instead of queue_id > > v2->v3: > * fix mbuf not updated correctly for large packets > > v1->v2: > * fix a typo > * fix a bug in desc_to_mbuf filling > > RFC v3 -> v1: > * add sync and async path descriptor to mbuf refactoring > * add API description in docs > > RFC v2 -> RFC v3: > * rebase to latest DPDK version > > RFC v1 -> RFC v2: > * fix one bug in example > * rename vchan to vchan_id > * check if dma_id and vchan_id valid > * rework all the logs to new standard > > Xuan Ding (5): > vhost: prepare sync for descriptor to mbuf refactoring > vhost: prepare async for descriptor to mbuf refactoring > vhost: merge sync and async descriptor to mbuf filling > vhost: support async dequeue for split ring > examples/vhost: support async dequeue data path > > doc/guides/prog_guide/vhost_lib.rst | 7 + > doc/guides/rel_notes/release_22_07.rst | 4 + > doc/guides/sample_app_ug/vhost.rst | 9 +- > examples/vhost/main.c | 292 +++++++++++----- > examples/vhost/main.h | 35 +- > examples/vhost/virtio_net.c | 16 +- > lib/vhost/rte_vhost_async.h | 33 ++ > lib/vhost/version.map | 3 + > lib/vhost/vhost.h | 1 + > lib/vhost/virtio_net.c | 467 ++++++++++++++++++++++--- > 10 files changed, 716 insertions(+), 151 deletions(-) > I applied your other series about unsafe API to get DMA inflight packets, so I have some conflicts when applying this series. Could you please rebase on top of next-virtio/main branch and repost? Thanks in avance, Maxime
Hi Maxime, > -----Original Message----- > From: Maxime Coquelin <maxime.coquelin@redhat.com> > Sent: Friday, May 6, 2022 3:53 AM > To: Ding, Xuan <xuan.ding@intel.com>; Xia, Chenbo <chenbo.xia@intel.com> > Cc: dev@dpdk.org; Hu, Jiayu <jiayu.hu@intel.com>; Jiang, Cheng1 > <cheng1.jiang@intel.com>; Pai G, Sunil <sunil.pai.g@intel.com>; > liangma@liangbit.com > Subject: Re: [PATCH v4 0/5] vhost: support async dequeue data path > > Hi Xuan, > > On 5/5/22 08:23, xuan.ding@intel.com wrote: > > From: Xuan Ding <xuan.ding@intel.com> > > > > The presence of asynchronous path allows applications to offload > > memory copies to DMA engine, so as to save CPU cycles and improve the > > copy performance. This patch set implements vhost async dequeue data > > path for split ring. The code is based on latest enqueue changes [1]. > > > > This patch set is a new design and implementation of [2]. Since dmadev > > was introduced in DPDK 21.11, to simplify application logics, this > > patch integrates dmadev in vhost. With dmadev integrated, 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. > > > > A new asynchronous dequeue function is introduced: > > 1) rte_vhost_async_try_dequeue_burst(int vid, uint16_t queue_id, > > struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, > > uint16_t count, int *nr_inflight, > > uint16_t dma_id, uint16_t vchan_id) > > > > Receive packets from the guest and offloads copies to DMA > > virtual channel. > > > > [1] https://mails.dpdk.org/archives/dev/2022-February/234555.html > > [2] https://mails.dpdk.org/archives/dev/2021-September/218591.html > > > > v3->v4: > > * fix CI build warnings > > * adjust some indentation > > * pass vq instead of queue_id > > > > v2->v3: > > * fix mbuf not updated correctly for large packets > > > > v1->v2: > > * fix a typo > > * fix a bug in desc_to_mbuf filling > > > > RFC v3 -> v1: > > * add sync and async path descriptor to mbuf refactoring > > * add API description in docs > > > > RFC v2 -> RFC v3: > > * rebase to latest DPDK version > > > > RFC v1 -> RFC v2: > > * fix one bug in example > > * rename vchan to vchan_id > > * check if dma_id and vchan_id valid > > * rework all the logs to new standard > > > > Xuan Ding (5): > > vhost: prepare sync for descriptor to mbuf refactoring > > vhost: prepare async for descriptor to mbuf refactoring > > vhost: merge sync and async descriptor to mbuf filling > > vhost: support async dequeue for split ring > > examples/vhost: support async dequeue data path > > > > doc/guides/prog_guide/vhost_lib.rst | 7 + > > doc/guides/rel_notes/release_22_07.rst | 4 + > > doc/guides/sample_app_ug/vhost.rst | 9 +- > > examples/vhost/main.c | 292 +++++++++++----- > > examples/vhost/main.h | 35 +- > > examples/vhost/virtio_net.c | 16 +- > > lib/vhost/rte_vhost_async.h | 33 ++ > > lib/vhost/version.map | 3 + > > lib/vhost/vhost.h | 1 + > > lib/vhost/virtio_net.c | 467 ++++++++++++++++++++++--- > > 10 files changed, 716 insertions(+), 151 deletions(-) > > > > I applied your other series about unsafe API to get DMA inflight packets, so I > have some conflicts when applying this series. > > Could you please rebase on top of next-virtio/main branch and repost? Sure, I will rebase on top of latest main branch, please see v5. Thanks, Xuan > > Thanks in avance, > Maxime