Acked-by: Hemant Agrawal <hemant.agra...@nxp.com>
> -----Original Message-----
> From: Jie Hai <haij...@huawei.com>
> Sent: Friday, September 8, 2023 4:59 PM
> To: dev@dpdk.org; Hemant Agrawal <hemant.agra...@nxp.com>; Sachin
> Saxena <sachin.sax...@nxp.com>; Thomas Monjalon
> <tho...@monjalon.net>; Konstantin Ananyev
> <"konstantin.v.ananyev@yandex.rukonstantin.ananyev"@huawei.com>;
> Chengwen Feng <fengcheng...@huawei.com>; Ferruh Yigit
> <ferruh.yi...@intel.com>; Lijun Ou <ouli...@huawei.com>
> Cc: haij...@huawei.com; lihuis...@huawei.com
> Subject: [PATCH 10/36] net/dpaa2: fix Rx and Tx queue state
> Importance: High
>
> 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: sta...@dpdk.org
>
> Signed-off-by: Jie Hai <haij...@huawei.com>
> ---
> drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c
> b/drivers/net/dpaa2/dpaa2_ethdev.c
> index 679f33ae1a08..8e610b6bba30 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -1278,6 +1278,11 @@ dpaa2_dev_start(struct rte_eth_dev *dev)
> if (priv->en_ordered)
> dev->tx_pkt_burst = dpaa2_dev_tx_ordered;
>
> + 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;
> }
>
> @@ -1295,6 +1300,7 @@ dpaa2_dev_stop(struct rte_eth_dev *dev)
> struct rte_device *rdev = dev->device;
> struct rte_intr_handle *intr_handle;
> struct rte_dpaa2_device *dpaa2_dev;
> + uint16_t i;
>
> dpaa2_dev = container_of(rdev, struct rte_dpaa2_device, device);
> intr_handle = dpaa2_dev->intr_handle;
> @@ -1329,6 +1335,11 @@ dpaa2_dev_stop(struct rte_eth_dev *dev)
> memset(&link, 0, sizeof(link));
> rte_eth_linkstatus_set(dev, &link);
>
> + for (i = 0; i < dev->data->nb_rx_queues; i++)
> + dev->data->rx_queue_state[i] =
> RTE_ETH_QUEUE_STATE_STOPPED;
> + for (i = 0; i < dev->data->nb_tx_queues; i++)
> + dev->data->tx_queue_state[i] =
> RTE_ETH_QUEUE_STATE_STOPPED;
> +
> return 0;
> }
>
> --
> 2.30.0