git: 9affbb0f5271 - main - cxgbe tom: Enter network epoch in t4_aiotx_task().
John Baldwin
jhb at FreeBSD.org
Tue Sep 14 20:46:44 UTC 2021
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=9affbb0f5271b199de8a2203fd7d8b1fbedca2af
commit 9affbb0f5271b199de8a2203fd7d8b1fbedca2af
Author: John Baldwin <jhb at FreeBSD.org>
AuthorDate: 2021-09-14 20:46:15 +0000
Commit: John Baldwin <jhb at 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
More information about the dev-commits-src-main
mailing list