Mellanox, mlx5 fixes 2019-07-15
Hi Dave,
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.
Thanks,
Saeed.
---
The following changes since commit f384e62a82ba5d85408405fdd6aeff89354deaa9:
ISDN: hfcsusb: checking idx of ep configuration (2019-07-15 11:10:31 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux.git tags/mlx5-fixes-2019-07-15
for you to fetch changes up to 3d144578c91a2db417923ba905ce7a84ce0c274b:
net/mlx5e: Allow dissector meta key in tc flower (2019-07-15 13:04:04 -0700)
----------------------------------------------------------------
mlx5-fixes-2019-07-15
----------------------------------------------------------------
Eli Cohen (1):
net/mlx5e: Verify encapsulation is supported
Vlad Buslov (2):
net/mlx5e: Rely on filter_dev instead of dissector keys for tunnels net/mlx5e: Allow dissector meta key in tc flower
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
PATCH 1/3 net/mlx5e: Verify encapsulation is supported
From: Eli Cohen <[email protected]>
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.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +4 -0
@@ -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);
Signature · 1 line
2.21.0
PATCH 2/3 net/mlx5e: Rely on filter_dev instead of dissector keys for tunnels
In reply to Saeed MahameedFrom: Vlad Buslov <[email protected]>
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.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 -5
@@ -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 ;
Signature · 1 line
2.21.0
PATCH 3/3 net/mlx5e: Allow dissector meta key in tc flower
In reply to Saeed MahameedFrom: Vlad Buslov <[email protected]>
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.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +2 -1
@@ -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) |
Signature · 1 line
2.21.0
David Miller
maintainerFrom: Saeed Mahameed <[email protected]>
Date: Mon, 15 Jul 2019 20:09:53 +0000
Quoted 4 lines
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.