diff options
author | 2016-04-27 12:56:20 +0000 | |
---|---|---|
committer | 2016-04-27 12:56:20 +0000 | |
commit | e63f2732e0cae4fa88149319763f9c26268dbb87 (patch) | |
tree | 07a422410729f8ab8a4f37c4b62b37f593e2b925 | |
parent | tweak some command list handling (diff) | |
download | wireguard-openbsd-e63f2732e0cae4fa88149319763f9c26268dbb87.tar.xz wireguard-openbsd-e63f2732e0cae4fa88149319763f9c26268dbb87.zip |
align rx buffers so ip packets will be aligned correctly for the stack
this matters more for strict alignment archs than the ones xge
currently runs on.
from marisa emerson
-rw-r--r-- | sys/dev/pci/if_xge.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/pci/if_xge.c b/sys/dev/pci/if_xge.c index af32793cc0a..d6df003b32b 100644 --- a/sys/dev/pci/if_xge.c +++ b/sys/dev/pci/if_xge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xge.c,v 1.69 2016/04/27 12:54:20 dlg Exp $ */ +/* $OpenBSD: if_xge.c,v 1.70 2016/04/27 12:56:20 dlg Exp $ */ /* $NetBSD: if_xge.c,v 1.1 2005/09/09 10:30:27 ragge Exp $ */ /* @@ -1328,6 +1328,8 @@ xge_add_rxbuf(struct xge_softc *sc, int id) bus_dmamap_unload(sc->sc_dmat, sc->sc_rxm[id]); sc->sc_rxb[id] = m[0]; + m_adj(m[0], ETHER_ALIGN); + error = bus_dmamap_load_mbuf(sc->sc_dmat, sc->sc_rxm[id], m[0], BUS_DMA_READ|BUS_DMA_NOWAIT); if (error) |