patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jie Hai <haijie1@huawei.com>
To: <stable@dpdk.org>, <ktraynor@redhat.com>,
	Heinrich Kuhn <heinrich.kuhn@corigine.com>,
	Konstantin Ananyev
	<"konstantin.v.ananyev@yandex.rukonstantin.ananyev"@huawei.com>,
	 Lijun Ou <oulijun@huawei.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Chengwen Feng <fengchengwen@huawei.com>
Cc: <lihuisong@huawei.com>, <fegchengwen@huawei.com>,
	<liuyonglong@huawei.com>, <huangdengdui@huawei.com>
Subject: [PATCH 21.11 2/2] net/nfp: fix Rx and Tx queue state
Date: Thu, 11 Apr 2024 16:49:54 +0800	[thread overview]
Message-ID: <20240411084954.2251434-3-haijie1@huawei.com> (raw)
In-Reply-To: <20240411084954.2251434-1-haijie1@huawei.com>

[ 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 <haijie1@huawei.com>
Acked-by: Chaoyong He <chaoyong.he@corigine.com>
---
 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


  parent reply	other threads:[~2024-04-11  8:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11  8:49 [PATCH 21.11 0/2] backport some patches to stable release 21.11.7 Jie Hai
2024-04-11  8:49 ` [PATCH 21.11 1/2] net/axgbe: fix Rx and Tx queue state Jie Hai
2024-04-11  8:49 ` Jie Hai [this message]
2024-04-18 12:31 ` [PATCH 21.11 0/2] backport some patches to stable release 21.11.7 Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240411084954.2251434-3-haijie1@huawei.com \
    --to=haijie1@huawei.com \
    --cc="konstantin.v.ananyev@yandex.rukonstantin.ananyev"@huawei.com \
    --cc=fegchengwen@huawei.com \
    --cc=fengchengwen@huawei.com \
    --cc=ferruh.yigit@intel.com \
    --cc=heinrich.kuhn@corigine.com \
    --cc=huangdengdui@huawei.com \
    --cc=ktraynor@redhat.com \
    --cc=lihuisong@huawei.com \
    --cc=liuyonglong@huawei.com \
    --cc=oulijun@huawei.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).