aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/altera/altera_tse_main.c
diff options
context:
space:
mode:
authorAndreas Oetken <andreas@oetken.name>2015-04-16 23:48:08 +0200
committerDavid S. Miller <davem@davemloft.net>2015-04-17 15:13:31 -0400
commit93ea337852d6c9f292e2ccfc394be0f2859b99ae (patch)
tree067f790a216591ef4565aad8fc642b8f7ea50096 /drivers/net/ethernet/altera/altera_tse_main.c
parentnet: remove unused 'dev' argument from netif_needs_gso() (diff)
downloadlinux-dev-93ea337852d6c9f292e2ccfc394be0f2859b99ae.tar.xz
linux-dev-93ea337852d6c9f292e2ccfc394be0f2859b99ae.zip
altera tse: Fix network-delays and -retransmissions after high throughput.
Fix bug which occurs when more than <limit> packets are available during napi-poll, leading to "delays" and retransmissions on the network. Check for (count < limit) before checking the get_rx_status in tse_rx-function. Function get_rx_status is reading from the response-fifo. If there is currently a response in the fifo, reading the last byte of the response pops the value from the fifo. If the limit is checked as second condition and the limit is reached the fifo is popped but the packet is not processed. Signed-off-by: Andreas Oetken <ennoerlangen@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/altera/altera_tse_main.c')
-rw-r--r--drivers/net/ethernet/altera/altera_tse_main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 79ea35869e1e..90a76306ad0f 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -376,8 +376,13 @@ static int tse_rx(struct altera_tse_private *priv, int limit)
u16 pktlength;
u16 pktstatus;
- while (((rxstatus = priv->dmaops->get_rx_status(priv)) != 0) &&
- (count < limit)) {
+ /* Check for count < limit first as get_rx_status is changing
+ * the response-fifo so we must process the next packet
+ * after calling get_rx_status if a response is pending.
+ * (reading the last byte of the response pops the value from the fifo.)
+ */
+ while ((count < limit) &&
+ ((rxstatus = priv->dmaops->get_rx_status(priv)) != 0)) {
pktstatus = rxstatus >> 16;
pktlength = rxstatus & 0xffff;