net/mlx5: fix Rx queue state update
authorMichael Baum <michaelba@nvidia.com>
Thu, 3 Sep 2020 10:13:33 +0000 (10:13 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Sep 2020 16:55:08 +0000 (18:55 +0200)
In order to support DevX Rx queue stop and start operations, the state
of the queue should be updated in FW.
The state update PRM command requires to set both the current state and
the new requested state.

The current state and the new requested state fields setting were
wrongly switched.

Switch them back to the correct setting.

Fixes: 161d103b231c ("net/mlx5: add queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/mlx5_rxq.c

index 0d16592..2e6cbd4 100644 (file)
@@ -505,8 +505,8 @@ mlx5_rx_queue_stop_primary(struct rte_eth_dev *dev, uint16_t idx)
                struct mlx5_devx_modify_rq_attr rq_attr;
 
                memset(&rq_attr, 0, sizeof(rq_attr));
-               rq_attr.rq_state = MLX5_RQC_STATE_RST;
-               rq_attr.state = MLX5_RQC_STATE_RDY;
+               rq_attr.rq_state = MLX5_RQC_STATE_RDY;
+               rq_attr.state = MLX5_RQC_STATE_RST;
                ret = mlx5_devx_cmd_modify_rq(rxq_ctrl->obj->rq, &rq_attr);
        }
        if (ret) {
@@ -604,7 +604,7 @@ mlx5_rx_queue_start_primary(struct rte_eth_dev *dev, uint16_t idx)
        rte_cio_wmb();
        *rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci);
        rte_cio_wmb();
-       /* Reset RQ consumer before moving queue ro READY state. */
+       /* Reset RQ consumer before moving queue to READY state. */
        *rxq->rq_db = rte_cpu_to_be_32(0);
        rte_cio_wmb();
        if (rxq_ctrl->obj->type == MLX5_RXQ_OBJ_TYPE_IBV) {
@@ -618,8 +618,8 @@ mlx5_rx_queue_start_primary(struct rte_eth_dev *dev, uint16_t idx)
                struct mlx5_devx_modify_rq_attr rq_attr;
 
                memset(&rq_attr, 0, sizeof(rq_attr));
-               rq_attr.rq_state = MLX5_RQC_STATE_RDY;
-               rq_attr.state = MLX5_RQC_STATE_RST;
+               rq_attr.rq_state = MLX5_RQC_STATE_RST;
+               rq_attr.state = MLX5_RQC_STATE_RDY;
                ret = mlx5_devx_cmd_modify_rq(rxq_ctrl->obj->rq, &rq_attr);
        }
        if (ret) {