diff options
author | tuexen <tuexen@FreeBSD.org> | 2012-05-26 09:16:33 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2012-05-26 09:16:33 +0000 |
commit | 520d26f3510f067751884cbed2119886a87524f2 (patch) | |
tree | 554e1e0abe24881cf9e9c67857dda17d3a772d9c | |
parent | 713e6f8d0c0acc47cc23d4c2731c1383d85daf33 (diff) | |
download | FreeBSD-src-520d26f3510f067751884cbed2119886a87524f2.zip FreeBSD-src-520d26f3510f067751884cbed2119886a87524f2.tar.gz |
Get rid of SCTP specific code to avoid CRC32C computations on loopback.
Just just offloading.
MFC after: 3 days
-rw-r--r-- | sys/netinet/sctp_output.c | 20 | ||||
-rw-r--r-- | sys/netinet/sctp_sysctl.c | 11 | ||||
-rw-r--r-- | sys/netinet/sctp_sysctl.h | 3 | ||||
-rw-r--r-- | sys/netinet6/sctp6_usrreq.c | 5 |
4 files changed, 4 insertions, 35 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index ac60777..80d4075 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -4116,14 +4116,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if (V_udp_cksum) { SCTP_ENABLE_UDP_CSUM(o_pak); @@ -4474,14 +4468,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); - SCTP_STAT_INCR(sctps_sendswcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr)); + SCTP_STAT_INCR(sctps_sendswcrc); #endif if ((udp->uh_sum = in6_cksum(o_pak, IPPROTO_UDP, sizeof(struct ip6_hdr), packet_length - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; diff --git a/sys/netinet/sctp_sysctl.c b/sys/netinet/sctp_sysctl.c index 6c2f0a0..6684acc 100644 --- a/sys/netinet/sctp_sysctl.c +++ b/sys/netinet/sctp_sysctl.c @@ -55,9 +55,6 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_multiple_asconfs) = SCTPCTL_MULTIPLEASCONFS_DEFAULT; SCTP_BASE_SYSCTL(sctp_ecn_enable) = SCTPCTL_ECN_ENABLE_DEFAULT; SCTP_BASE_SYSCTL(sctp_strict_sacks) = SCTPCTL_STRICT_SACKS_DEFAULT; -#if !defined(SCTP_WITH_NO_CSUM) - SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT; -#endif SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT; SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT; SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT; @@ -604,9 +601,6 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_auto_asconf), SCTPCTL_AUTOASCONF_MIN, SCTPCTL_AUTOASCONF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_ecn_enable), SCTPCTL_ECN_ENABLE_MIN, SCTPCTL_ECN_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_strict_sacks), SCTPCTL_STRICT_SACKS_MIN, SCTPCTL_STRICT_SACKS_MAX); -#if !defined(SCTP_WITH_NO_CSUM) - RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX); -#endif RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX); @@ -870,11 +864,6 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, strict_sacks, CTLTYPE_UINT | CTLFLAG_ &SCTP_BASE_SYSCTL(sctp_strict_sacks), 0, sysctl_sctp_check, "IU", SCTPCTL_STRICT_SACKS_DESC); -#if !defined(SCTP_WITH_NO_CSUM) -SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, loopback_nocsum, CTLTYPE_UINT | CTLFLAG_RW, - &SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sysctl_sctp_check, "IU", - SCTPCTL_LOOPBACK_NOCSUM_DESC); -#endif SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, peer_chkoh, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sysctl_sctp_check, "IU", diff --git a/sys/netinet/sctp_sysctl.h b/sys/netinet/sctp_sysctl.h index 3850fbe..4f5022b 100644 --- a/sys/netinet/sctp_sysctl.h +++ b/sys/netinet/sctp_sysctl.h @@ -47,9 +47,6 @@ struct sctp_sysctl { uint32_t sctp_ecn_enable; uint32_t sctp_fr_max_burst_default; uint32_t sctp_strict_sacks; -#if !defined(SCTP_WITH_NO_CSUM) - uint32_t sctp_no_csum_on_loopback; -#endif uint32_t sctp_peer_chunk_oh; uint32_t sctp_max_burst_default; uint32_t sctp_max_chunks_on_queue; diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index dc68b83..ef792ee 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -150,11 +150,6 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto) goto sctp_skip_csum; } check = sh->checksum; /* save incoming checksum */ - if ((check == 0) && (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback)) && - (IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &ip6->ip6_dst))) { - SCTP_STAT_INCR(sctps_recvnocrc); - goto sctp_skip_csum; - } sh->checksum = 0; /* prepare for calc */ calc_check = sctp_calculate_cksum(m, iphlen); SCTP_STAT_INCR(sctps_recvswcrc); |