DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix order of lines in loop
@ 2019-08-05 11:51 Dekel Peled
  2019-08-05 12:16 ` Eli Britstein
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dekel Peled @ 2019-08-05 11:51 UTC (permalink / raw)
  To: yskoh, viacheslavo, shahafs; +Cc: orika, dev, elibr

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")
Cc: elibr@mellanox.com

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 536059d..6c58634 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1504,9 +1504,9 @@ struct field_modify_info modify_tcp[] = {
 
 	/* 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 */
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-06  7:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 11:51 [dpdk-dev] [PATCH] net/mlx5: fix order of lines in loop Dekel Peled
2019-08-05 12:16 ` Eli Britstein
2019-08-05 12:44 ` Slava Ovsiienko
2019-08-05 15:16 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).