Network problem on ARM

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Oct 10 07:28:37 UTC 2008


Gene Smith wrote:
> [...]
> Would like to know how you ultimately fix this. I may have the same 
> problem if I ever optimize my driver to have the DMA drop the received 
> packets directly in the mbufs.

I increment now the cluster data start address by two bytes and it works
fine:

static struct mbuf *lpc24xx_eth_new_mbuf( struct ifnet *ifp)
{
  struct mbuf *m = NULL;

  MGETHDR( m, M_DONTWAIT, MT_DATA);
  if (m != NULL) {
    MCLGET( m, M_DONTWAIT);
    if (IS_FLAG_SET( m->m_flags, M_EXT)) {
      /* Set receive interface */
      m->m_pkthdr.rcvif = ifp;

      /* Adjust by two bytes for proper IP header alignment */
      m->m_data = mtod( m, char *) + 2;

      return m;
    } else {
      m_freem( m);
    }
  }

  return NULL;
}


-- 
Sebastian Huber, Embedded Brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list