From patchwork Wed Jul 12 07:42:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiming Yang X-Patchwork-Id: 129491 X-Patchwork-Delegate: qi.z.zhang@intel.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 4CD1542E52; Wed, 12 Jul 2023 10:00:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4AF0A42B8C; Wed, 12 Jul 2023 10:00:07 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 761D3406BA for ; Wed, 12 Jul 2023 10:00:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689148805; x=1720684805; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L5AYY0GXRCHpLLgTqykbcgtlYufOGr1dc8rsFnyINgg=; b=KpWckMOyEAaBOlN/1ABdCxO0RzPwxjcV0ieUGI4+QiogreSfO0tEu5Pb o44v9AoDw+IlVaXm++U1mVoXrHhUP9+jgne6IRNkthg9jRj1vC1NNPTSL uPccANvjVgcvA1PXbJRkmuzITQH9vQI+3DIVyXTnt7JdlOwza3CKMj6+h 8hrqNzx5cMJU2JeqbO3u7ltW/GoMNK0RkD4jDOtoFoIBfljS+lRAMP8wg sIzb9CrGPmRHr8Djubb8DNGpkL3RuSkmBfZQdYJxV22LDrkWknCds52ql HfjTH9+jjz1esEBUSeo65jrty+TlNR8JP0+C3iZzMNoBmGEbAorEuH+x9 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="354736655" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="354736655" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 01:00:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="845564066" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="845564066" Received: from dpdk-qiming3.sh.intel.com ([10.67.111.4]) by orsmga004.jf.intel.com with ESMTP; 12 Jul 2023 00:59:52 -0700 From: Qiming Yang To: dev@dpdk.org Cc: beilei.xing@intel.com, qi.z.zhang@intel.com, Qiming Yang , Jie Hai Subject: [PATCH 1/3] net/ixgbevf: fix Rx and Tx queue status get Date: Wed, 12 Jul 2023 07:42:13 +0000 Message-Id: <20230712074215.3249336-2-qiming.yang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230712074215.3249336-1-qiming.yang@intel.com> References: <20230712074215.3249336-1-qiming.yang@intel.com> MIME-Version: 1.0 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 Ixgbevf driver don't enable queue start/stop functions, queue status is not updated when the HW queue enabled or disabled. It caused application can't get correct queue status. This patch fixes the issue by updating the queue states when the queue is disabled or enabled. Fixes: 429c6d86b371 ("ixgbe: prepare for vector pmd") Fixes: f0c50e5f56fa ("ixgbe: move PMD specific fields out of base driver") Signed-off-by: Qiming Yang Signed-off-by: Jie Hai --- drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index 61f17cd90b..954ef241a0 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -3378,6 +3378,7 @@ ixgbe_dev_clear_queues(struct rte_eth_dev *dev) if (txq != NULL) { txq->ops->release_mbufs(txq); txq->ops->reset(txq); + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; } } @@ -3387,6 +3388,7 @@ ixgbe_dev_clear_queues(struct rte_eth_dev *dev) if (rxq != NULL) { ixgbe_rx_queue_release_mbufs(rxq); ixgbe_reset_rx_queue(adapter, rxq); + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; } } /* If loopback mode was enabled, reconfigure the link accordingly */ @@ -5896,6 +5898,8 @@ ixgbevf_dev_rxtx_start(struct rte_eth_dev *dev) } while (--poll_ms && !(txdctl & IXGBE_TXDCTL_ENABLE)); if (!poll_ms) PMD_INIT_LOG(ERR, "Could not enable Tx Queue %d", i); + else + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; } for (i = 0; i < dev->data->nb_rx_queues; i++) { @@ -5913,6 +5917,8 @@ ixgbevf_dev_rxtx_start(struct rte_eth_dev *dev) } while (--poll_ms && !(rxdctl & IXGBE_RXDCTL_ENABLE)); if (!poll_ms) PMD_INIT_LOG(ERR, "Could not enable Rx Queue %d", i); + else + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; rte_wmb(); IXGBE_WRITE_REG(hw, IXGBE_VFRDT(i), rxq->nb_rx_desc - 1);