net/mlx5e: Support tc block sharing for representors
authorVu Pham <vuhuong@mellanox.com>
Fri, 2 Aug 2019 23:13:10 +0000 (16:13 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 28 May 2020 01:13:48 +0000 (18:13 -0700)
commit553f9328385d954644d74dedb655f85b687a9470
tree1d5e8f42f30cfb7627f8df8f9f98e7639e9ec2ab
parent7e51891a237f9ea319f53f9beb83afb0077d88e6
net/mlx5e: Support tc block sharing for representors

Currently offloading a rule over a tc block shared by multiple
representors fails because an e-switch global hashtable to keep
the mapping from tc cookies to mlx5e flow instances is used, and
tc block sharing offloads the same rule/cookie multiple times,
each time for different representor sharing the tc block.

Changing the implementation and behavior by acknowledging and returning
success if the same rule/cookie is offloaded again to other slave
representor sharing the tc block by setting, checking and comparing
the netdev that added the rule first.

Signed-off-by: Vu Pham <vuhuong@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c