cns3xxx: fix an rx irq handling corner case
[openwrt.git] / target / linux / cns3xxx / files / drivers / net / ethernet / cavium / cns3xxx_eth.c
index 7ffff68..7309d9e 100644 (file)
@@ -706,15 +706,15 @@ static int eth_poll(struct napi_struct *napi, int budget)
                }
        }
 
-       cns3xxx_alloc_rx_buf(sw, received);
-
-       rx_ring->cur_index = i;
-
-       if (received != budget) {
+       if (!received) {
                napi_complete(napi);
                enable_irq(IRQ_CNS3XXX_SW_R0RXC);
        }
 
+       cns3xxx_alloc_rx_buf(sw, received);
+
+       rx_ring->cur_index = i;
+
        wmb();
        enable_rx_dma(sw);