git: 9ac59d42c0b4 - main - netmap: vtnet: stop krings during interface reset
Vincenzo Maffione
vmaffione at FreeBSD.org
Sat Jan 9 22:56:41 UTC 2021
The branch main has been updated by vmaffione:
URL: https://cgit.FreeBSD.org/src/commit/?id=9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a
commit 9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a
Author: Vincenzo Maffione <vmaffione at FreeBSD.org>
AuthorDate: 2021-01-09 22:34:10 +0000
Commit: Vincenzo Maffione <vmaffione at FreeBSD.org>
CommitDate: 2021-01-09 22:34:52 +0000
netmap: vtnet: stop krings during interface reset
Similarly to what done for iflib in 1d238b07d5d4d9660ae0e,
this patch prevents access to the krings during the interface
reset triggered by netmap_register().
MFC after: 1 week
---
sys/dev/netmap/if_vtnet_netmap.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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);
}
More information about the dev-commits-src-all
mailing list