net/mlx5e: CT: Use rhashtable's ct entries instead of a separate list
authorPaul Blakey <paulb@mellanox.com>
Fri, 27 Mar 2020 09:12:31 +0000 (12:12 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Wed, 8 Apr 2020 22:46:54 +0000 (15:46 -0700)
commit9808dd0a2aeebcb72239a3b082159b0186d9ac3d
tree5a46422ff644893846fb9537e6e702c7d4655952
parent230a1bc2470c5554a8c2bfe14774863897dc9386
net/mlx5e: CT: Use rhashtable's ct entries instead of a separate list

Fixes CT entries list corruption.

After allowing parallel insertion/removals in upper nf flow table
layer, unprotected ct entries list can be corrupted by parallel add/del
on the same flow table.

CT entries list is only used while freeing a ct zone flow table to
go over all the ct entries offloaded on that zone/table, and flush
the table.

As rhashtable already provides an api to go over all the inserted entries,
fix the race by using the rhashtable iteration instead, and remove the list.

Fixes: 7da182a998d6 ("netfilter: flowtable: Use work entry per offload command")
Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c