diff --git a/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c b/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c index 7ffff684de3..7309d9ea779 100644 --- a/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c +++ b/target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c @@ -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);