Date: Sat, 9 Jan 2021 22:56:41 GMT From: Vincenzo Maffione <vmaffione@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 9ac59d42c0b4 - main - netmap: vtnet: stop krings during interface reset Message-ID: <202101092256.109Muf3s060088@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a commit 9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a Author: Vincenzo Maffione <vmaffione@FreeBSD.org> AuthorDate: 2021-01-09 22:34:10 +0000 Commit: Vincenzo Maffione <vmaffione@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101092256.109Muf3s060088>