From a88cbec02742464f8559f5c633f75ede6cad189e Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 4 Nov 2024 15:41:10 +0000 Subject: vio_dump: Fix control queue dump If the device has just been reset (e.g. after ifconfig down), we cannot query the feature bits. Make sure we dump the control virtqueue even in this case. --- sys/dev/pv/if_vio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pv/if_vio.c b/sys/dev/pv/if_vio.c index 06ad4b8fddb..c1b28d0b983 100644 --- a/sys/dev/pv/if_vio.c +++ b/sys/dev/pv/if_vio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vio.c,v 1.57 2024/10/03 08:59:49 sf Exp $ */ +/* $OpenBSD: if_vio.c,v 1.58 2024/11/04 15:41:09 sf Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg. @@ -1054,7 +1054,6 @@ void vio_dump(struct vio_softc *sc) { struct ifnet *ifp = &sc->sc_ac.ac_if; - struct virtio_softc *vsc = sc->sc_virtio; int i; printf("%s status dump:\n", ifp->if_xname); @@ -1066,7 +1065,7 @@ vio_dump(struct vio_softc *sc) printf("%d: RX virtqueue:\n", i); virtio_vq_dump(sc->sc_q[i].viq_rxvq); } - if (virtio_has_feature(vsc, VIRTIO_NET_F_CTRL_VQ)) { + if (sc->sc_ctl_vq != NULL) { printf("CTL virtqueue:\n"); virtio_vq_dump(sc->sc_ctl_vq); printf("ctrl_inuse: %d\n", sc->sc_ctrl_inuse); -- cgit v1.2.3