* [net 1/3] net/mlx5e: Verify encapsulation is supported
2019-07-15 20:09 [pull request][net 0/3] Mellanox, mlx5 fixes 2019-07-15 Saeed Mahameed
@ 2019-07-15 20:09 ` Saeed Mahameed
2019-07-15 20:09 ` [net 2/3] net/mlx5e: Rely on filter_dev instead of dissector keys for tunnels Saeed Mahameed
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2019-07-15 20:09 UTC (permalink / raw)
To: David S. Miller
Cc: netdev@vger.kernel.org, Eli Cohen, Roi Dayan, Saeed Mahameed
From: Eli Cohen <eli@mellanox.com>
When mlx5e_attach_encap() calls mlx5e_get_tc_tun() to get the tunnel
info data struct, check that returned value is not NULL, as would be in
the case of unsupported encapsulation.
Fixes: d386939a327d2 ("net/mlx5e: Rearrange tc tunnel code in a modular way")
Signed-off-by: Eli Cohen <eli@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 2d6436257f9d..018709a4343f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -2647,6 +2647,10 @@ static int mlx5e_attach_encap(struct mlx5e_priv *priv,
family = ip_tunnel_info_af(tun_info);
key.ip_tun_key = &tun_info->key;
key.tc_tunnel = mlx5e_get_tc_tun(mirred_dev);
+ if (!key.tc_tunnel) {
+ NL_SET_ERR_MSG_MOD(extack, "Unsupported tunnel");
+ return -EOPNOTSUPP;
+ }
hash_key = hash_encap_info(&key);
--
2.21.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [net 2/3] net/mlx5e: Rely on filter_dev instead of dissector keys for tunnels
2019-07-15 20:09 [pull request][net 0/3] Mellanox, mlx5 fixes 2019-07-15 Saeed Mahameed
2019-07-15 20:09 ` [net 1/3] net/mlx5e: Verify encapsulation is supported Saeed Mahameed
@ 2019-07-15 20:09 ` Saeed Mahameed
2019-07-15 20:09 ` [net 3/3] net/mlx5e: Allow dissector meta key in tc flower Saeed Mahameed
2019-07-16 0:20 ` [pull request][net 0/3] Mellanox, mlx5 fixes 2019-07-15 David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2019-07-15 20:09 UTC (permalink / raw)
To: David S. Miller
Cc: netdev@vger.kernel.org, Vlad Buslov, Roi Dayan, Saeed Mahameed
From: Vlad Buslov <vladbu@mellanox.com>
Currently, tunnel attributes are parsed and inner header matching is used
only when flow dissector specifies match on some of the supported
encapsulation fields. When user tries to offload tc filter that doesn't
match any encapsulation fields on tunnel device, mlx5 tc layer incorrectly
sets to match packet header keys on encap header (outer header) and
firmware rejects the rule with syndrome 0x7e1579 when creating new flow
group.
Change __parse_cls_flower() to determine whether tunnel is used based on
fitler_dev tunnel info, instead of determining it indirectly by checking
flow dissector enc keys.
Fixes: bbd00f7e2349 ("net/mlx5e: Add TC tunnel release action for SRIOV offloads")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 018709a4343f..b95e0ae4d7fd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1522,11 +1522,7 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
return -EOPNOTSUPP;
}
- if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) ||
- flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) ||
- flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_KEYID) ||
- flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_PORTS) ||
- flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ENC_OPTS)) {
+ if (mlx5e_get_tc_tun(filter_dev)) {
if (parse_tunnel_attr(priv, spec, f, filter_dev, tunnel_match_level))
return -EOPNOTSUPP;
--
2.21.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [net 3/3] net/mlx5e: Allow dissector meta key in tc flower
2019-07-15 20:09 [pull request][net 0/3] Mellanox, mlx5 fixes 2019-07-15 Saeed Mahameed
2019-07-15 20:09 ` [net 1/3] net/mlx5e: Verify encapsulation is supported Saeed Mahameed
2019-07-15 20:09 ` [net 2/3] net/mlx5e: Rely on filter_dev instead of dissector keys for tunnels Saeed Mahameed
@ 2019-07-15 20:09 ` Saeed Mahameed
2019-07-16 0:20 ` [pull request][net 0/3] Mellanox, mlx5 fixes 2019-07-15 David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Saeed Mahameed @ 2019-07-15 20:09 UTC (permalink / raw)
To: David S. Miller
Cc: netdev@vger.kernel.org, Vlad Buslov, Roi Dayan, Saeed Mahameed
From: Vlad Buslov <vladbu@mellanox.com>
Recently, fl_flow_key->indev_ifindex int field was refactored into
flow_dissector_key_meta field. With this, flower classifier also sets
FLOW_DISSECTOR_KEY_META flow dissector key. However, mlx5 flower dissector
validation code rejects filters that use flow dissector keys that are not
supported. Add FLOW_DISSECTOR_KEY_META to the list of allowed dissector
keys in __parse_cls_flower() to prevent following error when offloading
flower classifier to mlx5:
Error: mlx5_core: Unsupported key.
Fixes: 8212ed777f40 ("net: sched: cls_flower: use flow_dissector for ingress ifindex")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index b95e0ae4d7fd..cc096f6011d9 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1499,7 +1499,8 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
*match_level = MLX5_MATCH_NONE;
if (dissector->used_keys &
- ~(BIT(FLOW_DISSECTOR_KEY_CONTROL) |
+ ~(BIT(FLOW_DISSECTOR_KEY_META) |
+ BIT(FLOW_DISSECTOR_KEY_CONTROL) |
BIT(FLOW_DISSECTOR_KEY_BASIC) |
BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) |
BIT(FLOW_DISSECTOR_KEY_VLAN) |
--
2.21.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [pull request][net 0/3] Mellanox, mlx5 fixes 2019-07-15
2019-07-15 20:09 [pull request][net 0/3] Mellanox, mlx5 fixes 2019-07-15 Saeed Mahameed
` (2 preceding siblings ...)
2019-07-15 20:09 ` [net 3/3] net/mlx5e: Allow dissector meta key in tc flower Saeed Mahameed
@ 2019-07-16 0:20 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2019-07-16 0:20 UTC (permalink / raw)
To: saeedm; +Cc: netdev
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Mon, 15 Jul 2019 20:09:53 +0000
> This pull request provides mlx5 TC flower and tunnel fixes for
> kernel 5.2 from Eli and Vlad.
>
> Please pull and let me know if there is any problem.
Pulled, thanks Saeed.
^ permalink raw reply [flat|nested] 5+ messages in thread