From: Jason Brown Date: Tue, 28 Nov 2017 19:12:43 +0000 (-0800) Subject: net: mvneta - Fixed recv() when multiple packets have arrived. X-Git-Tag: v2018.03-rc1~175^2~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=32ac8b0bba72684281a079a8e23832efabd97e09;p=u-boot net: mvneta - Fixed recv() when multiple packets have arrived. This patch fixes a problem in the mvneta driver where if more than one packet arrives between calls to mvneta_recv(), the additional descriptors will be marked as free even though only one descriptor has been read and processed from the receive queue. This causes the additional packet(s) to be delayed until the next packet arrives. >From this point on all packets will be delayed because the receive queue will contain unprocessed packets but the hardware shows no busy descriptors. Signed-off-by: Jason Brown Reviewed-by: Stefan Roese Acked-by: Joe Hershberger --- diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index f1be9521a9..83e3153768 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1654,7 +1654,11 @@ static int mvneta_recv(struct udevice *dev, int flags, uchar **packetp) */ *packetp = data; - mvneta_rxq_desc_num_update(pp, rxq, rx_done, rx_done); + /* + * Only mark one descriptor as free + * since only one was processed + */ + mvneta_rxq_desc_num_update(pp, rxq, 1, 1); } return rx_bytes;