DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix lro update tcp header cksum error
@ 2023-04-12 11:38 jiangheng (G)
  2023-04-12 14:06 ` Slava Ovsiienko
  0 siblings, 1 reply; 2+ messages in thread
From: jiangheng (G) @ 2023-04-12 11:38 UTC (permalink / raw)
  To: dev, matan, viacheslavo

csum is the sum of three 16 bits value
it must be folded twice to ensure that the upper 16 bits are 0
---
 drivers/net/mlx5/mlx5_rx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
index a2be523e9e..ae537dfffa 100644
--- a/drivers/net/mlx5/mlx5_rx.c
+++ b/drivers/net/mlx5/mlx5_rx.c
@@ -1090,6 +1090,7 @@ mlx5_lro_update_tcp_hdr(struct rte_tcp_hdr *__rte_restrict tcp,
    tcp->cksum = 0;
    csum += rte_raw_cksum(tcp, (tcp->data_off >> 4) * 4);
    csum = ((csum & 0xffff0000) >> 16) + (csum & 0xffff);
+   csum = ((csum & 0xffff0000) >> 16) + (csum & 0xffff);
    csum = (~csum) & 0xffff;
    if (csum == 0)
        csum = 0xffff;
--
2.27.0

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

end of thread, other threads:[~2023-04-12 14:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-12 11:38 [PATCH] net/mlx5: fix lro update tcp header cksum error jiangheng (G)
2023-04-12 14:06 ` Slava Ovsiienko

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).