Changeset 6103496 in rtems-libbsd


Ignore:
Timestamp:
Sep 14, 2018, 11:33:34 AM (9 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
eeb3fd5d9b07ac9a2e280cff60a1b762bd273a8d, 1e989998de954bef51e6c19cc3d64d39f32100aa
Children:
7aba2a4
Parents:
1b70957
git-author:
Sebastian Huber <sebastian.huber@…> (09/14/18 11:33:34)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/21/18 08:29:43)
Message:

if_ffec_mpc8xx: Fix incoming data invalidation

With a write-back cache dirty cache lines may be evicted which could
overwrite new data.

Close #3523.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsbsd/sys/dev/ffec/if_ffec_mpc8xx.c

    r1b70957 r6103496  
    522522    m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR);
    523523    m->m_pkthdr.rcvif = ifp;
     524    rtems_cache_invalidate_multiple_data_lines(mtod(m, void *), RBUF_SIZE);
    524525    sc->rxMbuf[rxBdIndex] = m;
    525526    rxBd->buffer = mtod (m, void *);
     
    579580        /*
    580581         * Pass the packet up the chain.
    581          * FIXME: Packet filtering hook could be done here.
    582582         */
    583 
    584         /*
    585          * Invalidate the buffer for this descriptor
    586          */
    587         rtems_cache_invalidate_multiple_data_lines(rxBd->buffer, rxBd->length);
    588 
    589583        m = sc->rxMbuf[rxBdIndex];
    590584        m->m_len = m->m_pkthdr.len = rxBd->length - ETHER_CRC_LEN;
     
    592586        (*sc->ifp->if_input)(sc->ifp, m);
    593587        FEC_LOCK(sc);
     588
     589        n->m_pkthdr.rcvif = ifp;
     590        rtems_cache_invalidate_multiple_data_lines(mtod(n, void *), RBUF_SIZE);
    594591      } else {
    595592        /* Drop incoming frame if no new mbuf is available */
     
    619616    }
    620617
    621     n->m_pkthdr.rcvif = ifp;
    622618    sc->rxMbuf[rxBdIndex] = n;
    623619    rxBd->buffer = mtod (n, void *);
Note: See TracChangeset for help on using the changeset viewer.