net/mlx5: fix indirect action modify rollback

Message ID 20210721125112.11161-1-dkozlyuk@nvidia.com (mailing list archive)
State Accepted, archived
Headers
Series net/mlx5: fix indirect action modify rollback |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Dmitry Kozlyuk July 21, 2021, 12:51 p.m. UTC
  mlx5_ind_table_obj_modify() first references queues from the new list,
then applies the new list to HW. In case of apply failure the function
dereferenced queues from the old list, while it should be the new list.

Fixes: fa7ad49e96b5 ("net/mlx5: fix shared RSS action update")
Cc: andreyv@nvidia.com
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon July 22, 2021, 2:04 p.m. UTC | #1
21/07/2021 14:51, Dmitry Kozlyuk:
> mlx5_ind_table_obj_modify() first references queues from the new list,
> then applies the new list to HW. In case of apply failure the function
> dereferenced queues from the old list, while it should be the new list.
> 
> Fixes: fa7ad49e96b5 ("net/mlx5: fix shared RSS action update")
> Cc: andreyv@nvidia.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Applied, thanks
  

Patch

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 23685d7654..06545ebf68 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -2086,7 +2086,7 @@  mlx5_ind_table_obj_modify(struct rte_eth_dev *dev,
 error:
 	err = rte_errno;
 	for (j = 0; j < i; j++)
-		mlx5_rxq_release(dev, ind_tbl->queues[j]);
+		mlx5_rxq_release(dev, queues[j]);
 	rte_errno = err;
 	DRV_LOG(DEBUG, "Port %u cannot setup indirection table.",
 		dev->data->port_id);