aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2023-12-20 19:09:09 +0000
committerWarner Losh <imp@FreeBSD.org>2023-12-21 04:16:45 +0000
commit9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4 (patch)
tree32b80166841e5c5308d21c3c9f6bc4f94b11d5ad
parent486ee36440e19060a8c405fb2ba68cfdfa17d63e (diff)
downloadsrc-9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4.tar.gz
src-9e6d11ce9a51d75ed6a94e180f2fb4e9188a2ba4.zip
vtnet: Adjust rx buffer so IP header 32-bit aligned
Call madj(m, ETHER_ALIGN) to offset rx buffers when allocating them. This improves performance everywhere, and allows armv7 to work at all. PR: 271288 (PR had a different fix than I wound up with) MFC After: 3 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D43136
-rw-r--r--sys/dev/virtio/network/if_vtnet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 287af7751066..360176e4f845 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -1532,8 +1532,8 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp)
m_freem(m_head);
return (NULL);
}
-
m->m_len = size;
+ m_adj(m, ETHER_ALIGN);
if (m_head != NULL) {
m_tail->m_next = m;
m_tail = m;