cns3xxx: ethernet - resolve SMP issue
[openwrt/svn-archive/archive.git] / target / linux / cns3xxx / files / drivers / net / ethernet / cavium / cns3xxx_eth.c
index db15a2e2e50d8f664c8ebd757dc9352f0ee1289d..bbbbf5c09160cbc63a9d65e14b75e1a8cba691e9 100644 (file)
@@ -713,9 +713,14 @@ static int eth_poll(struct napi_struct *napi, int budget)
                }
        }
 
+       rx_ring->cur_index = i;
        if (!received) {
                napi_complete(napi);
                enable_irq(IRQ_CNS3XXX_SW_R0RXC);
+
+               /* if rx descriptors are full schedule another poll */
+               if (rx_ring->desc[(i-1) & (RX_DESCS-1)].cown)
+                       eth_schedule_poll(sw);
        }
 
        spin_lock_bh(&tx_lock);
@@ -724,8 +729,6 @@ static int eth_poll(struct napi_struct *napi, int budget)
 
        cns3xxx_alloc_rx_buf(sw, received);
 
-       rx_ring->cur_index = i;
-
        wmb();
        enable_rx_dma(sw);