aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-03-11 02:29:47 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-03-11 02:29:47 +0000
commit4b1c2fb15fb13928f6272fb6caaabe064df7dcdd (patch)
tree8d33abc227e9ac1172d9808a30095e394b1740f6 /target
parentdfe1972d6266e046876f7c0b2f2f80fe94ebae08 (diff)
downloadupstream-4b1c2fb15fb13928f6272fb6caaabe064df7dcdd.tar.gz
upstream-4b1c2fb15fb13928f6272fb6caaabe064df7dcdd.tar.bz2
upstream-4b1c2fb15fb13928f6272fb6caaabe064df7dcdd.zip
cns3xxx: ethernet - clean the tx ring only in the poll function, not in the xmit handler
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35952 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/cns3xxx/files/drivers/net/ethernet/cavium/cns3xxx_eth.c17
1 files changed, 11 insertions, 6 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 7166288b55..9c3618fd9b 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
@@ -436,14 +436,20 @@ static void cns3xxx_adjust_link(struct net_device *dev)
dev->name, port->speed, port->duplex ? "full" : "half");
}
+static void eth_schedule_poll(struct sw *sw)
+{
+ if (unlikely(!napi_schedule_prep(&sw->napi)))
+ return;
+
+ disable_irq_nosync(IRQ_CNS3XXX_SW_R0RXC);
+ __napi_schedule(&sw->napi);
+}
+
irqreturn_t eth_rx_irq(int irq, void *pdev)
{
struct net_device *dev = pdev;
struct sw *sw = netdev_priv(dev);
- if (likely(napi_schedule_prep(&sw->napi))) {
- disable_irq_nosync(IRQ_CNS3XXX_SW_R0RXC);
- __napi_schedule(&sw->napi);
- }
+ eth_schedule_poll(sw);
return (IRQ_HANDLED);
}
@@ -767,9 +773,8 @@ static int eth_xmit(struct sk_buff *skb, struct net_device *dev)
skb_walk_frags(skb, skb1)
nr_desc++;
+ eth_schedule_poll(sw);
spin_lock_bh(&tx_lock);
-
- eth_complete_tx(sw);
if ((tx_ring->num_used + nr_desc + 1) >= TX_DESCS) {
spin_unlock_bh(&tx_lock);
return NETDEV_TX_BUSY;