[U-Boot] [PATCH 3/3] net: davinci_emac: Invalidate only the received portion of a buffer
Joe Hershberger
joe.hershberger at gmail.com
Mon Aug 15 18:09:35 CEST 2016
On Sun, Aug 14, 2016 at 10:03 AM, Karl Beldan <karl.beldan at gmail.com> wrote:
> ATM when receiving a packet the whole buffer is invalidated, this change
> optimizes this behaviour.
>
> Signed-off-by: Karl Beldan <karl.beldan+oss at gmail.com>
> ---
> drivers/net/davinci_emac.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
> index 55461b0..e26e727 100644
> --- a/drivers/net/davinci_emac.c
> +++ b/drivers/net/davinci_emac.c
> @@ -677,13 +677,13 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
> printf ("WARN: emac_rcv_pkt: Error in packet\n");
> } else {
> unsigned long tmp = (unsigned long)rx_curr_desc->buffer;
> + unsigned short len =
> + rx_curr_desc->buff_off_len & 0xffff;
>
> - invalidate_dcache_range(tmp, round_up(tmp + EMAC_RXBUF_SIZE,
> - ARCH_DMA_MINALIGN));
> - net_process_received_packet(
> - rx_curr_desc->buffer,
> - rx_curr_desc->buff_off_len & 0xffff);
> - ret = rx_curr_desc->buff_off_len & 0xffff;
> + invalidate_dcache_range(tmp, round_up(tmp + len,
> + ARCH_DMA_MINALIGN));
Here again, please use tmp + ALIGN(len, PKTALIGN)
> + net_process_received_packet(rx_curr_desc->buffer, len);
> + ret = len;
> }
Thanks,
-Joe
More information about the U-Boot
mailing list