net/mlx5: fix age action pool protection
authorJiawei Wang <jiaweiw@nvidia.com>
Mon, 1 Nov 2021 06:30:39 +0000 (08:30 +0200)
committerRaslan Darawsheh <rasland@nvidia.com>
Mon, 1 Nov 2021 13:53:35 +0000 (14:53 +0100)
commit7cf2d15a399255eca96746948a715f678736eebf
tree18b5e0281a8358beeabc55663bc389059a498180
parentcbf4cfa8f60ba7a07314a73f296efafb8c2d1fb8
net/mlx5: fix age action pool protection

The age action with flows creation could be supported on the multiple
threads. The age pools were created to manage the age resources, if
there is no room in the current pool then resize the age pool to the new
pool size and free the old one.

There's a race condition while one thread resizes the age pool and the
old pool resource be freed, and another thread query the age action
value of the old pool so the queried value is invalid.

This patch uses the read-write lock to protect the pool resource while
resizing and query.

Fixes: a5835d530f00 ("net/mlx5: optimize Rx queue match")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow_aso.c
drivers/net/mlx5/mlx5_flow_dv.c