From: sf Date: Mon, 26 Aug 2024 19:24:02 +0000 (+0000) Subject: vio(4): Fix hardmtu without MRG_RXBUF X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=310c43a68b96daf4a131370c91fb1fec0e33da68;p=openbsd vio(4): Fix hardmtu without MRG_RXBUF Without VIRTIO_NET_F_MRG_RXBUF, we cannot chain several buffers together and we can only receive packets up to the length of the buffers we put into the ring. OK bluhm@ --- diff --git a/sys/dev/pv/if_vio.c b/sys/dev/pv/if_vio.c index 49013140134..55de44893ab 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.46 2024/08/16 13:02:44 jan Exp $ */ +/* $OpenBSD: if_vio.c,v 1.47 2024/08/26 19:24:02 sf Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg. @@ -599,7 +599,7 @@ vio_attach(struct device *parent, struct device *self, void *aux) if (virtio_has_feature(vsc, VIRTIO_NET_F_MRG_RXBUF)) ifp->if_hardmtu = MAXMCLBYTES; else - ifp->if_hardmtu = MAXMCLBYTES - sc->sc_hdr_size - ETHER_HDR_LEN; + ifp->if_hardmtu = MCLBYTES - sc->sc_hdr_size - ETHER_HDR_LEN; if (virtio_alloc_vq(vsc, &sc->sc_vq[VQRX], 0, MCLBYTES, 2, "rx") != 0) goto err;