提交 5c6684da 编写于 作者: A Alaa Hleihel 提交者: Zheng Zengkai

net/mlx5e: Allow to match on MPLS parameters only for MPLS over UDP

stable inclusion
from stable-5.10.27
commit c83207bb02d6bd0e3ad1e0c0e2e8487b2ac72f47
bugzilla: 51493

--------------------------------

[ Upstream commit 7d6c86e3 ]

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: 72046a91 ("net/mlx5e: Allow to match on mpls parameters")
Signed-off-by: NAlaa Hleihel <alaa@nvidia.com>
Reviewed-by: NRoi Dayan <roid@nvidia.com>
Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: N  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f6450ab1
...@@ -2597,6 +2597,16 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, ...@@ -2597,6 +2597,16 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
*match_level = MLX5_MATCH_L4; *match_level = MLX5_MATCH_L4;
} }
/* Currenlty supported only for MPLS over UDP */
if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_MPLS) &&
!netif_is_bareudp(filter_dev)) {
NL_SET_ERR_MSG_MOD(extack,
"Matching on MPLS is supported only for MPLS over UDP");
netdev_err(priv->netdev,
"Matching on MPLS is supported only for MPLS over UDP\n");
return -EOPNOTSUPP;
}
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册