Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Mar 2025 03:14:07 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 7b64ccdf9605 - stable/14 - mlx5: recalculate tcp checksum for ipv6 hw lro coalesced packet
Message-ID:  <202503200314.52K3E7YC086331@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=7b64ccdf9605d78b2f7c84cccba50833bb0e5a53

commit 7b64ccdf9605d78b2f7c84cccba50833bb0e5a53
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-02-14 11:17:20 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-03-20 03:13:37 +0000

    mlx5: recalculate tcp checksum for ipv6 hw lro coalesced packet
    
    (cherry picked from commit efe9a3996ee319358c51681a6d9da8b4bf608b03)
---
 sys/dev/mlx5/mlx5_en/mlx5_en_rx.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
index 266e8e804259..0a1cd2bc4aee 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
@@ -246,6 +246,15 @@ mlx5e_lro_update_hdr(struct mbuf *mb, struct mlx5_cqe64 *cqe)
 		ip6->ip6_hlim = cqe->lro_min_ttl;
 		ip6->ip6_plen = cpu_to_be16(tot_len -
 		    sizeof(struct ip6_hdr));
+
+		/* TCP checksum */
+		th->th_sum = 0;
+		tcp_csum = ~in6_cksum_partial_l2(mb, IPPROTO_TCP,
+		    sizeof(struct ether_header),
+		    sizeof(struct ether_header) + sizeof(struct ip6_hdr),
+		    tot_len - sizeof(struct ip6_hdr), th->th_off * 4) & 0xffff;
+		tcp_csum = csum_reduce(tcp_csum + cqe->check_sum);
+		th->th_sum = ~tcp_csum & 0xffff;
 	}
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202503200314.52K3E7YC086331>