From owner-dev-commits-src-main@freebsd.org Sat Jan 9 22:56:41 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80F554E5C2E; Sat, 9 Jan 2021 22:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DCwMF3J99z4ccw; Sat, 9 Jan 2021 22:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 642FD1DF21; Sat, 9 Jan 2021 22:56:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 109MufK2060089; Sat, 9 Jan 2021 22:56:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 109Muf3s060088; Sat, 9 Jan 2021 22:56:41 GMT (envelope-from git) Date: Sat, 9 Jan 2021 22:56:41 GMT Message-Id: <202101092256.109Muf3s060088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vincenzo Maffione Subject: git: 9ac59d42c0b4 - main - netmap: vtnet: stop krings during interface reset MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vmaffione X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2021 22:56:41 -0000 The branch main has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a commit 9ac59d42c0b4b6cd9c36a5dace7f49753c2e175a Author: Vincenzo Maffione AuthorDate: 2021-01-09 22:34:10 +0000 Commit: Vincenzo Maffione 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); }