From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B40AE137C for ; Sat, 5 Nov 2016 10:40:33 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 05 Nov 2016 02:40:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,448,1473145200"; d="scan'208";a="187945184" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by fmsmga004.fm.intel.com with ESMTP; 05 Nov 2016 02:40:31 -0700 From: Yuanhan Liu To: dev@dpdk.org Cc: Thomas Monjalon , Tan Jianfeng , Kevin Traynor , Ilya Maximets , Kyle Larose , Maxime Coquelin , Yuanhan Liu Date: Sat, 5 Nov 2016 17:41:05 +0800 Message-Id: <1478338865-26126-11-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1478338865-26126-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1478189400-14606-1-git-send-email-yuanhan.liu@linux.intel.com> <1478338865-26126-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-dev] [PATCH v2 10/10] net/virtio: fix multiple queue enabling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Nov 2016 09:40:34 -0000 When queue number shrinks to 1 from X, the following code stops us sending the multiple queue ctrl message: if (nb_queues > 1) { if (virtio_set_multiple_queues(dev, nb_queues) != 0) return -EINVAL; } This ends up with still X queues being enabled, which is obviously wrong. Fix it by removing the check. Fixes: 823ad647950a ("virtio: support multiple queues") Signed-off-by: Yuanhan Liu --- drivers/net/virtio/virtio_ethdev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index d70bd00..a4cd6f5 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1494,10 +1494,8 @@ virtio_dev_start(struct rte_eth_dev *dev) *vhost backend will have no chance to be waked up */ nb_queues = RTE_MAX(dev->data->nb_rx_queues, dev->data->nb_tx_queues); - if (nb_queues > 1) { - if (virtio_set_multiple_queues(dev, nb_queues) != 0) - return -EINVAL; - } + if (virtio_set_multiple_queues(dev, nb_queues) != 0) + return -EINVAL; PMD_INIT_LOG(DEBUG, "nb_queues=%d", nb_queues); -- 1.9.0