summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx5
diff options
context:
space:
mode:
authorRoi Dayan <roid@nvidia.com>2020-09-16 10:10:56 +0300
committerSaeed Mahameed <saeedm@nvidia.com>2021-03-16 16:48:38 -0700
commitec9457a6f64af41bb2b295efa34992903b0768a9 (patch)
tree2b665a1dc32ae239dc00ea2b5c0e4d95ed584c9e /drivers/net/ethernet/mellanox/mlx5
parent1aa48ca6aa9fe7d59b853d2edd295e0486547700 (diff)
net/mlx5e: Distinguish nic and esw offload in tc setup block cb
We will re-use the native NIC port net device instance for the Uplink representor, hence same ndos will be used. Now we need to distinguish in the TC callback if the mode is legacy or switchdev and set the proper flag. Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 78fc27fc4e37..8a3b2d76cc82 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -4892,9 +4892,14 @@ static int mlx5e_setup_tc_cls_flower(struct mlx5e_priv *priv,
int mlx5e_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
void *cb_priv)
{
- unsigned long flags = MLX5_TC_FLAG(INGRESS) | MLX5_TC_FLAG(NIC_OFFLOAD);
+ unsigned long flags = MLX5_TC_FLAG(INGRESS);
struct mlx5e_priv *priv = cb_priv;
+ if (mlx5e_is_uplink_rep(priv))
+ flags |= MLX5_TC_FLAG(ESW_OFFLOAD);
+ else
+ flags |= MLX5_TC_FLAG(NIC_OFFLOAD);
+
switch (type) {
case TC_SETUP_CLSFLOWER:
return mlx5e_setup_tc_cls_flower(priv, type_data, flags);