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 3002FA04B5; Mon, 11 Jan 2021 12:04:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F238140CC2; Mon, 11 Jan 2021 12:04:16 +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 9E212140CB5 for ; Mon, 11 Jan 2021 12:04:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610363054; 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=FpBNm7uHKpDsKQoUQMOir9WAl2xBFKBS6Ulf1vZhlr0=; b=A1Hb5K3JXkY/HZ4B+eg6zRYSvwmJGrrkY81brw4FRqscYdtoCpa9+o9D+S3o/fXMJA5OB+ gAcBMTWQTOFmx+Woqe37wd7FVME/T2nj3cSEtVEwC99Vn4N17IlSZllAxIMztn7KnPzCNQ SmS/XggXfOBEM3QNNQz2gpw1/R9gy74= 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-288-_XB1uWshPGi1Bhhb1VR3gg-1; Mon, 11 Jan 2021 06:04:10 -0500 X-MC-Unique: _XB1uWshPGi1Bhhb1VR3gg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 16F7687950E; Mon, 11 Jan 2021 11:04:09 +0000 (UTC) Received: from [10.36.110.24] (unknown [10.36.110.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E65AA7047A; Mon, 11 Jan 2021 11:04:07 +0000 (UTC) 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> From: Maxime Coquelin Message-ID: <983b5780-5bb9-eb40-7578-f446c220d7de@redhat.com> Date: Mon, 11 Jan 2021 12:04:05 +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: <1610367387-117188-2-git-send-email-jiayu.hu@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 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. Thanks, Maxime