Index | Thread | Search

From:
Jan Klemkow <jan@openbsd.org>
Subject:
vio(4): fix jumbo frames with non-mrg-rxbuf mode
To:
tech@openbsd.org
Date:
Thu, 12 Nov 2026 01:52:28 +0100

Download raw body.

Thread
Hi,

if vio(4) uses jumbo frames and MRG_RXBUF was not negotiated, all mbufs
in vio_add_rx_mbuf() are unable to get loaded and will be immediately
destroyed, because m->m_pkthdr.len is greater than map->_dm_size.

As in all other drivers len and pkthdr.len should as big as the dma
mapping here.

ok?

bye,
jan

Index: dev/pv/if_vio.c
===================================================================
RCS file: /cvs/src/sys/dev/pv/if_vio.c,v
diff -u -p -r1.82 if_vio.c
--- dev/pv/if_vio.c	5 Nov 2026 15:47:44 -0000	1.82
+++ dev/pv/if_vio.c	12 Nov 2026 00:33:00 -0000
@@ -1449,7 +1449,7 @@ vio_add_rx_mbuf(struct vio_softc *sc, st
 	if (m == NULL)
 		return ENOBUFS;
 	vioq->viq_rxmbufs[i] = m;
-	m->m_len = m->m_pkthdr.len = m->m_ext.ext_size;
+	m->m_len = m->m_pkthdr.len = sc->sc_rx_mbuf_size;
 	m_adj(m, sc->sc_rx_mbuf_offset);
 	r = bus_dmamap_load_mbuf(sc->sc_virtio->sc_dmat,
 	    vioq->viq_rxdmamaps[i], m, BUS_DMA_READ|BUS_DMA_NOWAIT);