svn commit: r238250 - in stable/9/sys: net netinet netinet6 sys
Michael Tuexen
tuexen at FreeBSD.org
Sun Jul 8 16:00:46 UTC 2012
Author: tuexen
Date: Sun Jul 8 16:00:45 2012
New Revision: 238250
URL: http://svn.freebsd.org/changeset/base/238250
Log:
MFC r236332:
Seperate SCTP checksum offloading for IPv4 and IPv6.
While there: remove some trainling whitespaces.
Approved by: re@
Modified:
stable/9/sys/net/if_loop.c
stable/9/sys/netinet/sctp_output.c
stable/9/sys/netinet6/ip6_forward.c
stable/9/sys/netinet6/ip6_output.c
stable/9/sys/sys/mbuf.h
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/net/if_loop.c
==============================================================================
--- stable/9/sys/net/if_loop.c Sun Jul 8 15:37:58 2012 (r238249)
+++ stable/9/sys/net/if_loop.c Sun Jul 8 16:00:45 2012 (r238250)
@@ -92,7 +92,7 @@
#endif
#define LO_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP)
-#define LO_CSUM_FEATURES6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP)
+#define LO_CSUM_FEATURES6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP_IPV6)
#define LO_CSUM_SET (CSUM_DATA_VALID | CSUM_DATA_VALID_IPV6 | \
CSUM_PSEUDO_HDR | \
CSUM_IP_CHECKED | CSUM_IP_VALID | \
Modified: stable/9/sys/netinet/sctp_output.c
==============================================================================
--- stable/9/sys/netinet/sctp_output.c Sun Jul 8 15:37:58 2012 (r238249)
+++ stable/9/sys/netinet/sctp_output.c Sun Jul 8 16:00:45 2012 (r238250)
@@ -4478,7 +4478,7 @@ sctp_lowlevel_chunk_output(struct sctp_i
#if defined(SCTP_WITH_NO_CSUM)
SCTP_STAT_INCR(sctps_sendnocrc);
#else
- m->m_pkthdr.csum_flags = CSUM_SCTP;
+ m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
m->m_pkthdr.csum_data = 0;
SCTP_STAT_INCR(sctps_sendhwcrc);
#endif
@@ -11069,7 +11069,7 @@ sctp_send_shutdown_complete2(struct mbuf
#if defined(SCTP_WITH_NO_CSUM)
SCTP_STAT_INCR(sctps_sendnocrc);
#else
- mout->m_pkthdr.csum_flags = CSUM_SCTP;
+ mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
mout->m_pkthdr.csum_data = 0;
SCTP_STAT_INCR(sctps_sendhwcrc);
#endif
@@ -12168,7 +12168,7 @@ sctp_send_abort(struct mbuf *m, int iphl
#if defined(SCTP_WITH_NO_CSUM)
SCTP_STAT_INCR(sctps_sendnocrc);
#else
- mout->m_pkthdr.csum_flags = CSUM_SCTP;
+ mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
mout->m_pkthdr.csum_data = 0;
SCTP_STAT_INCR(sctps_sendhwcrc);
#endif
@@ -12424,7 +12424,7 @@ sctp_send_operr_to(struct mbuf *m, int i
#if defined(SCTP_WITH_NO_CSUM)
SCTP_STAT_INCR(sctps_sendnocrc);
#else
- mout->m_pkthdr.csum_flags = CSUM_SCTP;
+ mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
mout->m_pkthdr.csum_data = 0;
SCTP_STAT_INCR(sctps_sendhwcrc);
#endif
Modified: stable/9/sys/netinet6/ip6_forward.c
==============================================================================
--- stable/9/sys/netinet6/ip6_forward.c Sun Jul 8 15:37:58 2012 (r238249)
+++ stable/9/sys/netinet6/ip6_forward.c Sun Jul 8 16:00:45 2012 (r238250)
@@ -587,7 +587,7 @@ skip_routing:
m->m_pkthdr.csum_data = 0xffff;
}
#ifdef SCTP
- if (m->m_pkthdr.csum_flags & CSUM_SCTP)
+ if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6)
m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
#endif
error = netisr_queue(NETISR_IPV6, m);
@@ -607,9 +607,9 @@ skip_routing:
m->m_pkthdr.csum_data = 0xffff;
}
#ifdef SCTP
- if (m->m_pkthdr.csum_flags & CSUM_SCTP)
- m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
-#endif
+ if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6)
+ m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
+#endif
error = netisr_queue(NETISR_IPV6, m);
goto out;
}
Modified: stable/9/sys/netinet6/ip6_output.c
==============================================================================
--- stable/9/sys/netinet6/ip6_output.c Sun Jul 8 15:37:58 2012 (r238249)
+++ stable/9/sys/netinet6/ip6_output.c Sun Jul 8 16:00:45 2012 (r238250)
@@ -508,7 +508,7 @@ skip_ipsec2:;
#ifdef FLOWTABLE
if (ro == &ip6route) {
struct flentry *fle;
-
+
/*
* The flow table returns route entries valid for up to 30
* seconds; we rely on the remainder of ip_output() taking no
@@ -521,7 +521,7 @@ skip_ipsec2:;
flevalid = 1;
}
}
-#endif
+#endif
again:
/*
* if specified, try to fill in the traffic class field.
@@ -667,7 +667,7 @@ again:
/*
* The outgoing interface must be in the zone of source and
- * destination addresses.
+ * destination addresses.
*/
origifp = ifp;
@@ -693,7 +693,7 @@ again:
goto badscope;
}
- /* We should use ia_ifp to support the case of
+ /* We should use ia_ifp to support the case of
* sending packets to an address of our own.
*/
if (ia != NULL && ia->ia_ifp)
@@ -891,7 +891,7 @@ again:
m->m_pkthdr.csum_data = 0xffff;
}
#ifdef SCTP
- if (m->m_pkthdr.csum_flags & CSUM_SCTP)
+ if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6)
m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
#endif
error = netisr_queue(NETISR_IPV6, m);
@@ -911,9 +911,9 @@ again:
m->m_pkthdr.csum_data = 0xffff;
}
#ifdef SCTP
- if (m->m_pkthdr.csum_flags & CSUM_SCTP)
+ if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6)
m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
-#endif
+#endif
error = netisr_queue(NETISR_IPV6, m);
goto done;
}
@@ -965,8 +965,8 @@ passout:
in6_delayed_cksum(m, plen, sizeof(struct ip6_hdr));
}
#ifdef SCTP
- if (sw_csum & CSUM_SCTP) {
- sw_csum &= ~CSUM_SCTP;
+ if (sw_csum & CSUM_SCTP_IPV6) {
+ sw_csum &= ~CSUM_SCTP_IPV6;
sctp_delayed_cksum(m, sizeof(struct ip6_hdr));
}
#endif
@@ -1081,9 +1081,9 @@ passout:
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6;
}
#ifdef SCTP
- if (m->m_pkthdr.csum_flags & CSUM_SCTP) {
+ if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) {
sctp_delayed_cksum(m, hlen);
- m->m_pkthdr.csum_flags &= ~CSUM_SCTP;
+ m->m_pkthdr.csum_flags &= ~CSUM_SCTP_IPV6;
}
#endif
mnext = &m->m_nextpkt;
Modified: stable/9/sys/sys/mbuf.h
==============================================================================
--- stable/9/sys/sys/mbuf.h Sun Jul 8 15:37:58 2012 (r238249)
+++ stable/9/sys/sys/mbuf.h Sun Jul 8 16:00:45 2012 (r238250)
@@ -115,7 +115,7 @@ struct pkthdr {
/* variables for ip and tcp reassembly */
void *header; /* pointer to packet header */
int len; /* total packet length */
- uint32_t flowid; /* packet's 4-tuple system
+ uint32_t flowid; /* packet's 4-tuple system
* flow identifier
*/
/* variables for hardware checksum */
@@ -283,7 +283,7 @@ struct mbuf {
#define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */
#define CSUM_TSO 0x0020 /* will do TSO */
#define CSUM_SCTP 0x0040 /* will csum SCTP */
-/* CSUM_SCTP_IPV6 0x0080 will csum IPv6/SCTP */
+#define CSUM_SCTP_IPV6 0x0080 /* will csum IPv6/SCTP */
#define CSUM_IP_CHECKED 0x0100 /* did csum IP */
#define CSUM_IP_VALID 0x0200 /* ... the csum is valid */
@@ -425,7 +425,7 @@ static __inline int
m_gettype(int size)
{
int type;
-
+
switch (size) {
case MSIZE:
type = EXT_MBUF;
@@ -455,7 +455,7 @@ static __inline uma_zone_t
m_getzone(int size)
{
uma_zone_t zone;
-
+
switch (size) {
case MSIZE:
zone = zone_mbuf;
@@ -594,7 +594,7 @@ m_free_fast(struct mbuf *m)
if (m->m_flags & M_PKTHDR)
KASSERT(SLIST_EMPTY(&m->m_pkthdr.tags), ("doing fast free of mbuf with tags"));
#endif
-
+
uma_zfree_arg(zone_mbuf, m, (void *)MB_NOTAGS);
}
@@ -654,7 +654,7 @@ m_cljset(struct mbuf *m, void *cl, int t
{
uma_zone_t zone;
int size;
-
+
switch (type) {
case EXT_CLUSTER:
size = MCLBYTES;
@@ -706,7 +706,7 @@ m_last(struct mbuf *m)
extern void (*m_addr_chg_pf_p)(struct mbuf *m);
-static __inline void
+static __inline void
m_addr_changed(struct mbuf *m)
{
@@ -1074,7 +1074,7 @@ m_tag_find(struct mbuf *m, int type, str
#define M_SETFIB(_m, _fib) do { \
_m->m_flags &= ~M_FIB; \
_m->m_flags |= (((_fib) << M_FIBSHIFT) & M_FIB); \
-} while (0)
+} while (0)
#endif /* _KERNEL */
More information about the svn-src-stable
mailing list