aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2017-12-05 22:02:46 +0000
committerEd Maste <emaste@FreeBSD.org>2017-12-05 22:02:46 +0000
commit7fe94db2655f9f1590c6574734edab11a6918633 (patch)
tree255e177ceff83c69e2b8e2d256b5d5259ed73de7 /sys
parent3670d4c79af6f7c244cda7eca9af168133a23626 (diff)
downloadsrc-7fe94db2655f9f1590c6574734edab11a6918633.tar.gz
src-7fe94db2655f9f1590c6574734edab11a6918633.zip
vnic: apply hardware L3 checksum only for IPv4
Previously we set the csum_l3 flag for IPv4 and IPv6, but only IPv4 should have header checksumming applied. Prompted by Linux commit fa6d7cb5d76cf0467c61420fc9238045aedfd379. Reviewed by: bz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13366
Notes
Notes: svn path=/head/; revision=326597
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/vnic/nicvf_queues.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/vnic/nicvf_queues.c b/sys/dev/vnic/nicvf_queues.c
index 51d043a74145..7a1dda8f3570 100644
--- a/sys/dev/vnic/nicvf_queues.c
+++ b/sys/dev/vnic/nicvf_queues.c
@@ -1802,6 +1802,8 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qentry,
if (mbuf == NULL)
return (ENOBUFS);
}
+ if (mbuf->m_pkthdr.csum_flags & CSUM_IP)
+ hdr->csum_l3 = 1; /* Enable IP csum calculation */
ip = (struct ip *)(mbuf->m_data + ehdrlen);
iphlen = ip->ip_hl << 2;
@@ -1809,13 +1811,10 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qentry,
proto = ip->ip_p;
break;
#endif
- default:
- hdr->csum_l3 = 0;
}
#if defined(INET6) || defined(INET)
if (poff > 0 && mbuf->m_pkthdr.csum_flags != 0) {
- hdr->csum_l3 = 1; /* Enable IP csum calculation */
switch (proto) {
case IPPROTO_TCP:
if ((mbuf->m_pkthdr.csum_flags & CSUM_TCP) == 0)