net/mlx5: E-Switch, Refactor rule offload forward action processing
authorVlad Buslov <vladbu@nvidia.com>
Wed, 20 Jan 2021 19:51:45 +0000 (21:51 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Sat, 6 Feb 2021 04:53:35 +0000 (20:53 -0800)
commit9e51c0a624925076fe07a09674172495c8c09e59
tree1fa1ed855e0c2a3ec74190de9bed1117560928a4
parent275c21d6cbe2ffb49aa1f054bff7ddfc9126564c
net/mlx5: E-Switch, Refactor rule offload forward action processing

Following patches in the series extend forwarding functionality with VF
tunnel TX and RX handling. Extract action forwarding processing code into
dedicated functions to simplify further extensions:

- Handle every forwarding case with dedicated function instead of inline
code.

- Extract forwarding dest dispatch conditional into helper function
esw_setup_dests().

- Unify forwaring cleanup code in error path of
mlx5_eswitch_add_offloaded_rule() and in rule deletion code of
__mlx5_eswitch_del_rule() in new helper function esw_cleanup_dests() (dual
to new esw_setup_dests() helper).

This patch does not change functionality.

Co-developed-by: Dmytro Linkin <dlinkin@nvidia.com>
Signed-off-by: Dmytro Linkin <dlinkin@nvidia.com>
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c