aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincenzo Maffione <vmaffione@FreeBSD.org>2021-01-09 20:54:11 +0000
committerVincenzo Maffione <vmaffione@FreeBSD.org>2021-01-09 21:01:46 +0000
commit1d238b07d5d4d9660ae0e08daede6da7e91c7853 (patch)
tree9e42bddceaf5aa8b3d809b3e192f37395b8c06de
parentfaaf43b2a750aabeaa7cec434625fe1f2094a001 (diff)
-rw-r--r--sys/dev/netmap/netmap.c2
-rw-r--r--sys/net/iflib.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c
index d2c0f8f1c5c4..aa3bb1843ba5 100644
--- a/sys/dev/netmap/netmap.c
+++ b/sys/dev/netmap/netmap.c
@@ -4236,7 +4236,7 @@ nm_set_native_flags(struct netmap_adapter *na)
struct ifnet *ifp = na->ifp;
/* We do the setup for intercepting packets only if we are the
- * first user of this adapapter. */
+ * first user of this adapter. */
if (na->active_fds > 0) {
return;
}
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index cc401a5db24d..1b86fd670ac4 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -809,6 +809,13 @@ iflib_netmap_register(struct netmap_adapter *na, int onoff)
if (!CTX_IS_VF(ctx))
IFDI_CRCSTRIP_SET(ctx, onoff, iflib_crcstrip);
+ /*
+ * Stop any pending txsync/rxsync and prevent new ones
+ * form starting. Processes blocked in poll() will get
+ * POLLERR.
+ */
+ netmap_disable_all_rings(ifp);
+
iflib_stop(ctx);
/*
@@ -828,6 +835,8 @@ iflib_netmap_register(struct netmap_adapter *na, int onoff)
if (status)
nm_clear_native_flags(na);
CTX_UNLOCK(ctx);
+ /* Re-enable txsync/rxsync. */
+ netmap_enable_all_rings(ifp);
return (status);
}