summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ethersubr.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2009-02-03 11:00:43 +0000
committerrrs <rrs@FreeBSD.org>2009-02-03 11:00:43 +0000
commit2688c691800f6933c6b9eeeb46cf522db6f1af5c (patch)
tree23b147e1d579bbf8d4eb4845fe7846b01184ffc7 /sys/net/if_ethersubr.c
parent3091212869dee5f2673091658796eb1badc0135f (diff)
downloadFreeBSD-src-2688c691800f6933c6b9eeeb46cf522db6f1af5c.zip
FreeBSD-src-2688c691800f6933c6b9eeeb46cf522db6f1af5c.tar.gz
Adds support for SCTP checksum offload. This means
we, like TCP and UDP, move the checksum calculation into the IP routines when there is no hardware support we call into the normal SCTP checksum routine. The next round of SCTP updates will use this functionality. Of course the IGB driver needs a few updates to support the new intel controller set that actually does SCTP csum offload too. Reviewed by: gnn, rwatson, kmacy
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r--sys/net/if_ethersubr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 73a08dd..e74bb74 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -299,6 +299,8 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
csum_flags |= (CSUM_IP_CHECKED|CSUM_IP_VALID);
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA)
csum_flags |= (CSUM_DATA_VALID|CSUM_PSEUDO_HDR);
+ if (m->m_pkthdr.csum_flags & CSUM_SCTP)
+ csum_flags |= CSUM_SCTP_VALID;
m->m_pkthdr.csum_flags |= csum_flags;
m->m_pkthdr.csum_data = 0xffff;
return (if_simloop(ifp, m, dst->sa_family, 0));
@@ -339,6 +341,8 @@ ether_output(struct ifnet *ifp, struct mbuf *m,
csum_flags |= (CSUM_IP_CHECKED|CSUM_IP_VALID);
if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA)
csum_flags |= (CSUM_DATA_VALID|CSUM_PSEUDO_HDR);
+ if (m->m_pkthdr.csum_flags & CSUM_SCTP)
+ csum_flags |= CSUM_SCTP_VALID;
if (m->m_flags & M_BCAST) {
struct mbuf *n;
OpenPOWER on IntegriCloud