net/mlx5: fix sync meter action
PATCH 1/1 net/mlx5: fix sync meter action
PMD implements sync METER flow action as async.
Queue selected for sync operations is MLX5_HW_INV_QUEUE. That dummy queue value is translated into CTRL_QUEUE_ID(priv). Async job allocation converts INV queue into the real value, but job release does not.
This patch fixes the queue value provided to flow_hw_job_put().
This patch also removes dead code found in METER_MARK destroy handler.
Coverity issue: tag: 415806: Memory - corruptions (OVERRUN) Coverity issue: tag: 415804: Control flow issues (DEADCODE)
--- drivers/net/mlx5/mlx5_flow_hw.c | 5 +---- drivers/net/mlx5/mlx5_flow_meter.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/net/mlx5/mlx5_flow_hw.c +1 -4
@@ -11494,10 +11494,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue, NULL, "Unable to wait for ASO meter CQE");break ; } -if (!job) -mlx5_ipool_free (pool->idx_pool, idx); -else - aso = true; + aso = true;break ;case MLX5_INDIRECT_ACTION_TYPE_RSS : ret =flow_dv_action_destroy (dev, handle, error);
drivers/net/mlx5/mlx5_flow_meter.c +1 -1
@@ -2265,7 +2265,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, ret =mlx5_aso_meter_update_by_wqe (priv,MLX5_HW_INV_QUEUE , aso_mtr, &priv->mtr_bulk, job, true);if (ret) { -flow_hw_job_put (priv, job,MLX5_HW_INV_QUEUE ); +flow_hw_job_put (priv, job,CTRL_QUEUE_ID (priv));return -rte_mtr_error_set (error,ENOTSUP ,RTE_MTR_ERROR_TYPE_UNSPECIFIED ,NULL ,"Failed to create devx meter." );
Signature · 1 line
2.39.2
PATCH v2 1/1 net/mlx5: fix sync meter action
PMD implements sync METER flow action as async.
Queue selected for sync operations is MLX5_HW_INV_QUEUE. That dummy queue value is translated into CTRL_QUEUE_ID(priv). Async job allocation converts INV queue into the real value, but job release does not.
This patch fixes the queue value provided to flow_hw_job_put().
This patch also removes dead code found in METER_MARK destroy handler.
Coverity issue: 415806
Coverity issue: 415804
---
v2: Fixed Coverity tag.
--- drivers/net/mlx5/mlx5_flow_hw.c | 5 +---- drivers/net/mlx5/mlx5_flow_meter.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/net/mlx5/mlx5_flow_hw.c +1 -4
@@ -11494,10 +11494,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue, NULL, "Unable to wait for ASO meter CQE");break ; } -if (!job) -mlx5_ipool_free (pool->idx_pool, idx); -else - aso = true; + aso = true;break ;case MLX5_INDIRECT_ACTION_TYPE_RSS : ret =flow_dv_action_destroy (dev, handle, error);
drivers/net/mlx5/mlx5_flow_meter.c +1 -1
@@ -2265,7 +2265,7 @@ mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, ret =mlx5_aso_meter_update_by_wqe (priv,MLX5_HW_INV_QUEUE , aso_mtr, &priv->mtr_bulk, job, true);if (ret) { -flow_hw_job_put (priv, job,MLX5_HW_INV_QUEUE ); +flow_hw_job_put (priv, job,CTRL_QUEUE_ID (priv));return -rte_mtr_error_set (error,ENOTSUP ,RTE_MTR_ERROR_TYPE_UNSPECIFIED ,NULL ,"Failed to create devx meter." );
Signature · 1 line
2.39.2
Thomas Monjalon
Applied19/03/2024 12:24, Gregory Etelson:
Quoted 11 lines
PMD implements sync METER flow action as async.
Queue selected for sync operations isMLX5_HW_INV_QUEUE. That dummy queue value is translated intoCTRL_QUEUE_ID(priv). Async job allocation converts INV queue into the real value, but job release does not.This patch fixes the queue value provided to
flow_hw_job_put().This patch also removes dead code found in
METER_MARKdestroy handler.
Quoted 7 lines
Coverity issue: 415806
Coverity issue: 415804Fixes 4359d9d1f76b ("net/mlx5: fix sync meter processing in HWS")Signed-off-by Gregory Etelson <[email protected]>
Applied, thanks.