Ed Sutter wrote: > 2. pbuf_alloc() setting payload buffers up to be aligned > based on MEM_ALIGNMENT
"your driver must support it" means you have to: - set ETH_PAD_SIZE to 2 in lwipopts.h - allocate 2 extra bytes, eg pbuf_alloc(PBUF_RAW, your_current_size+ETH_PAD_SIZE, PBUF_RAM) - take care of those few things that I quite forgot... Luca > 3. the increment of the payload pointer by 14 in ethernet_input() > and... > 4. the overlay of the "helper" structure in > ip_reass_chain_frag_into_datagram_and_validate() > > will cause the misaligned access. If the option you mention > fixes it for my > situation on the BF537, that doesn't resolve it for other systems. > Right? > Ed > > Ceresoli Luca wrote: > > Ed Sutter wrote: > >> I'm running LWIP 1.3.0 on a Blackfin, which is picky about > >> ... > >> The ethernet_input() function then sees that it is IP, > >> increments the payload > >> pointer by 14 (size of ethernet header) and passes the pbufs > >> to ip_input(). > >> Note that at this point, the payload pointer is no longer > >> aligned on a 4-byte > >> boundary because the original 4-byte-aligned payload pointer > >> is incremented > >> by 14. > > > > Which Blackfin are you using? > > Tha Ethernet MAC of Blackfin 536/7 can optionally add two > dummy bytes in front of incoming frames (setting bit RXDWA in > the EMAC_SYSCTL register). This makes all TCP/IP headers > 4-byte aligned. > > > > Of course your driver must support it. > > > > Luca > > > > > > _______________________________________________ > > lwip-users mailing list > > [email protected] > > http://lists.nongnu.org/mailman/listinfo/lwip-users > > > > > _______________________________________________ > lwip-users mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/lwip-users > _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
