Skip to content

Commit 2e72eb4

Browse files
ogerlitzdavem330
authored andcommitted
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: bbd00f7 ('net/mlx5e: Add TC tunnel release action for SRIOV offloads') Signed-off-by: Or Gerlitz <[email protected]> Reviewed-by: Hadar Hen Zion <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a42485e commit 2e72eb4

File tree

1 file changed

+9
-4
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,
225225
void *headers_v = MLX5_ADDR_OF(fte_match_param, spec->match_value,
226226
outer_headers);
227227

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+
228233
if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_ENC_PORTS)) {
229234
struct flow_dissector_key_ports *key =
230235
skb_flow_dissector_target(f->dissector,
@@ -264,7 +269,7 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,
264269
return -EOPNOTSUPP;
265270
}
266271

267-
if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS)) {
272+
if (enc_control->addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) {
268273
struct flow_dissector_key_ipv4_addrs *key =
269274
skb_flow_dissector_target(f->dissector,
270275
FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS,
@@ -286,10 +291,10 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,
286291
MLX5_SET(fte_match_set_lyr_2_4, headers_v,
287292
dst_ipv4_dst_ipv6.ipv4_layout.ipv4,
288293
ntohl(key->dst));
289-
}
290294

291-
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);
295+
MLX5_SET_TO_ONES(fte_match_set_lyr_2_4, headers_c, ethertype);
296+
MLX5_SET(fte_match_set_lyr_2_4, headers_v, ethertype, ETH_P_IP);
297+
}
293298

294299
/* Enforce DMAC when offloading incoming tunneled flows.
295300
* Flow counters require a match on the DMAC.

0 commit comments

Comments
 (0)