net/mlx5: fix zero out UDP checksum in encap data
authorEli Britstein <elibr@mellanox.com>
Wed, 22 Jan 2020 15:03:58 +0000 (15:03 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 5 Feb 2020 08:51:20 +0000 (09:51 +0100)
The cited commit zeroed the UDP checksum for raw-encap case.
Add the same handling for vxlan-encap case.

Fixes: bf1d7d9a033a ("net/mlx5: zero out UDP checksum in encapsulation")
Cc: stable@dpdk.org
Signed-off-by: Eli Britstein <elibr@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/mlx5_flow_dv.c

index fc156a3..a32f0be 100644 (file)
@@ -2883,8 +2883,6 @@ flow_dv_create_action_l2_encap(struct rte_eth_dev *dev,
                        (const struct rte_flow_action_raw_encap *)action->conf;
                res.size = raw_encap_data->size;
                memcpy(res.buf, raw_encap_data->data, res.size);
-               if (flow_dv_zero_encap_udp_csum(res.buf, error))
-                       return -rte_errno;
        } else {
                if (action->type == RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP)
                        encap_data =
@@ -2898,6 +2896,8 @@ flow_dv_create_action_l2_encap(struct rte_eth_dev *dev,
                                               &res.size, error))
                        return -rte_errno;
        }
+       if (flow_dv_zero_encap_udp_csum(res.buf, error))
+               return -rte_errno;
        if (flow_dv_encap_decap_resource_register(dev, &res, dev_flow, error))
                return rte_flow_error_set(error, EINVAL,
                                          RTE_FLOW_ERROR_TYPE_ACTION,