From: Jie Hai <haijie1@huawei.com>
To: <stable@dpdk.org>, <ktraynor@redhat.com>,
Chandubabu Namburu <chandu@amd.com>,
Lijun Ou <oulijun@huawei.com>,
Ferruh Yigit <ferruh.yigit@intel.com>,
Chengwen Feng <fengchengwen@huawei.com>,
Thomas Monjalon <thomas@monjalon.net>,
Konstantin Ananyev
<"konstantin.v.ananyev@yandex.rukonstantin.ananyev"@huawei.com>
Cc: <lihuisong@huawei.com>, <fegchengwen@huawei.com>,
<liuyonglong@huawei.com>, <huangdengdui@huawei.com>
Subject: [PATCH 21.11 1/2] net/axgbe: fix Rx and Tx queue state
Date: Thu, 11 Apr 2024 16:49:53 +0800 [thread overview]
Message-ID: <20240411084954.2251434-2-haijie1@huawei.com> (raw)
In-Reply-To: <20240411084954.2251434-1-haijie1@huawei.com>
[ 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 <haijie1@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
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
next prev 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 ` Jie Hai [this message]
2024-04-11 8:49 ` [PATCH 21.11 2/2] net/nfp: fix Rx and Tx queue state Jie Hai
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-2-haijie1@huawei.com \
--to=haijie1@huawei.com \
--cc="konstantin.v.ananyev@yandex.rukonstantin.ananyev"@huawei.com \
--cc=chandu@amd.com \
--cc=fegchengwen@huawei.com \
--cc=fengchengwen@huawei.com \
--cc=ferruh.yigit@intel.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).