From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:46:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7750670E5B; Tue, 14 Sep 2021 20:46:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Fkq5yCJz3J8c; Tue, 14 Sep 2021 20:46:43 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7CD4121627; Tue, 14 Sep 2021 20:46:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EKkhvD043924; Tue, 14 Sep 2021 20:46:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EKkhh4043923; Tue, 14 Sep 2021 20:46:43 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:46:43 GMT Message-Id: <202109142046.18EKkhh4043923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9affbb0f5271 - main - cxgbe tom: Enter network epoch in t4_aiotx_task(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9affbb0f5271b199de8a2203fd7d8b1fbedca2af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:46:44 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9affbb0f5271b199de8a2203fd7d8b1fbedca2af commit 9affbb0f5271b199de8a2203fd7d8b1fbedca2af Author: John Baldwin AuthorDate: 2021-09-14 20:46:15 +0000 Commit: John Baldwin CommitDate: 2021-09-14 20:46:15 +0000 cxgbe tom: Enter network epoch in t4_aiotx_task(). While here, don't restore the old vnet until after sorele(). Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_cpl_io.c | 5 ++++- 1 file 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 4c558df3f258..686819065863 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2353,9 +2353,11 @@ t4_aiotx_task(void *context, int pending) struct toepcb *toep = context; struct socket *so; struct kaiocb *job; + struct epoch_tracker et; so = toep->aiotx_so; CURVNET_SET(toep->vnet); + NET_EPOCH_ENTER(et); SOCKBUF_LOCK(&so->so_snd); while (!TAILQ_EMPTY(&toep->aiotx_jobq) && sowriteable(so)) { job = TAILQ_FIRST(&toep->aiotx_jobq); @@ -2367,11 +2369,12 @@ t4_aiotx_task(void *context, int pending) } toep->aiotx_so = NULL; SOCKBUF_UNLOCK(&so->so_snd); - CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); free_toepcb(toep); SOCK_LOCK(so); sorele(so); + CURVNET_RESTORE(); } static void