Module Name: src
Committed By: martin
Date: Sun Sep 29 07:26:23 UTC 2019
Modified Files:
src/sys/dev/pci [netbsd-9]: if_mcx.c
Log Message:
Pull up following revision(s) (requested by tnn in ticket #266):
sys/dev/pci/if_mcx.c: revision 1.3
sys/dev/pci/if_mcx.c: revision 1.4
mcx(4): fix rx mbuf DMA overrun
pullup-9
-
len -> m_len
To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/dev/pci/if_mcx.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_mcx.c
diff -u src/sys/dev/pci/if_mcx.c:1.1.2.3 src/sys/dev/pci/if_mcx.c:1.1.2.4
--- src/sys/dev/pci/if_mcx.c:1.1.2.3 Thu Sep 26 19:09:57 2019
+++ src/sys/dev/pci/if_mcx.c Sun Sep 29 07:26:23 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mcx.c,v 1.1.2.3 2019/09/26 19:09:57 martin Exp $ */
+/* $NetBSD: if_mcx.c,v 1.1.2.4 2019/09/29 07:26:23 martin Exp $ */
/* $OpenBSD: if_mcx.c,v 1.33 2019/09/12 04:23:59 jmatthew Exp $ */
/*
@@ -5620,15 +5620,16 @@ mcx_rx_fill_slots(struct mcx_softc *sc,
#endif
m->m_data += ETHER_ALIGN;
- m->m_len = m->m_pkthdr.len = bufsize;
+ m->m_len = m->m_pkthdr.len = m->m_ext.ext_size - ETHER_ALIGN;
if (bus_dmamap_load_mbuf(sc->sc_dmat, ms->ms_map, m,
BUS_DMA_NOWAIT) != 0) {
m_freem(m);
break;
}
+ bus_dmamap_sync(sc->sc_dmat, ms->ms_map, 0, ms->ms_map->dm_mapsize, BUS_DMASYNC_PREREAD);
ms->ms_m = m;
- rqe[slot].rqe_byte_count = htobe32(bufsize);
+ rqe[slot].rqe_byte_count = htobe32(m->m_len);
rqe[slot].rqe_addr = htobe64(ms->ms_map->dm_segs[0].ds_addr);
rqe[slot].rqe_lkey = htobe32(sc->sc_lkey);