Skip to content

Commit 7d6c86e

Browse files
alaahlSaeed Mahameed
authored andcommitted
net/mlx5e: Allow to match on MPLS parameters only for MPLS over UDP
Currently, we support hardware offload only for MPLS over UDP. However, rules matching on MPLS parameters are now wrongly offloaded for regular MPLS, without actually taking the parameters into consideration when doing the offload. Fix it by rejecting such unsupported rules. Fixes: 72046a9 ("net/mlx5e: Allow to match on mpls parameters") Signed-off-by: Alaa Hleihel <[email protected]> Reviewed-by: Roi Dayan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent a072310 commit 7d6c86e

File tree

1 file changed

+10
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+10
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,6 +2296,16 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
22962296
*match_level = MLX5_MATCH_L4;
22972297
}
22982298

2299+
/* Currenlty supported only for MPLS over UDP */
2300+
if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_MPLS) &&
2301+
!netif_is_bareudp(filter_dev)) {
2302+
NL_SET_ERR_MSG_MOD(extack,
2303+
"Matching on MPLS is supported only for MPLS over UDP");
2304+
netdev_err(priv->netdev,
2305+
"Matching on MPLS is supported only for MPLS over UDP\n");
2306+
return -EOPNOTSUPP;
2307+
}
2308+
22992309
return 0;
23002310
}
23012311

0 commit comments

Comments
 (0)