From patchwork Wed Jul 12 08:31:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiming Yang X-Patchwork-Id: 129495 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 6ACFF42E52; Wed, 12 Jul 2023 10:49:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 598A741156; Wed, 12 Jul 2023 10:49:58 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id F2A5A406BA; Wed, 12 Jul 2023 10:49:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689151797; x=1720687797; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DB1cVTM+VXy+6OhhH/4JlYcsJ2Srjsjr08JpRAO6f6Q=; b=nd9lymL7P6RbBsmQw6SeEx0S29d5niyvkqqyblwF+fWsVmnfzpLrS0xp yyn/jmWBaAwsG+o2A9p3jTc+wdsDYxBqDBkAf/v2DICW6peX3wIkqKko8 eogt/9Fc/FQEsRucYEWFeVZzLcJl0/X2S42sM2ilo0cP6YCHmcjq7ZbfW 95jDT04ys5+mWrvxNS2Yubmk593PTOISiQVl+RKGwf/0WgNG68Wb8NRa1 mQ+s5ZUhndrV/NGzWA9q4F0R7Nlm9yGh6dAGGhqVK7XcWClvGGEv1+RZ5 Qk9Cq6629fuSxoQGnb3wvCyCYUx6JyfNWdWqPErLuPbPO2hH8oWf26z4T w==; X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="345152449" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="345152449" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2023 01:49:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="866036707" X-IronPort-AV: E=Sophos;i="6.01,199,1684825200"; d="scan'208";a="866036707" Received: from dpdk-qiming3.sh.intel.com ([10.67.111.4]) by fmsmga001.fm.intel.com with ESMTP; 12 Jul 2023 01:49:30 -0700 From: Qiming Yang To: dev@dpdk.org Cc: beilei.xing@intel.com, qi.z.zhang@intel.com, Qiming Yang , stable@dpdk.org, Jie Hai Subject: [PATCH v2 1/3] net/ixgbevf: fix Rx and Tx queue status get Date: Wed, 12 Jul 2023 08:31:51 +0000 Message-Id: <20230712083153.3250798-2-qiming.yang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230712083153.3250798-1-qiming.yang@intel.com> References: <20230712083153.3250798-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") Cc: stable@dpdk.org 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);