cns3xxx: fix RX softIRQ loop
authorKoen Vandeputte <koen.vandeputte@ncentric.com>
Thu, 16 Jun 2016 11:48:39 +0000 (13:48 +0200)
committerJohn Crispin <john@phrozen.org>
Fri, 17 Jun 2016 02:13:07 +0000 (04:13 +0200)
Already reschedule when 1 or more frames came in.

Checking for a full queue could produce a re-schedule loop as
the checked RX ring location could contain undefined values
depending on activity in previous loops.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c

index 2f232c1d29b0f67515bb4e90260449eb8da8f9e9..51b01876efe6a61a4a734890eaeea5bbe231fd90 100644 (file)
@@ -717,8 +717,8 @@ static int eth_poll(struct napi_struct *napi, int budget)
                enable_irq(sw->rx_irq);
                budget = 0;
 
                enable_irq(sw->rx_irq);
                budget = 0;
 
-               /* if rx descriptors are full schedule another poll */
-               if (rx_ring->desc[(i-1) & (RX_DESCS-1)].cown)
+               /* If 1 or more frames came in during IRQ enable, re-schedule */
+               if (rx_ring->desc[i].cown)
                        eth_schedule_poll(sw);
        }
 
                        eth_schedule_poll(sw);
        }