From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Wang, YuanX" <yuanx.wang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
"Pai G, Sunil" <sunil.pai.g@intel.com>,
"Hu, Jiayu" <jiayu.hu@intel.com>,
"Ding, Xuan" <xuan.ding@intel.com>,
"Jiang, Cheng1" <cheng1.jiang@intel.com>,
"Ma, WenwuX" <wenwux.ma@intel.com>,
"Yang, YvonneX" <yvonnex.yang@intel.com>
Subject: Re: [dpdk-dev] [PATCH 1/2] vhost: support to clear in-flight packets for async dequeue
Date: Wed, 15 Sep 2021 07:02:15 +0000 [thread overview]
Message-ID: <MN2PR11MB40631CC8056AE89179611E959CDB9@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210909065807.812145-2-yuanx.wang@intel.com>
Hi Yuan,
> -----Original Message-----
> From: Wang, YuanX <yuanx.wang@intel.com>
> Sent: Thursday, September 9, 2021 2:58 PM
> To: dev@dpdk.org
> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Pai G,
> Sunil <sunil.pai.g@intel.com>; Hu, Jiayu <jiayu.hu@intel.com>; Ding, Xuan
> <xuan.ding@intel.com>; Jiang, Cheng1 <cheng1.jiang@intel.com>; Ma, WenwuX
> <wenwux.ma@intel.com>; Yang, YvonneX <yvonnex.yang@intel.com>; Wang, YuanX
> <yuanx.wang@intel.com>
> Subject: [PATCH 1/2] vhost: support to clear in-flight packets for async
> dequeue
>
> rte_vhost_clear_queue_thread_unsafe() supports to clear
> in-flight packets for async enqueue only. But after
> supporting async dequeue, this API should support async dequeue too.
>
> Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
> ---
> lib/vhost/virtio_net.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
> index e0159b53e3..7f6183a929 100644
> --- a/lib/vhost/virtio_net.c
> +++ b/lib/vhost/virtio_net.c
> @@ -27,6 +27,11 @@
>
> #define VHOST_ASYNC_BATCH_THRESHOLD 32
>
> +static __rte_always_inline uint16_t
> +async_poll_dequeue_completed_split(struct virtio_net *dev,
> + struct vhost_virtqueue *vq, uint16_t queue_id,
> + struct rte_mbuf **pkts, uint16_t count, bool legacy_ol_flags);
> +
> static __rte_always_inline bool
> rxvq_is_mergeable(struct virtio_net *dev)
> {
> @@ -2119,11 +2124,6 @@ rte_vhost_clear_queue_thread_unsafe(int vid, uint16_t
> queue_id,
> return 0;
>
> VHOST_LOG_DATA(DEBUG, "(%d) %s\n", dev->vid, __func__);
> - if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->nr_vring))) {
> - VHOST_LOG_DATA(ERR, "(%d) %s: invalid virtqueue idx %d.\n",
> - dev->vid, __func__, queue_id);
> - return 0;
> - }
>
> vq = dev->virtqueue[queue_id];
>
> @@ -2133,7 +2133,11 @@ rte_vhost_clear_queue_thread_unsafe(int vid, uint16_t
> queue_id,
> return 0;
> }
>
> - n_pkts_cpl = vhost_poll_enqueue_completed(dev, queue_id, pkts, count);
> + if ((queue_id % 2) == 0)
You can remove the internal '()'.
> + n_pkts_cpl = vhost_poll_enqueue_completed(dev, queue_id, pkts,
> count);
> + else
> + n_pkts_cpl = async_poll_dequeue_completed_split(dev, vq, queue_id,
> pkts, count,
You should check we are using split queue before entering this split queue function.
Thanks,
Chenbo
> + dev->flags & VIRTIO_DEV_LEGACY_OL_FLAGS);
>
> return n_pkts_cpl;
> }
> --
> 2.25.1
next prev parent reply other threads:[~2021-09-15 7:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 6:58 [dpdk-dev] [PATCH 0/2] support to clear in-flight packets for async Yuan Wang
2021-09-09 6:58 ` [dpdk-dev] [PATCH 1/2] vhost: support to clear in-flight packets for async dequeue Yuan Wang
2021-09-15 7:02 ` Xia, Chenbo [this message]
2021-09-22 2:18 ` Yang, YvonneX
2021-09-09 6:58 ` [dpdk-dev] [PATCH 2/2] vhost: support thread-safe API for clearing in-flight packets in async vhost Yuan Wang
2021-09-15 7:23 ` Xia, Chenbo
2021-09-22 2:17 ` Yang, YvonneX
2021-09-15 7:00 ` [dpdk-dev] [PATCH 0/2] support to clear in-flight packets for async Xia, Chenbo
2021-09-17 8:12 ` [dpdk-dev] [PATCH v2 " Yuan Wang
2021-09-17 8:12 ` [dpdk-dev] [PATCH v2 1/2] vhost: support to clear in-flight packets for async dequeue Yuan Wang
2021-09-17 8:12 ` [dpdk-dev] [PATCH v2 2/2] vhost: add thread-safe API for clearing in-flight packets in async vhost Yuan Wang
2021-09-22 2:19 ` [dpdk-dev] [PATCH 0/2] support to clear in-flight packets for async Yang, YvonneX
2021-09-22 8:55 ` [dpdk-dev] [PATCH v3 " Yuan Wang
2021-09-22 8:55 ` [dpdk-dev] [PATCH v3 1/2] vhost: support to clear in-flight packets for async dequeue Yuan Wang
2021-09-23 2:43 ` Yang, YvonneX
2021-09-22 8:55 ` [dpdk-dev] [PATCH v3 2/2] vhost: add thread-safe API for clearing in-flight packets in async vhost Yuan Wang
2021-09-23 2:43 ` Yang, YvonneX
2021-09-30 6:54 ` Ding, Xuan
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=MN2PR11MB40631CC8056AE89179611E959CDB9@MN2PR11MB4063.namprd11.prod.outlook.com \
--to=chenbo.xia@intel.com \
--cc=cheng1.jiang@intel.com \
--cc=dev@dpdk.org \
--cc=jiayu.hu@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=sunil.pai.g@intel.com \
--cc=wenwux.ma@intel.com \
--cc=xuan.ding@intel.com \
--cc=yuanx.wang@intel.com \
--cc=yvonnex.yang@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).