From owner-dev-commits-src-branches@freebsd.org Sun Jan 17 13:40:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 8013E4E9DAE; Sun, 17 Jan 2021 13:40:39 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DJbdz3FDKz3CKt; Sun, 17 Jan 2021 13:40:39 +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 625A922700; Sun, 17 Jan 2021 13:40:39 +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 10HDed2E008728; Sun, 17 Jan 2021 13:40:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10HDed26008727; Sun, 17 Jan 2021 13:40:39 GMT (envelope-from git) Date: Sun, 17 Jan 2021 13:40:39 GMT Message-Id: <202101171340.10HDed26008727@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vincenzo Maffione Subject: git: 45b2c3bec4f2 - stable/12 - re: netmap: enable/disable krings on interface reinit 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/stable/12 X-Git-Reftype: branch X-Git-Commit: 45b2c3bec4f2e8a41fb47d3b0dd7983b0ba81d10 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2021 13:40:39 -0000 The branch stable/12 has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=45b2c3bec4f2e8a41fb47d3b0dd7983b0ba81d10 commit 45b2c3bec4f2e8a41fb47d3b0dd7983b0ba81d10 Author: Vincenzo Maffione AuthorDate: 2021-01-10 15:09:05 +0000 Commit: Vincenzo Maffione CommitDate: 2021-01-17 13:40:31 +0000 re: netmap: enable/disable krings on interface reinit This prevents krings from being used during an interface reset, and notifies the active applications. See also 1d238b07d5d4d9660ae0. MFC after: 1 week (cherry picked from commit 54bbcca4f9790e012e0a0f1512d9c879a48d5293) --- sys/dev/re/if_re.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 3bb80a236f8d..d3080031f3b9 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -3359,6 +3359,10 @@ re_init_locked(struct rl_softc *sc) sc->rl_watchdog_timer = 0; callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); + +#ifdef DEV_NETMAP + netmap_enable_all_rings(ifp); +#endif /* DEV_NETMAP */ } /* @@ -3607,6 +3611,10 @@ re_stop(struct rl_softc *sc) callout_stop(&sc->rl_stat_callout); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); +#ifdef DEV_NETMAP + netmap_disable_all_rings(ifp); +#endif /* DEV_NETMAP */ + /* * Disable accepting frames to put RX MAC into idle state. * Otherwise it's possible to get frames while stop command