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 893D5A09FF; Mon, 11 Jan 2021 15:05:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B9B8140D4E; Mon, 11 Jan 2021 15:05:04 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id D10B0140D10 for ; Mon, 11 Jan 2021 15:05:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610373900; 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=QAUCgXke3Y1q7pL36tEM4IiTc7Re94MtpHyRxp7JAu0=; b=K2fjh8055yz1HXFolOfrp5UL2FoBhsWiLS76UHemSzoqi2D5gIh9OjNj17b/XO4YlrTyxv dboTSXkAI8e1SZDcOzV+8bwp7lyVVR/gt4D7Pt0gkXmHPDVNP7pPMbD2U3m4hZmpY7aFZQ FPv7h0kPzVlU7E1BA61TgYSAPwKIxnU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-592-ujZDNVIFMvO-G5zLcU-ahw-1; Mon, 11 Jan 2021 09:04:56 -0500 X-MC-Unique: ujZDNVIFMvO-G5zLcU-ahw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9E865802B42; Mon, 11 Jan 2021 14:04:55 +0000 (UTC) Received: from [10.36.110.24] (unknown [10.36.110.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F0411972B; Mon, 11 Jan 2021 14:04:54 +0000 (UTC) From: Maxime Coquelin To: Jiayu Hu , dev@dpdk.org Cc: chenbo.xia@intel.com, cheng1.jiang@intel.com, yinan.wang@intel.com References: <1608884934-106977-1-git-send-email-jiayu.hu@intel.com> <1610367387-117188-1-git-send-email-jiayu.hu@intel.com> <1610367387-117188-2-git-send-email-jiayu.hu@intel.com> <983b5780-5bb9-eb40-7578-f446c220d7de@redhat.com> Message-ID: <86f78cef-8707-c002-9044-a2a74040263b@redhat.com> Date: Mon, 11 Jan 2021 15:04:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <983b5780-5bb9-eb40-7578-f446c220d7de@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 1/2] vhost: cleanup async enqueue 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 Sender: "dev" On 1/11/21 12:04 PM, Maxime Coquelin wrote: > > > On 1/11/21 1:16 PM, Jiayu Hu wrote: >> This patch removes unnecessary check and function calls, and it changes >> appropriate types for internal variables and fixes typos. >> >> Signed-off-by: Jiayu Hu >> Tested-by: Yinan Wang >> --- >> lib/librte_vhost/rte_vhost_async.h | 8 ++++---- >> lib/librte_vhost/virtio_net.c | 16 ++++++++-------- >> 2 files changed, 12 insertions(+), 12 deletions(-) >> >> diff --git a/lib/librte_vhost/rte_vhost_async.h b/lib/librte_vhost/rte_vhost_async.h >> index c73bd7c..03bd558 100644 >> --- a/lib/librte_vhost/rte_vhost_async.h >> +++ b/lib/librte_vhost/rte_vhost_async.h >> @@ -112,7 +112,7 @@ struct rte_vhost_async_features { >> }; >> >> /** >> - * register a async channel for vhost >> + * register an async channel for vhost >> * >> * @param vid >> * vhost device id async channel to be attached to >> @@ -147,8 +147,8 @@ __rte_experimental >> int rte_vhost_async_channel_unregister(int vid, uint16_t queue_id); >> >> /** >> - * This function submit enqueue data to async engine. This function has >> - * no guranttee to the transfer completion upon return. Applications >> + * This function submits enqueue data to async engine. This function has >> + * no guarantee to the transfer completion upon return. Applications >> * should poll transfer status by rte_vhost_poll_enqueue_completed() >> * >> * @param vid >> @@ -167,7 +167,7 @@ uint16_t rte_vhost_submit_enqueue_burst(int vid, uint16_t queue_id, >> struct rte_mbuf **pkts, uint16_t count); >> >> /** >> - * This function check async completion status for a specific vhost >> + * This function checks async completion status for a specific vhost >> * device queue. Packets which finish copying (enqueue) operation >> * will be returned in an array. >> * >> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c >> index fec08b2..0b63940 100644 >> --- a/lib/librte_vhost/virtio_net.c >> +++ b/lib/librte_vhost/virtio_net.c >> @@ -1130,8 +1130,11 @@ async_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, >> } >> >> out: >> - async_fill_iter(src_it, tlen, src_iovec, tvec_idx); >> - async_fill_iter(dst_it, tlen, dst_iovec, tvec_idx); >> + if (tlen) { >> + async_fill_iter(src_it, tlen, src_iovec, tvec_idx); >> + async_fill_iter(dst_it, tlen, dst_iovec, tvec_idx); >> + } else >> + src_it->count = 0; > > Minor comment, you need braces for the 'else' as there are braces for > the 'if'. > > > I will fix while applying. Reviewed-by: Maxime Coquelin > Thanks, > Maxime >