summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2012-05-30 20:56:07 +0000
committertuexen <tuexen@FreeBSD.org>2012-05-30 20:56:07 +0000
commitdc64091687e3961e47dd73228c98b19328e0afe2 (patch)
tree167555626a68d277678998a3c3164b02f60735f7
parent747595cb72e908946de78a06c4d1a00f72b6cea3 (diff)
downloadFreeBSD-src-dc64091687e3961e47dd73228c98b19328e0afe2.zip
FreeBSD-src-dc64091687e3961e47dd73228c98b19328e0afe2.tar.gz
Seperate SCTP checksum offloading for IPv4 and IPv6.
While there: remove some trainling whitespaces. MFC after: 3 days X-MFC with: 236170
-rw-r--r--sys/net/if_loop.c2
-rw-r--r--sys/netinet/sctp_output.c8
-rw-r--r--sys/netinet6/ip6_forward.c8
-rw-r--r--sys/netinet6/ip6_output.c22
-rw-r--r--sys/sys/mbuf.h16
5 files changed, 28 insertions, 28 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 23eb450..8d371eb 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -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 | \
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 80d4075..eab6fdb 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -4478,7 +4478,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
#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
@@ -11072,7 +11072,7 @@ sctp_send_shutdown_complete2(struct mbuf *m, struct sctphdr *sh,
#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
@@ -12179,7 +12179,7 @@ sctp_send_abort(struct mbuf *m, int iphlen, struct sctphdr *sh, uint32_t vtag,
#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
@@ -12443,7 +12443,7 @@ sctp_send_operr_to(struct mbuf *m, int iphlen, struct mbuf *scm, uint32_t vtag,
#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
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index 93c7bf2..3321a95 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -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;
}
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index fddb45b..df4e1b0 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -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;
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 679f86e..38adfaf 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -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 */
@@ -427,7 +427,7 @@ static __inline int
m_gettype(int size)
{
int type;
-
+
switch (size) {
case MSIZE:
type = EXT_MBUF;
@@ -457,7 +457,7 @@ static __inline uma_zone_t
m_getzone(int size)
{
uma_zone_t zone;
-
+
switch (size) {
case MCLBYTES:
zone = zone_clust;
@@ -639,7 +639,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);
}
@@ -699,7 +699,7 @@ m_cljset(struct mbuf *m, void *cl, int type)
{
uma_zone_t zone;
int size;
-
+
switch (type) {
case EXT_CLUSTER:
size = MCLBYTES;
@@ -751,7 +751,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)
{
@@ -1119,7 +1119,7 @@ m_tag_find(struct mbuf *m, int type, struct m_tag *start)
#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 */
OpenPOWER on IntegriCloud