aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/netmap
diff options
context:
space:
mode:
authorVincenzo Maffione <vmaffione@FreeBSD.org>2021-01-09 22:34:10 +0000
committerVincenzo Maffione <vmaffione@FreeBSD.org>2021-01-09 22:34:52 +0000
commit9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a (patch)
tree1f5ed706fcb52a797ff0720f9cc1c4296da85d52 /sys/dev/netmap
parent7ba6ecf216fb15e8b147db268b91d9b82c5a0682 (diff)
Diffstat (limited to 'sys/dev/netmap')
-rw-r--r--sys/dev/netmap/if_vtnet_netmap.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/netmap/if_vtnet_netmap.h b/sys/dev/netmap/if_vtnet_netmap.h
index 0f686ed60788..a44cc13baae2 100644
--- a/sys/dev/netmap/if_vtnet_netmap.h
+++ b/sys/dev/netmap/if_vtnet_netmap.h
@@ -40,6 +40,9 @@ vtnet_netmap_reg(struct netmap_adapter *na, int state)
struct ifnet *ifp = na->ifp;
struct vtnet_softc *sc = ifp->if_softc;
+ /* Stop all txsync/rxsync and disable them. */
+ netmap_disable_all_rings(ifp);
+
/*
* Trigger a device reinit, asking vtnet_init_locked() to
* also enter or exit netmap mode.
@@ -50,7 +53,10 @@ vtnet_netmap_reg(struct netmap_adapter *na, int state)
: VTNET_INIT_NETMAP_EXIT);
VTNET_CORE_UNLOCK(sc);
- return 0;
+ /* Enable txsync/rxsync again. */
+ netmap_enable_all_rings(ifp);
+
+ return (0);
}