The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9affbb0f5271b199de8a2203fd7d8b1fbedca2af

commit 9affbb0f5271b199de8a2203fd7d8b1fbedca2af
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2021-09-14 20:46:15 +0000
Commit:     John Baldwin <j...@freebsd.org>
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
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to