summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorkarl beldan <karl.beldan@gmail.com>2016-08-15 17:23:01 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2016-08-22 14:21:13 -0500
commita51897b6c1e517ea2ce95da59784e84c5992dd00 (patch)
tree95c7a2f607dab53ebb4f16bfc57598b9fd9aae32 /drivers/net
parent6202b8f28c10977a9533ba4c49574b136a64ce82 (diff)
net: davinci_emac: Invalidate only the received portion of a buffer
ATM when receiving a packet the whole buffer is invalidated, this change optimizes this behaviour. Signed-off-by: Karl Beldan <karl.beldan+oss@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/davinci_emac.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 187137c8b4..6283487708 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -681,12 +681,12 @@ 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, tmp + EMAC_RXBUF_SIZE);
- 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, tmp + ALIGN(len, PKTALIGN));
+ net_process_received_packet(rx_curr_desc->buffer, len);
+ ret = len;
}
/* Ack received packet descriptor */