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 463C543E42 for ; Thu, 11 Apr 2024 10:55:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 406614064C; Thu, 11 Apr 2024 10:55:05 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 2772440268 for ; Thu, 11 Apr 2024 10:55:03 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VFYNT1vYWz2NW7K; Thu, 11 Apr 2024 16:52:09 +0800 (CST) Received: from kwepemf500004.china.huawei.com (unknown [7.202.181.242]) by mail.maildlp.com (Postfix) with ESMTPS id C1315140156; Thu, 11 Apr 2024 16:55:01 +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:55:01 +0800 From: Jie Hai To: , , Heinrich Kuhn , Konstantin Ananyev <"konstantin.v.ananyev@yandex.rukonstantin.ananyev"@huawei.com>, Lijun Ou , Ferruh Yigit , Thomas Monjalon , Chengwen Feng CC: , , , Subject: [PATCH 21.11 2/2] net/nfp: fix Rx and Tx queue state Date: Thu, 11 Apr 2024 16:49:54 +0800 Message-ID: <20240411084954.2251434-3-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 c46216e77ac3b1890eb622bea4bcc8c54f9da820 ] 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: Chaoyong He --- drivers/net/nfp/nfp_ethdev.c | 6 ++++++ drivers/net/nfp/nfp_ethdev_vf.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index e1da0bdebed1..4edf08251c77 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -89,6 +89,7 @@ nfp_net_start(struct rte_eth_dev *dev) struct rte_eth_conf *dev_conf; struct rte_eth_rxmode *rxmode; uint32_t intr_vector; + uint16_t i; int ret; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -185,6 +186,11 @@ nfp_net_start(struct rte_eth_dev *dev) nfp_eth_set_configured(dev->process_private, hw->nfp_idx, 1); + 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; error: diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index 0dda3961ce57..a61c73a96e1c 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -57,6 +57,7 @@ nfp_netvf_start(struct rte_eth_dev *dev) struct rte_eth_conf *dev_conf; struct rte_eth_rxmode *rxmode; uint32_t intr_vector; + uint16_t i; int ret; hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -133,6 +134,11 @@ nfp_netvf_start(struct rte_eth_dev *dev) goto error; } + 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; error: -- 2.30.0