Seperate SCTP checksum offloading for IPv4 and IPv6.
While there: remove some trainling whitespaces. MFC after: 3 days X-MFC with: 236170
This commit is contained in:
parent
01c64e45fc
commit
a6cff10f2a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236332
@ -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 | \
|
||||
|
@ -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
|
||||
|
@ -587,7 +587,7 @@ ip6_forward(struct mbuf *m, int srcrt)
|
||||
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 @@ ip6_forward(struct mbuf *m, int srcrt)
|
||||
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;
|
||||
}
|
||||
|
@ -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 @@ skip_ipsec2:;
|
||||
|
||||
/*
|
||||
* The outgoing interface must be in the zone of source and
|
||||
* destination addresses.
|
||||
* destination addresses.
|
||||
*/
|
||||
origifp = ifp;
|
||||
|
||||
@ -693,7 +693,7 @@ skip_ipsec2:;
|
||||
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 @@ skip_ipsec2:;
|
||||
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 @@ skip_ipsec2:;
|
||||
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 @@ skip_ipsec2:;
|
||||
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 @@ skip_ipsec2:;
|
||||
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;
|
||||
|
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user