summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDekel Peled <dekelp@mellanox.com>2019-08-05 14:51:19 +0300
committerRaslan Darawsheh <rasland@mellanox.com>2019-08-06 17:42:12 +0200
commit1f1eb0949c1889ec5cd62e0619c3336fa0619af9 (patch)
treed23d22fc941cd9c8bf9332c4ced20bcc5f4d80cf
parent6fd05da9efbd387d0f1fdd7824bc5298dff368fe (diff)
downloaddpdk-1f1eb0949c1889ec5cd62e0619c3336fa0619af9.zip
dpdk-1f1eb0949c1889ec5cd62e0619c3336fa0619af9.tar.gz
dpdk-1f1eb0949c1889ec5cd62e0619c3336fa0619af9.tar.xz
net/mlx5: fix UDP checksum zeroing
Function flow_dv_zero_encap_udp_csum() uses a while loop to iterate over vlan items in flow rule. Pointer next_hdr is incremented to the next item before it is used, so the first item is skipped. This patch moves the incrementing of next_hdr to the correct place. Fixes: bf1d7d9a033a ("net/mlx5: zero out UDP checksum in encapsulation") Signed-off-by: Dekel Peled <dekelp@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
-rw-r--r--drivers/net/mlx5/mlx5_flow_dv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index a7d677f..ca7252a 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1504,9 +1504,9 @@ flow_dv_zero_encap_udp_csum(void *data, struct rte_flow_error *error)
/* VLAN skipping */
while (proto == RTE_ETHER_TYPE_VLAN || proto == RTE_ETHER_TYPE_QINQ) {
- next_hdr += sizeof(struct rte_vlan_hdr);
vlan = (struct rte_vlan_hdr *)next_hdr;
proto = RTE_BE16(vlan->eth_proto);
+ next_hdr += sizeof(struct rte_vlan_hdr);
}
/* HW calculates IPv4 csum. no need to proceed */