aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-09-14 20:46:15 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-09-14 20:46:15 +0000
commit9affbb0f5271b199de8a2203fd7d8b1fbedca2af (patch)
tree0615b4e64bdddf9a96f7556ae5785c3c22fcd641
parent5dbf8c1588da167c17c45bdf78de51fcb4929504 (diff)
downloadsrc-9affbb0f5271b199de8a2203fd7d8b1fbedca2af.tar.gz
src-9affbb0f5271b199de8a2203fd7d8b1fbedca2af.zip
cxgbe tom: Enter network epoch in t4_aiotx_task().
While here, don't restore the old vnet until after sorele(). Sponsored by: Chelsio Communications
-rw-r--r--sys/dev/cxgbe/tom/t4_cpl_io.c5
1 files changed, 4 insertions, 1 deletions
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