From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 92620A0093; Fri, 17 Jun 2022 15:33:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71F4940F19; Fri, 17 Jun 2022 15:33:55 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E12ED40DDD for ; Fri, 17 Jun 2022 15:33:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655472833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ID8JSzyX0b7KTLJRGzumvpCuC/QL/crphpfJ79Bvsz0=; b=alXe7/2UUohXf7rdPmzE8ZY+Bi+RJpPC8nuUfgJoDZzXVoLJa0FWwQmZzjs56CBFIMu6PS VvYYgNXNxmj/qRfj1396ayza4b02uk188HNkh412/kP7wuUx5JtPLpazpkzgFkq1Ybvihw QbvKrISf47iXVfnecPg2QED+wdmoFS0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-114-cgHUjQYpPMWb0dxO1JDBQw-1; Fri, 17 Jun 2022 09:33:48 -0400 X-MC-Unique: cgHUjQYpPMWb0dxO1JDBQw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8010983397C; Fri, 17 Jun 2022 13:33:47 +0000 (UTC) Received: from [10.39.208.34] (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 26E531121314; Fri, 17 Jun 2022 13:33:45 +0000 (UTC) Message-ID: <1737263f-55b6-2116-b57f-c700a48c3967@redhat.com> Date: Fri, 17 Jun 2022 15:33:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] add support for async vhost packed ring dequeue To: Cheng Jiang , chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, xuan.ding@intel.com, wenwux.ma@intel.com, yuanx.wang@intel.com, yvonnex.yang@intel.com References: <20220613082159.40077-1-cheng1.jiang@intel.com> From: Maxime Coquelin In-Reply-To: <20220613082159.40077-1-cheng1.jiang@intel.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Cheng, On 6/13/22 10:21, Cheng Jiang wrote: > This patch implements packed ring dequeue data path for asynchronous > vhost. > > Signed-off-by: Cheng Jiang > Reviewed-by: Maxime Coquelin > --- > lib/vhost/virtio_net.c | 218 ++++++++++++++++++++++++++++++++++++----- > 1 file changed, 192 insertions(+), 26 deletions(-) > I had to do below changes so that it builds with the series clearing inflight packets for async dequeue. Does that look good to you? Thanks, Maxime diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 0d41e850d2..229e6b32f4 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -27,7 +27,7 @@ #define MAX_BATCH_LEN 256 static __rte_always_inline uint16_t -async_poll_dequeue_completed_split(struct virtio_net *dev, struct vhost_virtqueue *vq, +async_poll_dequeue_completed(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mbuf **pkts, uint16_t count, int16_t dma_id, uint16_t vchan_id, bool legacy_ol_flags); @@ -2207,12 +2207,7 @@ rte_vhost_clear_queue_thread_unsafe(int vid, uint16_t queue_id, n_pkts_cpl = vhost_poll_enqueue_completed(dev, queue_id, pkts, count, dma_id, vchan_id); else { - if (unlikely(vq_is_packed(dev))) - VHOST_LOG_DATA(ERR, - "(%s) %s: async dequeue does not support packed ring.\n", - dev->ifname, __func__); - else - n_pkts_cpl = async_poll_dequeue_completed_split(dev, vq, pkts, count, + n_pkts_cpl = async_poll_dequeue_completed(dev, vq, pkts, count, dma_id, vchan_id, dev->flags & VIRTIO_DEV_LEGACY_OL_FLAGS); } @@ -2271,12 +2266,7 @@ rte_vhost_clear_queue(int vid, uint16_t queue_id, struct rte_mbuf **pkts, n_pkts_cpl = vhost_poll_enqueue_completed(dev, queue_id, pkts, count, dma_id, vchan_id); else { - if (unlikely(vq_is_packed(dev))) - VHOST_LOG_DATA(ERR, - "(%s) %s: async dequeue does not support packed ring.\n", - dev->ifname, __func__); - else - n_pkts_cpl = async_poll_dequeue_completed_split(dev, vq, pkts, count, + n_pkts_cpl = async_poll_dequeue_completed(dev, vq, pkts, count, dma_id, vchan_id, dev->flags & VIRTIO_DEV_LEGACY_OL_FLAGS); }