aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2017-01-10 15:33:33 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-10 21:34:01 -0500
commit2e72eb438ce5ea9fa118edfd9a5f628c2a69111a (patch)
tree25465ef4a62dbf60e175f7e58ecd52fbd802e0f1 /drivers/net
parenta42485eb0ee458da3a0df82b0e42ab58ce76be05 (diff)
net/mlx5e: Properly get address type of encapsulation IP headers
As done elsewhere in our TC/flower offload code, the address type of the encapsulation IP headers should be realized accroding to the addr_type field of the encapsulation control dissector key, do that. Fixes: bbd00f7e2349 ('net/mlx5e: Add TC tunnel release action for SRIOV offloads') Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Hadar Hen Zion <hadarh@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_tc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index b62f06f3f7e0..9cfddd9fc097 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -225,6 +225,11 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,
225 void *headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value, 225 void *headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value,
226 outer_headers); 226 outer_headers);
227 227
228 struct flow_dissector_key_control *enc_control =
229 skb_flow_dissector_target(f->dissector,
230 FLOW_DISSECTOR_KEY_ENC_CONTROL,
231 f->key);
232
228 if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_ENC_PORTS)) { 233 if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_ENC_PORTS)) {
229 struct flow_dissector_key_ports *key = 234 struct flow_dissector_key_ports *key =
230 skb_flow_dissector_target(f->dissector, 235 skb_flow_dissector_target(f->dissector,
@@ -264,7 +269,7 @@ vxlan_match_offload_err:
264 return -EOPNOTSUPP; 269 return -EOPNOTSUPP;
265 } 270 }
266 271
267 if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS)) { 272 if (enc_control->addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) {
268 struct flow_dissector_key_ipv4_addrs *key = 273 struct flow_dissector_key_ipv4_addrs *key =
269 skb_flow_dissector_target(f->dissector, 274 skb_flow_dissector_target(f->dissector,
270 FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS, 275 FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS,
@@ -286,10 +291,10 @@ vxlan_match_offload_err:
286 MLX5_SET(fte_match_set_lyr_2_4, headers_v, 291 MLX5_SET(fte_match_set_lyr_2_4, headers_v,
287 dst_ipv4_dst_ipv6.ipv4_layout.ipv4, 292 dst_ipv4_dst_ipv6.ipv4_layout.ipv4,
288 ntohl(key->dst)); 293 ntohl(key->dst));
289 }
290 294
291 MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, ethertype); 295 MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, ethertype);
292 MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype, ETH_P_IP); 296 MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype, ETH_P_IP);
297 }
293 298
294 /* Enforce DMAC when offloading incoming tunneled flows. 299 /* Enforce DMAC when offloading incoming tunneled flows.
295 * Flow counters require a match on the DMAC. 300 * Flow counters require a match on the DMAC.