From nobody Mon Oct 21 18:39:04 2024 X-Original-To: dev-commits-src-branches@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 4XXPGc5yl2z5ZcYC; Mon, 21 Oct 2024 18:39:04 +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 4XXPGc5QLNz4FLR; Mon, 21 Oct 2024 18:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729535944; 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=XfcBgsAn58luW6hzIaWGsbqvFD7N7UgdUp2409cxEE4=; b=okQaAgB9TeXGQBCimpfPZwGdnobHIPJjyYbMOqopgll7yZ1mOnC5wwqhQfn+cZH5WIW1F1 etPNKBrWg2E4da7KMErjtOdilPQVj7nX4D+v8upV9FQl0wEx+0piflreJxpmbZIVMjw0KE OjxFPQtgRnmcMjfQVm1qeHWY9Ma90oeQ4E8qF0j3ohxOEeRC+naYp9s7RJ8IzLMAGUqIUe Rgq2Mh+mLxhv0swSjENxSlAeW2nG8r0IJ7uBPQOtP9UAIMzRe8Ew4KC/W+w9JAh4MWzRZJ GrHqDiyylNtPFhnQHiCCgUSmCK+f3f5UVsbMhlVPOk0xPp/3CoGdH5LFb2zyzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729535944; 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=XfcBgsAn58luW6hzIaWGsbqvFD7N7UgdUp2409cxEE4=; b=jsHxZqHH0JT+bnkNAC+GB1t37p1K5vjKSJMFkwx5CjNeSb+mYVAb8CHFuEkzjmPf9GZopS C66mecxQDTEzbuOl4aSfCVFDUzvHHqqk3NJSHRRtOfWr5i0gglMLE2chw7mm4hU1c+smzf +qAbNE2vMIhVP83mGulUN90cKWZ4Oj4j46r8ejXPt/aWBZUhFDMssBnhrfCWZYJtIOG7ar bgLzsEictSZHYn3GeM8KkrY17X2JO08IDhQlNmzc9u3HD7V/BShfG/B0Gicf1tZImqmFWI WPQCtTeZ8qVi7pX5oaDAHmyDmkaDCRpo1EJLIolQz8xSocC5HZKz1l25uTT5Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729535944; a=rsa-sha256; cv=none; b=ZwF5qgGI2X0dL/n0dH3tUCcMkmnR2u3u37uEzY/XgPD3zSUY+0I6RuviGXHqqQ+1SMeDD5 KOxM8dSLUkJSPxVn6/CP4xK3ve4bsucCSS7bzOnObAEt14YzH5zk2tShDKn7wBZEDoMXQ8 QjrDy6Q3RQGY3FmDaqeQjlgZJXCruIDb4ScD3TaFvRaCG0fPyGO8hx+FhmRirUzBs/oBcY lxiYDVwiHoSqfXGBbY/Jc+4tXSGqn4wmZecuq1K+vL4YgeGhjaIHqo9du1lG+6UST0eP8f F35ExqLqZpsP6O9xO6sjG2dvbx59Q2flWLEPD6uqHDDSLomQ/ljsWzhEVtJdVw== 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 4XXPGc42vLzhYH; Mon, 21 Oct 2024 18:39:04 +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 49LId4dW035832; Mon, 21 Oct 2024 18:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49LId4KG035829; Mon, 21 Oct 2024 18:39:04 GMT (envelope-from git) Date: Mon, 21 Oct 2024 18:39:04 GMT Message-Id: <202410211839.49LId4KG035829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: c18966b3dce0 - stable/14 - cxgbe/t4_tom: Detach the toep from the tcpcb when entering TIME_WAIT. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c18966b3dce0e5110c79b23d290d453c22b49252 Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c18966b3dce0e5110c79b23d290d453c22b49252 commit c18966b3dce0e5110c79b23d290d453c22b49252 Author: Navdeep Parhar AuthorDate: 2024-07-17 05:23:33 +0000 Commit: Navdeep Parhar CommitDate: 2024-10-21 16:46:29 +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 Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D45990 (cherry picked from commit bbc326241d91ab2cee2ec2c5c0aa8a906480132f) --- 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 0d42c89dcf93..0a40bbda3f3f 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);