From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3037BA0527; Mon, 9 Nov 2020 10:19:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 04779593A; Mon, 9 Nov 2020 10:19:08 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id C331A5928 for ; Mon, 9 Nov 2020 10:19:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604913544; 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=koGGDL7QIbcQm0H5xTzma8y37lnAEVwKhACfxo62P5E=; b=LaTQON6YUr20wEGxZWUjMEafIBcK2TalGZ6PZVO52eVsoZKKYlwUJ03msFl9iA0NaEZ19h 1iWG9jYYyqcyp8TAHF/kmOicXhiG1bsisk2KRgRd80nnbSbCybUxhIXMl9v1RD1lJONvii qMhDfo0HBr3/aHuNUhtkmvSHa76fJDk= 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-32-vWhoZl0FPmOCMCsIO2L-tQ-1; Mon, 09 Nov 2020 04:19:01 -0500 X-MC-Unique: vWhoZl0FPmOCMCsIO2L-tQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA4F4802B73; Mon, 9 Nov 2020 09:18:59 +0000 (UTC) Received: from [10.36.110.32] (unknown [10.36.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E7E3D60BF1; Mon, 9 Nov 2020 09:18:58 +0000 (UTC) To: Patrick Fu , dev@dpdk.org, chenbo.xia@intel.com Cc: jiayu.hu@intel.com References: <20201103053501.2805-1-patrick.fu@intel.com> From: Maxime Coquelin Message-ID: <68f0667e-d40e-444f-8fb9-e6604abd65d1@redhat.com> Date: Mon, 9 Nov 2020 10:18:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20201103053501.2805-1-patrick.fu@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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: 8bit Subject: Re: [dpdk-dev] [PATCH v1] vhost: fix async inflight packet counter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 11/3/20 6:35 AM, Patrick Fu wrote: > Async inflight packet counter should take failed packets into account. > Failed packets will be deducted in the error handling logic. > > Fixes: 6b3c81db8bb7 ("vhost: simplify async copy completion") > Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring") > > Signed-off-by: Patrick Fu > --- > lib/librte_vhost/virtio_net.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c > index 10dec5e54..6c5128665 100644 > --- a/lib/librte_vhost/virtio_net.c > +++ b/lib/librte_vhost/virtio_net.c > @@ -1567,7 +1567,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev, > src_it = it_pool; > dst_it = it_pool + 1; > segs_await = 0; > - vq->async_pkts_inflight_n += n_pkts; > + vq->async_pkts_inflight_n += pkt_burst_idx; > > if (unlikely(n_pkts < (int)pkt_burst_idx)) { > /* > @@ -1587,7 +1587,7 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev, > if (pkt_burst_idx) { > n_pkts = vq->async_ops.transfer_data(dev->vid, > queue_id, tdes, 0, pkt_burst_idx); > - vq->async_pkts_inflight_n += n_pkts; > + vq->async_pkts_inflight_n += pkt_burst_idx; > > if (unlikely(n_pkts < (int)pkt_burst_idx)) > pkt_err = pkt_burst_idx - n_pkts; > Reviewed-by: Maxime Coquelin Thanks, Maxime