cxgbe/t4_tom: Detach the toep from the tcpcb when entering TIME_WAIT.

The kernel used to call tod_pcb_detach when entering TIME_WAIT but that
seems to have changed, likely with the TIME_WAIT overhaul in the kernel
some time ago.  Catch up by having the driver perform the detach.

The hardware does not handle TIME_WAIT so it's important to detach and
let the kernel arm the 2MSL timer to deal with it.

Reported by:	Sony Arpita Das @ Chelsio
Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45990
This commit is contained in:
Navdeep Parhar 2024-07-16 22:23:33 -07:00
parent fb05f761ac
commit bbc326241d
3 changed files with 4 additions and 1 deletions

View file

@ -1393,6 +1393,7 @@ do_peer_close(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m)
case TCPS_FIN_WAIT_2:
restore_so_proto(so, inp->inp_vflag & INP_IPV6);
t4_pcb_detach(NULL, tp);
tcp_twstart(tp);
INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */
NET_EPOCH_EXIT(et);
@ -1454,6 +1455,7 @@ do_close_con_rpl(struct sge_iq *iq, const struct rss_header *rss,
switch (tp->t_state) {
case TCPS_CLOSING: /* see TCPS_FIN_WAIT_2 in do_peer_close too */
restore_so_proto(so, inp->inp_vflag & INP_IPV6);
t4_pcb_detach(NULL, tp);
tcp_twstart(tp);
release:
INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */

View file

@ -359,7 +359,7 @@ release_offload_resources(struct toepcb *toep)
* Also gets called when an offloaded active open fails and the TOM wants the
* kernel to take the TCP PCB back.
*/
static void
void
t4_pcb_detach(struct toedev *tod __unused, struct tcpcb *tp)
{
#if defined(KTR) || defined(INVARIANTS)

View file

@ -468,6 +468,7 @@ __be32 calc_options2(struct vi_info *, struct conn_params *);
uint64_t select_ntuple(struct vi_info *, struct l2t_entry *);
int negative_advice(int);
int add_tid_to_history(struct adapter *, u_int);
void t4_pcb_detach(struct toedev *, struct tcpcb *);
/* t4_connect.c */
void t4_init_connect_cpl_handlers(void);