[rtems-libbsd commit] rtwn: Align mbuf to avoid realignment in rx path
Sebastian Huber
sebh at rtems.org
Thu Oct 4 12:19:36 UTC 2018
Module: rtems-libbsd
Branch: master
Commit: f9d4e1d8c1eb918802e0a6ceef252e2f76a2bd01
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=f9d4e1d8c1eb918802e0a6ceef252e2f76a2bd01
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Oct 4 14:10:10 2018 +0200
rtwn: Align mbuf to avoid realignment in rx path
See ieee80211_realign().
---
freebsd/sys/dev/rtwn/usb/rtwn_usb_rx.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/freebsd/sys/dev/rtwn/usb/rtwn_usb_rx.c b/freebsd/sys/dev/rtwn/usb/rtwn_usb_rx.c
index 9de8fca..4870c41 100644
--- a/freebsd/sys/dev/rtwn/usb/rtwn_usb_rx.c
+++ b/freebsd/sys/dev/rtwn/usb/rtwn_usb_rx.c
@@ -128,7 +128,11 @@ rtwn_rx_copy_to_mbuf(struct rtwn_softc *sc, struct rtwn_rx_stat_common *stat,
if (rtwn_rx_check_pre_alloc(sc, stat) != 0)
goto fail;
+#ifndef __rtems__
m = m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR);
+#else /* __rtems__ */
+ m = m_get2(totlen + ETHER_ALIGN, M_NOWAIT, MT_DATA, M_PKTHDR);
+#endif /* __rtems__ */
if (__predict_false(m == NULL)) {
device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n",
__func__);
@@ -136,6 +140,9 @@ rtwn_rx_copy_to_mbuf(struct rtwn_softc *sc, struct rtwn_rx_stat_common *stat,
}
/* Finalize mbuf. */
+#ifdef __rtems__
+ m->m_data += ETHER_ALIGN;
+#endif /* __rtems__ */
memcpy(mtod(m, uint8_t *), (uint8_t *)stat, totlen);
m->m_pkthdr.len = m->m_len = totlen;
More information about the vc
mailing list