net/mlx5e: CT: Fix ipv6 nat header rewrite actions

[ Upstream commit 0d156f2ded ]

Set the ipv6 word fields according to the hardware definitions.

Fixes: ac991b48d4 ("net/mlx5e: CT: Offload established flows")
Signed-off-by: Oz Shlomo <ozsh@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Oz Shlomo
2020-06-07 15:40:40 +00:00
committed by Greg Kroah-Hartman
parent 733bcf622c
commit b68d196b0c

View File

@@ -320,21 +320,21 @@ mlx5_tc_ct_parse_mangle_to_mod_act(struct flow_action_entry *act,
case FLOW_ACT_MANGLE_HDR_TYPE_IP6: case FLOW_ACT_MANGLE_HDR_TYPE_IP6:
MLX5_SET(set_action_in, modact, length, 0); MLX5_SET(set_action_in, modact, length, 0);
if (offset == offsetof(struct ipv6hdr, saddr)) if (offset == offsetof(struct ipv6hdr, saddr) + 12)
field = MLX5_ACTION_IN_FIELD_OUT_SIPV6_31_0; field = MLX5_ACTION_IN_FIELD_OUT_SIPV6_31_0;
else if (offset == offsetof(struct ipv6hdr, saddr) + 4)
field = MLX5_ACTION_IN_FIELD_OUT_SIPV6_63_32;
else if (offset == offsetof(struct ipv6hdr, saddr) + 8) else if (offset == offsetof(struct ipv6hdr, saddr) + 8)
field = MLX5_ACTION_IN_FIELD_OUT_SIPV6_63_32;
else if (offset == offsetof(struct ipv6hdr, saddr) + 4)
field = MLX5_ACTION_IN_FIELD_OUT_SIPV6_95_64; field = MLX5_ACTION_IN_FIELD_OUT_SIPV6_95_64;
else if (offset == offsetof(struct ipv6hdr, saddr) + 12) else if (offset == offsetof(struct ipv6hdr, saddr))
field = MLX5_ACTION_IN_FIELD_OUT_SIPV6_127_96; field = MLX5_ACTION_IN_FIELD_OUT_SIPV6_127_96;
else if (offset == offsetof(struct ipv6hdr, daddr))
field = MLX5_ACTION_IN_FIELD_OUT_DIPV6_31_0;
else if (offset == offsetof(struct ipv6hdr, daddr) + 4)
field = MLX5_ACTION_IN_FIELD_OUT_DIPV6_63_32;
else if (offset == offsetof(struct ipv6hdr, daddr) + 8)
field = MLX5_ACTION_IN_FIELD_OUT_DIPV6_95_64;
else if (offset == offsetof(struct ipv6hdr, daddr) + 12) else if (offset == offsetof(struct ipv6hdr, daddr) + 12)
field = MLX5_ACTION_IN_FIELD_OUT_DIPV6_31_0;
else if (offset == offsetof(struct ipv6hdr, daddr) + 8)
field = MLX5_ACTION_IN_FIELD_OUT_DIPV6_63_32;
else if (offset == offsetof(struct ipv6hdr, daddr) + 4)
field = MLX5_ACTION_IN_FIELD_OUT_DIPV6_95_64;
else if (offset == offsetof(struct ipv6hdr, daddr))
field = MLX5_ACTION_IN_FIELD_OUT_DIPV6_127_96; field = MLX5_ACTION_IN_FIELD_OUT_DIPV6_127_96;
else else
return -EOPNOTSUPP; return -EOPNOTSUPP;