aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/cns3xxx
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-03-11 02:29:53 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-03-11 02:29:53 +0000
commitdf755284d90f27df1520691433f043e09c7a6608 (patch)
treea3721ef4f3fcefd3ef2b2e90dbc798d59c5d7cb0 /target/linux/cns3xxx
parent4b1c2fb15fb13928f6272fb6caaabe064df7dcdd (diff)
downloadupstream-df755284d90f27df1520691433f043e09c7a6608.tar.gz
upstream-df755284d90f27df1520691433f043e09c7a6608.tar.bz2
upstream-df755284d90f27df1520691433f043e09c7a6608.zip
cns3xxx: ethernet - clean the tx ring before refilling the rx ring to reduce memory pressure
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35953 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/cns3xxx')
-rw-r--r--target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c8
1 files changed, 4 insertions, 4 deletions
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 9c3618fd9b..db15a2e2e5 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
@@ -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;
}