As mlx5 PMD is changed to be thread safe, all the flow-related
sub-objects inside the PMD should be thread safe. This commit
changes the index memory pools' lock configuration to be enabled.
That makes the index pool be thread safe.

Signed-off-by: Suanming Mou <suanmi...@nvidia.com>
Acked-by: Matan Azrad <ma...@nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 27c9c2a..dc5b7a4 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -191,7 +191,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -202,7 +202,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -213,7 +213,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -224,7 +224,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -235,7 +235,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -246,7 +246,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -257,7 +257,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -269,7 +269,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -280,7 +280,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -291,7 +291,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
@@ -306,7 +306,7 @@ static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
                .trunk_size = 64,
                .grow_trunk = 3,
                .grow_shift = 2,
-               .need_lock = 0,
+               .need_lock = 1,
                .release_mem_en = 1,
                .malloc = mlx5_malloc,
                .free = mlx5_free,
-- 
1.8.3.1

Reply via email to