Commit a51897b6 authored by karl beldan's avatar karl beldan Committed by Joe Hershberger

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: default avatarKarl Beldan <karl.beldan+oss@gmail.com>
Acked-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
Reviewed-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
parent 6202b8f2
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment