Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2023 22:44:11 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 126767e314cc - stable/13 - if_vtnet: improve dumping a kernel
Message-ID:  <202302012244.311MiBB3002078@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=126767e314ccdc77c82b6f29aeda3b715b31683a

commit 126767e314ccdc77c82b6f29aeda3b715b31683a
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2022-04-18 22:40:31 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2023-02-01 22:43:44 +0000

    if_vtnet: improve dumping a kernel
    
    Disable software LRO during kernel dumping, because having it enabled
    requires to be in a network epoch, which might or might not be the
    case depending on the code path resulting in the panic.
    
    Reviewed by:            markj
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D34787
    
    (cherry picked from commit 53236f905dbf4f3d58b1d5eff5c9b14f100d0c5d)
---
 sys/dev/virtio/network/if_vtnet.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 2b25fbfb6b93..79011a2abfb8 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -4388,8 +4388,27 @@ vtnet_debugnet_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize)
 }
 
 static void
-vtnet_debugnet_event(struct ifnet *ifp __unused, enum debugnet_ev event __unused)
+vtnet_debugnet_event(struct ifnet *ifp, enum debugnet_ev event)
 {
+	struct vtnet_softc *sc;
+	static bool sw_lro_enabled = false;
+
+	/*
+	 * Disable software LRO, since it would require entering the network
+	 * epoch when calling vtnet_txq_eof() in vtnet_debugnet_poll().
+	 */
+	sc = if_getsoftc(ifp);
+	switch (event) {
+	case DEBUGNET_START:
+		sw_lro_enabled = (sc->vtnet_flags & VTNET_FLAG_SW_LRO) != 0;
+		if (sw_lro_enabled)
+			sc->vtnet_flags &= ~VTNET_FLAG_SW_LRO;
+		break;
+	case DEBUGNET_END:
+		if (sw_lro_enabled)
+			sc->vtnet_flags |= VTNET_FLAG_SW_LRO;
+		break;
+	}
 }
 
 static int



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302012244.311MiBB3002078>