Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/dev/pci Pull up following revision(s) (requested by t...



details:   https://anonhg.NetBSD.org/src/rev/1ab753edab44
branches:  netbsd-9
changeset: 963054:1ab753edab44
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Sep 29 07:26:23 2019 +0000

description:
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

diffstat:

 sys/dev/pci/if_mcx.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r a53f4d2c22e0 -r 1ab753edab44 sys/dev/pci/if_mcx.c
--- a/sys/dev/pci/if_mcx.c      Sat Sep 28 12:40:33 2019 +0000
+++ b/sys/dev/pci/if_mcx.c      Sun Sep 29 07:26:23 2019 +0000
@@ -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 @@
 #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);
 



Home | Main Index | Thread Index | Old Index