cns3xxx: ethernet - clean the tx ring before refilling the rx ring to reduce memory...
authorFelix Fietkau <nbd@openwrt.org>
Mon, 11 Mar 2013 02:29:53 +0000 (02:29 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 11 Mar 2013 02:29:53 +0000 (02:29 +0000)
SVN-Revision: 35953

target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c

index 9c3618fd9b24b13b4440bb428fdace5afdccbc15..db15a2e2e50d8f664c8ebd757dc9352f0ee1289d 100644 (file)
@@ -718,6 +718,10 @@ static int eth_poll(struct napi_struct *napi, int budget)
                enable_irq(IRQ_CNS3XXX_SW_R0RXC);
        }
 
+       spin_lock_bh(&tx_lock);
+       eth_complete_tx(sw);
+       spin_unlock_bh(&tx_lock);
+
        cns3xxx_alloc_rx_buf(sw, received);
 
        rx_ring->cur_index = i;
@@ -725,10 +729,6 @@ static int eth_poll(struct napi_struct *napi, int budget)
        wmb();
        enable_rx_dma(sw);
 
-       spin_lock_bh(&tx_lock);
-       eth_complete_tx(sw);
-       spin_unlock_bh(&tx_lock);
-
        return received;
 }