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 1B49243E42 for ; Thu, 11 Apr 2024 10:55:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 130F5402A8; Thu, 11 Apr 2024 10:55:04 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 0CE0740268 for ; Thu, 11 Apr 2024 10:55:02 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4VFYN569HJzXl9g; Thu, 11 Apr 2024 16:51:49 +0800 (CST) Received: from kwepemf500004.china.huawei.com (unknown [7.202.181.242]) by mail.maildlp.com (Postfix) with ESMTPS id 7B25A18007C; Thu, 11 Apr 2024 16:54:59 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemf500004.china.huawei.com (7.202.181.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 11 Apr 2024 16:54:58 +0800 From: Jie Hai To: , , Chandubabu Namburu , Lijun Ou , Ferruh Yigit , Chengwen Feng , Thomas Monjalon , Konstantin Ananyev <"konstantin.v.ananyev@yandex.rukonstantin.ananyev"@huawei.com> CC: , , , Subject: [PATCH 21.11 1/2] net/axgbe: fix Rx and Tx queue state Date: Thu, 11 Apr 2024 16:49:53 +0800 Message-ID: <20240411084954.2251434-2-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240411084954.2251434-1-haijie1@huawei.com> References: <20240411084954.2251434-1-haijie1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemf500004.china.huawei.com (7.202.181.242) X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [ upstream commit 0236016c029de914c6ae083b1fa8ef2555d4c798 ] The DPDK framework reports the queue state, which is stored in dev->data->tx_queue_state and dev->data->rx_queue_state. The state is maintained by the driver. Users may determine whether a queue participates in packet forwarding based on the state. Therefore, the driver needs to modify the queue state in time according to the actual situation. Fixes: 9ad9ff476cac ("ethdev: add queue state in queried queue information") Cc: stable@dpdk.org Signed-off-by: Jie Hai Acked-by: Ferruh Yigit --- drivers/net/axgbe/axgbe_ethdev.c | 6 ++++++ drivers/net/axgbe/axgbe_rxtx.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index 5add4032354c..a7812f03c1c2 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -353,6 +353,7 @@ axgbe_dev_start(struct rte_eth_dev *dev) int ret; struct rte_eth_dev_data *dev_data = dev->data; uint16_t max_pkt_len; + uint16_t i; dev->dev_ops = &axgbe_eth_dev_ops; @@ -397,6 +398,11 @@ axgbe_dev_start(struct rte_eth_dev *dev) else dev->rx_pkt_burst = &axgbe_recv_pkts; + for (i = 0; i < dev->data->nb_rx_queues; i++) + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; + for (i = 0; i < dev->data->nb_tx_queues; i++) + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; + return 0; } diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c index 1de5b29f06c8..f993919637b1 100644 --- a/drivers/net/axgbe/axgbe_rxtx.c +++ b/drivers/net/axgbe/axgbe_rxtx.c @@ -928,6 +928,7 @@ void axgbe_dev_clear_queues(struct rte_eth_dev *dev) axgbe_rx_queue_release(rxq); dev->data->rx_queues[i] = NULL; } + dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; } for (i = 0; i < dev->data->nb_tx_queues; i++) { @@ -937,6 +938,7 @@ void axgbe_dev_clear_queues(struct rte_eth_dev *dev) axgbe_tx_queue_release(txq); dev->data->tx_queues[i] = NULL; } + dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; } } -- 2.30.0