diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index b3895aee9249..cb2e3f272774 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1478,6 +1478,7 @@ ktls_set_tx_mode(struct socket *so, int mode) /* Don't allow enabling ifnet ktls multiple times */ if (tp->t_nic_ktls_xmit) return (EALREADY); + /* * Don't enable ifnet ktls if we disabled it due to an * excessive retransmission rate @@ -1850,7 +1851,6 @@ ktls_destroy(struct ktls_session *tls) * know that we don't hold the inp rlock, and * can safely take the wlock */ - if (curthread->td_rw_rlocks == 0) { INP_WLOCK(inp); } else { @@ -3335,6 +3335,7 @@ ktls_disable_ifnet(void *arg) SOCK_UNLOCK(so); return; } + /* * note that t_nic_ktls_xmit_dis is never cleared; disabling * ifnet can only be done once per connection, so we never want diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 909d5347bc47..549ce3ee869d 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -201,6 +201,8 @@ struct ktls_session { /* Only used for TLS 1.0. */ uint64_t next_seqno; STAILQ_HEAD(, mbuf) pending_records; + + /* Used to destroy any kTLS session */ struct task destroy_task; } __aligned(CACHE_LINE_SIZE);