net/mlx5e: Allow concurrent creation of mod_hdr entries
authorVlad Buslov <vladbu@mellanox.com>
Thu, 8 Aug 2019 13:53:15 +0000 (16:53 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 9 Aug 2019 21:54:10 +0000 (14:54 -0700)
commita734d007173119fe8e7bde1689ee4123c529e238
tree94b6b21258809abf62dd6c11c7c34f150188ae7b
parentd2faae25c3050a87c8ff965a7939e999e3154b62
net/mlx5e: Allow concurrent creation of mod_hdr entries

Mod_hdr entries creation is fully synchronized by mod_hdr_tbl->lock. In
order to allow concurrent allocation of hardware resources used to offload
header rewrite, extend mlx5e_mod_hdr_entry with 'res_ready' completion.
Move call to mlx5_modify_header_alloc() out of mod_hdr_tbl->lock critical
section. Modify code that attaches new flows to existing mh to wait for
'res_ready' completion before using the entry. Insert mh to mod_hdr table
before provisioning it to hardware and modify all users of mod_hdr table to
verify that mh was fully initialized by checking completion result for
negative value (and to wait for 'res_ready' completion, if necessary).

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c