From nobody Fri Jul 19 16:18:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WQZbc1LC8z5Rv2t; Fri, 19 Jul 2024 16:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WQZbc0qsmz53yG; Fri, 19 Jul 2024 16:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721405900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lNUpqqv/gl+/IkwveGdnV+mH/dgNjdB+KgxPgO0RCtQ=; b=ZRdZ2oOChkDpLyNgWnYG4oY1uY9soMFUmdK6VB8mIyPQ33d66XeXIOD9cuOQXKlA5EoltH V6nYjasM1yTAeVx+V5bKmY5+z7bxdmbuSjDyh+LcgY9N14vvp6WcrkPbw+TLxqoPuGNik5 d4DASSHjZj9/kjPJK302qqvnyd17jB7i9udpinYYCrm50jfdHRKZ/Rr6R/gV2zOa+vA4Qj Y1pTv9snewKEXR01Sol3Iigmtm/g8z8v5gpu+iKbW7EOjtvw30fCA2jXCT224T98kEEvAw Xz/a/INXFWfNo0k2/AtTCkjlychATGM8/8hOptFxfvyI23EhxwnB3gXCihZ1RQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721405900; a=rsa-sha256; cv=none; b=rUaGVVxIDiGLA2i04p4DYNZw8gGQfIfL0QrY8FVkXoXRTrUXSiN0pMr/TXyc8GoVrI9ggF C60eLoBFh26wsxsGHes7mA+SpGnTWHmlHvY3+2X6cbHdxMJIAEHNOqBwrqmCO3HnaFPXuU nj1x0BcVNak0yIDeThXaDzwNi2c6XytrXAm/nkPDRXtYCn3mFnIfzhykKxzTQEVAhB/PFs b+MNuclZDWOTS2bMosPpPSEKQg3NlvK3ftyovcMCmNqcexNVVdfAYralq1EvbZ6LqEcATk vmm6fsUm0qSRVPrqSLXwGM8Z4EG4DYlG/86Vogg145cnlqBPjWarlpYjFt73Vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721405900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lNUpqqv/gl+/IkwveGdnV+mH/dgNjdB+KgxPgO0RCtQ=; b=TrWUqa9k2Y8LEPFC4u6Yf8uYcz7SC1YnPd8LXtEcTVKRVAJTAqsGC0L3/Ga4+g80FkQxZ3 0PoI4IweX3tCkH0GLdFKQVQuLcxC+E1w5Syz/2XEBDW2U/IqINhHChJqrwMjs8XXlrqWQx 8K8xsMbBNGzUWb29+8UoU4j2CwzHLw7fOPLV64d8xO6lH5QoTSXGdBL0A1SDCFs3tkXqPA Ihxs4MWICdJ6zBX4EWETkrFYgDXM6FvqW7Mch8+RcTiA6Xj1KlWLyQ1rLEGKIvvxm/m/i5 quS38UsUozL6ZbDc7LFnGZVKUrD3I1LEWQAR4QNB6ixzFRt4rokwsaKBs+bA2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WQZbc0QxRzfw4; Fri, 19 Jul 2024 16:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46JGIJp8043395; Fri, 19 Jul 2024 16:18:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46JGIJFK043392; Fri, 19 Jul 2024 16:18:19 GMT (envelope-from git) Date: Fri, 19 Jul 2024 16:18:19 GMT Message-Id: <202407191618.46JGIJFK043392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: bbc326241d91 - main - cxgbe/t4_tom: Detach the toep from the tcpcb when entering TIME_WAIT. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbc326241d91ab2cee2ec2c5c0aa8a906480132f Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=bbc326241d91ab2cee2ec2c5c0aa8a906480132f commit bbc326241d91ab2cee2ec2c5c0aa8a906480132f Author: Navdeep Parhar AuthorDate: 2024-07-17 05:23:33 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-19 16:12:31 +0000 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 --- sys/dev/cxgbe/tom/t4_cpl_io.c | 2 ++ sys/dev/cxgbe/tom/t4_tom.c | 2 +- sys/dev/cxgbe/tom/t4_tom.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 842e72bf8b2b..cb229d327386 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -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 */ diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index 3fe34c7c01a3..10ee78681365 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -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) diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 805d8bc0d644..fb74642d61f7 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -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);