Get rid of SCTP specific code to avoid CRC32C computations on loopback.
Just just offloading. MFC after: 3 days
This commit is contained in:
parent
243d601f05
commit
8d9638ab33
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236087
@ -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;
|
||||
|
@ -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",
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user