Subject: Re: [PATCH] net: fec_main: dma_map() only the length of the skb

From: Sebastian Andrzej Siewior <[email-masked]>
Date: Wed, 27 Nov 2013 14:38:27 +0100

- <[email-masked]> because MTA complains

On 11/27/2013 02:08 PM, Fugang Duan wrote:
> In fact, there have one memory copy for enet as below since enet have 16 bytes data buffer alignment request.
> if (((unsigned long) bufaddr) & FEC_ALIGNMENT) {
>                 memcpy(fep->tx_bounce[index], skb->data, skb->len);
>                 bufaddr = fep->tx_bounce[index];
> }

This memcpy() is only executed if the buffer isn't properly aligned
which shouldn't be the rule but an exception. This aligment check is
also available in v2.6.31 where the BUG_ON() statement was triggered.

> 
> So, the bug you describe at commit log shouldn't exist.
> 
> Anyway, it is better to use the real packet size for the mapping.
> 
> 
> I will do overnight stress test for the patch tomorrow.

Thanks.

> Thanks,
> Andy

Sebastian