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 264EAA0C4D; Fri, 20 Aug 2021 14:47:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1238A41256; Fri, 20 Aug 2021 14:47:34 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 3005A41255; Fri, 20 Aug 2021 14:47:32 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 122) id DD4537F6BB; Fri, 20 Aug 2021 15:47:31 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shelob.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id BFA487F4FD; Fri, 20 Aug 2021 15:47:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru BFA487F4FD Authentication-Results: shelob.oktetlabs.ru/BFA487F4FD; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: Maxime Coquelin , Chenbo Xia , Marvin Liu Cc: dev@dpdk.org, Ivan Ilchenko , stable@dpdk.org Date: Fri, 20 Aug 2021 15:47:20 +0300 Message-Id: <20210820124720.3522418-1-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/virtio: fix reporting of mbufs allocated on RxQ setup 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" From: Ivan Ilchenko Rx queue setup finish function may report wrong number of allocated mbufs in case of in-order feature. Fix the function to not ignore allocation error and count only successfully allocated number of buffers. Fixes: e5f456a98d3 ("net/virtio: support in-order Rx and Tx") Cc: stable@dpdk.org Signed-off-by: Ivan Ilchenko Signed-off-by: Andrew Rybchenko --- drivers/net/virtio/virtio_rxtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index d0365ce4bf..8a48fba5cc 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -768,10 +768,11 @@ virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx) if (unlikely(error)) { for (i = 0; i < free_cnt; i++) rte_pktmbuf_free(pkts[i]); + } else { + nbufs += free_cnt; } } - nbufs += free_cnt; vq_update_avail_idx(vq); } } else { -- 2.30.2