Skip to contentSkip to conversation

net: mvneta - Fixed recv() when multiple packets have arrived.

PATCH In review Jason Brown 3 participants 4 messages Nov 28, 2017 – Jan 22, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

 drivers/net/mvneta.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/mvneta.c +5 -1
index f1be952..83e3153 100644
@@ -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;
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 net: mvneta - Fixed recv() when multiple packets have arrived.

Quoted 23 lines · Jason Brown

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.

---

  drivers/net/mvneta.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/mvneta.c +0 -0
index f1be952..83e3153 100644
@@ -1654,7 +1654,11 @@ static int mvneta_recv(struct udevice *dev, int flags, uchar **packetp)
  		 */
  		*packetp = data;

drivers/net/mvneta.c static int mvneta_recv(struct udevice *dev, int flags, uchar **packetp) · line 1664

Quoted 10 lines
drivers/net/mvneta.c +5 -1
 
-		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;

Thanks for catching and fixing this issue.

Thanks,
Stefan

#2 lore raw

PATCH 1/1 net: mvneta - Fixed recv() when multiple packets have arrived.

In reply to Jason Brown
Quoted 10 lines · Jason Brown

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.