diff options
author | Andrew Gallatin <gallatin@FreeBSD.org> | 2021-08-05 23:17:35 +0000 |
---|---|---|
committer | Andrew Gallatin <gallatin@FreeBSD.org> | 2021-08-05 23:17:35 +0000 |
commit | 739de953ecc13afa930e2f55b7ee2a04e41e3519 (patch) | |
tree | c60af263d743f1c5e1c860a3e2194942faaa96ee | |
parent | 09066b98663d92f4d129bab25105805adf0abaf7 (diff) | |
download | src-739de953ecc13afa930e2f55b7ee2a04e41e3519.tar.gz src-739de953ecc13afa930e2f55b7ee2a04e41e3519.zip |
ktls: Move KERN_TLS ifdef to tcp_var.h
This allows us to remove stubs in ktls.h and allows us
to sort the function prototypes.
Reviewed by: jhb
Sponsored by: Netflix
-rw-r--r-- | sys/netinet/tcp_var.h | 6 | ||||
-rw-r--r-- | sys/sys/ktls.h | 14 |
2 files changed, 6 insertions, 14 deletions
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 8cfd2c5417c2..64e954cf4ad5 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1144,8 +1144,6 @@ static inline void tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, uint8_t is_tlp, int hw_tls) { - uint64_t rexmit_percent; - if (is_tlp) { tp->t_sndtlppack++; tp->t_sndtlpbyte += len; @@ -1156,11 +1154,13 @@ tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, else tp->t_sndbytes += len; +#ifdef KERN_TLS if (hw_tls && is_rxt) { - rexmit_percent = (1000ULL * tp->t_snd_rxt_bytes) / (10ULL * (tp->t_snd_rxt_bytes + tp->t_sndbytes)); + uint64_t rexmit_percent = (1000ULL * tp->t_snd_rxt_bytes) / (10ULL * (tp->t_snd_rxt_bytes + tp->t_sndbytes)); if (rexmit_percent > ktls_ifnet_max_rexmit_pct) ktls_disable_ifnet(tp); } +#endif } #endif /* _KERNEL */ diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index a4156eb10395..437e36f965ea 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -197,7 +197,10 @@ struct ktls_session { bool disable_ifnet_pending; } __aligned(CACHE_LINE_SIZE); +extern unsigned int ktls_ifnet_max_rexmit_pct; + void ktls_check_rx(struct sockbuf *sb); +void ktls_disable_ifnet(void *arg); int ktls_enable_rx(struct socket *so, struct tls_enable *en); int ktls_enable_tx(struct socket *so, struct tls_enable *en); void ktls_destroy(struct ktls_session *tls); @@ -233,16 +236,5 @@ ktls_free(struct ktls_session *tls) ktls_destroy(tls); } -#ifdef KERN_TLS -extern unsigned int ktls_ifnet_max_rexmit_pct; -void ktls_disable_ifnet(void *arg); -#else -#define ktls_ifnet_max_rexmit_pct 1 -static inline void -ktls_disable_ifnet(void *arg __unused) -{ -} -#endif - #endif /* !_KERNEL */ #endif /* !_SYS_KTLS_H_ */ |