aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhangfei Gao <zhangfei.gao@linaro.org>2014-04-30 14:11:09 +0800
committerZhangfei Gao <zhangfei.gao@linaro.org>2014-04-30 15:02:06 +0800
commit5d5af1adbf432f84f863266675c56a118f9da052 (patch)
tree5f1e24fa5cfbd4ae0601fc7dec226aef5ea61033
parente5c6bd532c513de8f9a937bddc3cd51ee83f12de (diff)
-rw-r--r--drivers/net/ethernet/hisilicon/hip04_eth.c22
-rw-r--r--net/sched/sch_generic.c1
2 files changed, 14 insertions, 9 deletions
diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c
index 2981d246d736..4d80005b663b 100644
--- a/drivers/net/ethernet/hisilicon/hip04_eth.c
+++ b/drivers/net/ethernet/hisilicon/hip04_eth.c
@@ -315,6 +315,7 @@ static void hip04_mac_disable(struct net_device *ndev)
static void hip04_set_xmit_desc(struct hip04_priv *priv, dma_addr_t phys)
{
+ wmb();
writel(phys, priv->base + PPE_CFG_CPU_ADD_ADDR);
}
@@ -346,12 +347,12 @@ static int hip04_set_mac_address(struct net_device *ndev, void *addr)
return 0;
}
+static int count = 10;
static void hip04_tx_reclaim(struct net_device *ndev, bool force)
{
struct hip04_priv *priv = netdev_priv(ndev);
unsigned tx_tail = priv->tx_tail;
struct tx_desc *desc;
- unsigned int bytes_compl = 0, pkts_compl = 0;
netif_tx_lock(ndev);
if (priv->tx_count == 0)
@@ -360,6 +361,13 @@ static void hip04_tx_reclaim(struct net_device *ndev, bool force)
while ((tx_tail != priv->tx_head) || (priv->tx_count == TX_DESC_NUM)) {
desc = &priv->tx_desc[priv->tx_tail];
if (desc->send_addr != 0) {
+ if (priv->tx_count > count) {
+ u32 next = TX_NEXT(priv->tx_tail);
+
+ count = priv->tx_count;
+ printk(KERN_DEBUG "count=%d, priv->tx_count=%d, priv->tx_head=%d, priv->tx_tail=%d, send_addr=0x%x, tail=%d\n", count, priv->tx_count, priv->tx_head, priv->tx_tail, priv->tx_desc[priv->tx_tail].send_addr, tx_tail);
+ printk(KERN_DEBUG "priv->tx_desc[%d].send_addr=0x%x\n", next, priv->tx_desc[next].send_addr);
+ }
if (force)
desc->send_addr = 0;
else
@@ -371,8 +379,6 @@ static void hip04_tx_reclaim(struct net_device *ndev, bool force)
priv->tx_skb[tx_tail]->len, DMA_TO_DEVICE);
priv->tx_phys[tx_tail] = 0;
}
- pkts_compl++;
- bytes_compl += priv->tx_skb[tx_tail]->len;
dev_kfree_skb(priv->tx_skb[tx_tail]);
priv->tx_skb[tx_tail] = NULL;
tx_tail = TX_NEXT(tx_tail);
@@ -389,9 +395,6 @@ static void hip04_tx_reclaim(struct net_device *ndev, bool force)
out:
netif_tx_unlock(ndev);
- if (pkts_compl || bytes_compl)
- netdev_completed_queue(ndev, pkts_compl, bytes_compl);
-
if (unlikely(netif_queue_stopped(ndev)) &&
(priv->tx_count < TX_DESC_NUM))
netif_wake_queue(ndev);
@@ -406,6 +409,7 @@ static int hip04_mac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
dma_addr_t phys;
if (priv->tx_count >= TX_DESC_NUM) {
+ printk("stop, priv->tx_count=%d\n", priv->tx_count);
netif_stop_queue(ndev);
return NETDEV_TX_BUSY;
}
@@ -430,7 +434,6 @@ static int hip04_mac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
hip04_set_xmit_desc(priv, phys);
priv->tx_head = TX_NEXT(tx_head);
- netdev_sent_queue(ndev, skb->len);
stats->tx_bytes += skb->len;
stats->tx_packets++;
@@ -531,10 +534,11 @@ static irqreturn_t hip04_mac_interrupt(int irq, void *dev_id)
writel_relaxed(DEF_INT_MASK, priv->base + PPE_RINT);
if (unlikely(ists & DEF_INT_ERR)) {
- if (ists & (RCV_NOBUF | RCV_DROP))
+ if (ists & (RCV_NOBUF | RCV_DROP)) {
stats->rx_errors++;
stats->rx_dropped++;
netdev_err(ndev, "rx drop\n");
+ }
if (ists & TX_DROP) {
stats->tx_dropped++;
netdev_err(ndev, "tx drop\n");
@@ -588,7 +592,6 @@ static int hip04_mac_open(struct net_device *ndev)
if (priv->phy)
phy_start(priv->phy);
- netdev_reset_queue(ndev);
netif_start_queue(ndev);
hip04_mac_enable(ndev);
napi_enable(&priv->napi);
@@ -625,6 +628,7 @@ static void hip04_timeout(struct net_device *ndev)
{
struct hip04_priv *priv = netdev_priv(ndev);
+ printk("gzf %s\n", __func__);
schedule_work(&priv->tx_timeout_task);
}
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index e1543b03e39d..d85f076847c6 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -253,6 +253,7 @@ static void dev_watchdog(unsigned long arg)
if (netif_xmit_stopped(txq) &&
time_after(jiffies, (trans_start +
dev->watchdog_timeo))) {
+ printk("txq->state=0x%x\n", txq->state);
some_queue_timedout = 1;
txq->trans_timeout++;
break;