Date: Sat, 7 Apr 2018 20:22:04 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332227 - in stable/11: sys/conf sys/netinet sys/netinet6 usr.bin/systat Message-ID: <201804072022.w37KM4Ah087948@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Sat Apr 7 20:22:04 2018 New Revision: 332227 URL: https://svnweb.freebsd.org/changeset/base/332227 Log: MFC r326672: Retire SCTP_WITH_NO_CSUM option. This option was used in the early days to allow performance measurements extrapolating the use of SCTP checksum offloading. Since this feature is now available, get rid of this option. This also un-breaks the LINT kernel. Thanks to markj@ for making me aware of the problem. Modified: stable/11/sys/conf/NOTES stable/11/sys/conf/options stable/11/sys/netinet/sctp_crc32.c stable/11/sys/netinet/sctp_crc32.h stable/11/sys/netinet/sctp_input.c stable/11/sys/netinet/sctp_input.h stable/11/sys/netinet/sctp_output.c stable/11/sys/netinet/sctp_sysctl.c stable/11/sys/netinet/sctp_uio.h stable/11/sys/netinet6/sctp6_usrreq.c stable/11/usr.bin/systat/sctp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/conf/NOTES Sat Apr 7 20:22:04 2018 (r332227) @@ -664,21 +664,6 @@ options SCTP # faster.. if you are not debugging don't use. options SCTP_DEBUG # -# This option turns off the CRC32c checksum. Basically, -# you will not be able to talk to anyone else who -# has not done this. Its more for experimentation to -# see how much CPU the CRC32c really takes. Most new -# cards for TCP support checksum offload.. so this -# option gives you a "view" into what SCTP would be -# like with such an offload (which only exists in -# high in iSCSI boards so far). With the new -# splitting 8's algorithm its not as bad as it used -# to be.. but it does speed things up try only -# for in a captured lab environment :-) -options SCTP_WITH_NO_CSUM -# - -# # All that options after that turn on specific types of # logging. You can monitor CWND growth, flight size # and all sorts of things. Go look at the code and Modified: stable/11/sys/conf/options ============================================================================== --- stable/11/sys/conf/options Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/conf/options Sat Apr 7 20:22:04 2018 (r332227) @@ -462,7 +462,6 @@ FLOWTABLE_HASH_ALL opt_route.h # SCTP opt_sctp.h SCTP_DEBUG opt_sctp.h # Enable debug printfs -SCTP_WITH_NO_CSUM opt_sctp.h # Use this at your peril SCTP_LOCK_LOGGING opt_sctp.h # Log to KTR lock activity SCTP_MBUF_LOGGING opt_sctp.h # Log to KTR general mbuf aloc/free SCTP_MBCNT_LOGGING opt_sctp.h # Log to KTR mbcnt activity Modified: stable/11/sys/netinet/sctp_crc32.c ============================================================================== --- stable/11/sys/netinet/sctp_crc32.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_crc32.c Sat Apr 7 20:22:04 2018 (r332227) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include <netinet/sctp_pcb.h> -#if !defined(SCTP_WITH_NO_CSUM) static uint32_t sctp_finalize_crc32c(uint32_t crc32c) @@ -113,17 +112,11 @@ sctp_calculate_cksum(struct mbuf *m, uint32_t offset) base = sctp_finalize_crc32c(base); return (base); } -#endif /* !defined(SCTP_WITH_NO_CSUM) */ void sctp_delayed_cksum(struct mbuf *m, uint32_t offset) { -#if defined(SCTP_WITH_NO_CSUM) -#ifdef INVARIANTS - panic("sctp_delayed_cksum() called when using no SCTP CRC."); -#endif -#else uint32_t checksum; checksum = sctp_calculate_cksum(m, offset); @@ -142,5 +135,4 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t offset) return; } *(uint32_t *)(m->m_data + offset) = checksum; -#endif } Modified: stable/11/sys/netinet/sctp_crc32.h ============================================================================== --- stable/11/sys/netinet/sctp_crc32.h Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_crc32.h Sat Apr 7 20:22:04 2018 (r332227) @@ -37,9 +37,7 @@ __FBSDID("$FreeBSD$"); #define _NETINET_SCTP_CRC32_H_ #if defined(_KERNEL) -#if !defined(SCTP_WITH_NO_CSUM) uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t); -#endif void sctp_delayed_cksum(struct mbuf *, uint32_t offset); #endif /* _KERNEL */ #endif /* __crc32c_h__ */ Modified: stable/11/sys/netinet/sctp_input.c ============================================================================== --- stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_input.c Sat Apr 7 20:22:04 2018 (r332227) @@ -5496,9 +5496,7 @@ void sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, -#if !defined(SCTP_WITH_NO_CSUM) uint8_t compute_crc, -#endif uint8_t ecn_bits, uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum, uint32_t vrf_id, uint16_t port) @@ -5518,7 +5516,6 @@ sctp_common_input_processing(struct mbuf **mm, int iph sctp_audit_log(0xE0, 1); sctp_auditing(0, inp, stcb, net); #endif -#if !defined(SCTP_WITH_NO_CSUM) if (compute_crc != 0) { uint32_t check, calc_check; @@ -5563,7 +5560,6 @@ sctp_common_input_processing(struct mbuf **mm, int iph goto out; } } -#endif /* Destination port of 0 is illegal, based on RFC4960. */ if (sh->dest_port == 0) { SCTP_STAT_INCR(sctps_hdrops); @@ -5881,9 +5877,7 @@ sctp_input_with_port(struct mbuf *i_pak, int off, uint struct sctphdr *sh; struct sctp_chunkhdr *ch; int length, offset; -#if !defined(SCTP_WITH_NO_CSUM) uint8_t compute_crc; -#endif uint32_t mflowid; uint8_t mflowtype; uint16_t fibnum; @@ -5953,9 +5947,6 @@ sctp_input_with_port(struct mbuf *i_pak, int off, uint goto out; } ecn_bits = ip->ip_tos; -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_recvnocrc); -#else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); compute_crc = 0; @@ -5963,14 +5954,11 @@ sctp_input_with_port(struct mbuf *i_pak, int off, uint SCTP_STAT_INCR(sctps_recvswcrc); compute_crc = 1; } -#endif sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, sh, ch, -#if !defined(SCTP_WITH_NO_CSUM) compute_crc, -#endif ecn_bits, mflowtype, mflowid, fibnum, vrf_id, port); Modified: stable/11/sys/netinet/sctp_input.h ============================================================================== --- stable/11/sys/netinet/sctp_input.h Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_input.h Sat Apr 7 20:22:04 2018 (r332227) @@ -41,9 +41,7 @@ void sctp_common_input_processing(struct mbuf **, int, int, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, -#if !defined(SCTP_WITH_NO_CSUM) uint8_t, -#endif uint8_t, uint8_t, uint32_t, uint16_t, uint32_t, uint16_t); Modified: stable/11/sys/netinet/sctp_output.c ============================================================================== --- stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_output.c Sat Apr 7 20:22:04 2018 (r332227) @@ -4224,23 +4224,15 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, } SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else 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); } } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else m->m_pkthdr.csum_flags = CSUM_SCTP; m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); -#endif } #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) @@ -4564,23 +4556,15 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, } SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else 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; } } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else m->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); -#endif } /* send it out. table id is taken from stcb */ #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -11225,23 +11209,15 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad } ip->ip_len = htons(len); if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip) + sizeof(struct udphdr)); SCTP_STAT_INCR(sctps_sendswcrc); -#endif if (V_udp_cksum) { SCTP_ENABLE_UDP_CSUM(o_pak); } } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else mout->m_pkthdr.csum_flags = CSUM_SCTP; mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); -#endif } #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { @@ -11255,23 +11231,15 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad case AF_INET6: ip6->ip6_plen = (uint16_t)(len - sizeof(struct ip6_hdr)); if (port) { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else shout->checksum = sctp_calculate_cksum(mout, 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), len - sizeof(struct ip6_hdr))) == 0) { udp->uh_sum = 0xffff; } } else { -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_sendnocrc); -#else mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6; mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum); SCTP_STAT_INCR(sctps_sendhwcrc); -#endif } #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { Modified: stable/11/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/11/sys/netinet/sctp_sysctl.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_sysctl.c Sat Apr 7 20:22:04 2018 (r332227) @@ -713,7 +713,6 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ARGS) sb.sctps_recvauthfailed += sarry->sctps_recvauthfailed; sb.sctps_recvexpress += sarry->sctps_recvexpress; sb.sctps_recvexpressm += sarry->sctps_recvexpressm; - sb.sctps_recvnocrc += sarry->sctps_recvnocrc; sb.sctps_recvswcrc += sarry->sctps_recvswcrc; sb.sctps_recvhwcrc += sarry->sctps_recvhwcrc; sb.sctps_sendpackets += sarry->sctps_sendpackets; @@ -726,7 +725,6 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ARGS) sb.sctps_sendecne += sarry->sctps_sendecne; sb.sctps_sendauth += sarry->sctps_sendauth; sb.sctps_senderrors += sarry->sctps_senderrors; - sb.sctps_sendnocrc += sarry->sctps_sendnocrc; sb.sctps_sendswcrc += sarry->sctps_sendswcrc; sb.sctps_sendhwcrc += sarry->sctps_sendhwcrc; sb.sctps_pdrpfmbox += sarry->sctps_pdrpfmbox; Modified: stable/11/sys/netinet/sctp_uio.h ============================================================================== --- stable/11/sys/netinet/sctp_uio.h Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet/sctp_uio.h Sat Apr 7 20:22:04 2018 (r332227) @@ -984,7 +984,7 @@ struct sctpstat { uint32_t sctps_recvexpress; /* total fast path receives all one * chunk */ uint32_t sctps_recvexpressm; /* total fast path multi-part data */ - uint32_t sctps_recvnocrc; + uint32_t sctps_recv_spare; /* formerly sctps_recvnocrc */ uint32_t sctps_recvswcrc; uint32_t sctps_recvhwcrc; @@ -1004,7 +1004,7 @@ struct sctpstat { uint32_t sctps_sendecne;/* total output ECNE chunks */ uint32_t sctps_sendauth;/* total output AUTH chunks FIXME */ uint32_t sctps_senderrors; /* ip_output error counter */ - uint32_t sctps_sendnocrc; + uint32_t sctps_send_spare; /* formerly sctps_sendnocrc */ uint32_t sctps_sendswcrc; uint32_t sctps_sendhwcrc; /* PCKDROPREP statistics: */ Modified: stable/11/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/sys/netinet6/sctp6_usrreq.c Sat Apr 7 20:22:04 2018 (r332227) @@ -69,9 +69,7 @@ sctp6_input_with_port(struct mbuf **i_pak, int *offp, struct sctphdr *sh; struct sctp_chunkhdr *ch; int length, offset; -#if !defined(SCTP_WITH_NO_CSUM) uint8_t compute_crc; -#endif uint32_t mflowid; uint8_t mflowtype; uint16_t fibnum; @@ -142,9 +140,6 @@ sctp6_input_with_port(struct mbuf **i_pak, int *offp, goto out; } ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); -#if defined(SCTP_WITH_NO_CSUM) - SCTP_STAT_INCR(sctps_recvnocrc); -#else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); compute_crc = 0; @@ -152,14 +147,11 @@ sctp6_input_with_port(struct mbuf **i_pak, int *offp, SCTP_STAT_INCR(sctps_recvswcrc); compute_crc = 1; } -#endif sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, sh, ch, -#if !defined(SCTP_WITH_NO_CSUM) compute_crc, -#endif ecn_bits, mflowtype, mflowid, fibnum, vrf_id, port); Modified: stable/11/usr.bin/systat/sctp.c ============================================================================== --- stable/11/usr.bin/systat/sctp.c Sat Apr 7 20:15:12 2018 (r332226) +++ stable/11/usr.bin/systat/sctp.c Sat Apr 7 20:22:04 2018 (r332227) @@ -180,7 +180,6 @@ domode(struct sctpstat *ret) DO(sctps_recvauthfailed); DO(sctps_recvexpress); DO(sctps_recvexpressm); - DO(sctps_recvnocrc); DO(sctps_recvswcrc); DO(sctps_recvhwcrc); @@ -194,7 +193,6 @@ domode(struct sctpstat *ret) DO(sctps_sendecne); DO(sctps_sendauth); DO(sctps_senderrors); - DO(sctps_sendnocrc); DO(sctps_sendswcrc); DO(sctps_sendhwcrc);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804072022.w37KM4Ah087948>