From patchwork Wed Aug 4 08:31:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng, ZhihongX" X-Patchwork-Id: 96658 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 55528A0C45; Wed, 4 Aug 2021 10:36:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C847D40696; Wed, 4 Aug 2021 10:36:15 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id BDD0B4014F; Wed, 4 Aug 2021 10:36:13 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10065"; a="194159725" X-IronPort-AV: E=Sophos;i="5.84,293,1620716400"; d="scan'208";a="194159725" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 01:36:12 -0700 X-IronPort-AV: E=Sophos;i="5.84,293,1620716400"; d="scan'208";a="480072843" Received: from ubuntu1804.sh.intel.com (HELO localhost.localdomain) ([10.240.183.63]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2021 01:36:10 -0700 From: zhihongx.peng@intel.com To: chenbo.xia@intel.com, maxime.coquelin@redhat.com Cc: dev@dpdk.org, ivan.ilchenko@oktetlabs.ru, Zhihong Peng , stable@dpdk.org Date: Wed, 4 Aug 2021 16:31:28 +0800 Message-Id: <20210804083128.64981-1-zhihongx.peng@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [DPDK] net/virtio: fix check scatter on all Rx queues 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: Zhihong Peng This patch fixes the wrong way to obtain virtqueue. The end of virtqueue cannot be judged based on whether the array is NULL. Fixes: 4e8169eb0d2d (net/virtio: fix Rx scatter offload) Cc: stable@dpdk.org Signed-off-by: Zhihong Peng --- drivers/net/virtio/virtio_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index e58085a2c9..f2d19dc9d6 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -873,8 +873,8 @@ virtio_check_scatter_on_all_rx_queues(struct rte_eth_dev *dev, if (hw->vqs == NULL) return true; - for (qidx = 0; (vq = hw->vqs[2 * qidx + VTNET_SQ_RQ_QUEUE_IDX]) != NULL; - qidx++) { + for (qidx = 0; qidx < hw->max_queue_pairs; qidx++) { + vq = hw->vqs[2 * qidx + VTNET_SQ_RQ_QUEUE_IDX]; rxvq = &vq->rxq; if (rxvq->mpool == NULL) continue;