From 73d9c7e8b555178a43dfbaa1bec61254203c01f3 Mon Sep 17 00:00:00 2001 From: jan Date: Tue, 28 May 2024 12:11:26 +0000 Subject: [PATCH] vio(4): fix jumbo frames vio_rx_offload() was called too early. So, the consistency checks of ether_extact() cause wrong packet detection and wrong checkums. also tested by bluhm ok bluhm@ --- sys/dev/pv/if_vio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/pv/if_vio.c b/sys/dev/pv/if_vio.c index 3d0a4f5210d..2f750c27103 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.35 2024/05/24 10:05:55 jsg Exp $ */ +/* $OpenBSD: if_vio.c,v 1.36 2024/05/28 12:11:26 jan Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg. @@ -1118,8 +1118,6 @@ vio_rxeof(struct vio_softc *sc) bufs_left = hdr->num_buffers - 1; else bufs_left = 0; - if (virtio_has_feature(vsc, VIRTIO_NET_F_GUEST_CSUM)) - vio_rx_offload(m, hdr); } else { m->m_flags &= ~M_PKTHDR; m0->m_pkthdr.len += m->m_len; @@ -1129,6 +1127,8 @@ vio_rxeof(struct vio_softc *sc) } if (bufs_left == 0) { + if (virtio_has_feature(vsc, VIRTIO_NET_F_GUEST_CSUM)) + vio_rx_offload(m0, hdr); ml_enqueue(&ml, m0); m0 = NULL; } -- 2.20.1