Commit 9d6e0c8b authored by David S. Miller's avatar David S. Miller

Merge branch 'net-lantiq-Fix-bugs-in-NAPI-handling'

Hauke Mehrtens says:

====================
net: lantiq: Fix bugs in NAPI handling

This fixes multiple bugs in the NAPI handling.

Changes since:
v1:
 - removed stable tag from "net: lantiq: use netif_tx_napi_add() for TX NAPI"
 - Check the NAPI budged in "net: lantiq: Use napi_complete_done()"
 - Add extra fix "net: lantiq: Disable IRQs only if NAPI gets scheduled"
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4202c9fd 9423361d
...@@ -230,8 +230,8 @@ static int xrx200_poll_rx(struct napi_struct *napi, int budget) ...@@ -230,8 +230,8 @@ static int xrx200_poll_rx(struct napi_struct *napi, int budget)
} }
if (rx < budget) { if (rx < budget) {
napi_complete(&ch->napi); if (napi_complete_done(&ch->napi, rx))
ltq_dma_enable_irq(&ch->dma); ltq_dma_enable_irq(&ch->dma);
} }
return rx; return rx;
...@@ -268,9 +268,12 @@ static int xrx200_tx_housekeeping(struct napi_struct *napi, int budget) ...@@ -268,9 +268,12 @@ static int xrx200_tx_housekeeping(struct napi_struct *napi, int budget)
net_dev->stats.tx_bytes += bytes; net_dev->stats.tx_bytes += bytes;
netdev_completed_queue(ch->priv->net_dev, pkts, bytes); netdev_completed_queue(ch->priv->net_dev, pkts, bytes);
if (netif_queue_stopped(net_dev))
netif_wake_queue(net_dev);
if (pkts < budget) { if (pkts < budget) {
napi_complete(&ch->napi); if (napi_complete_done(&ch->napi, pkts))
ltq_dma_enable_irq(&ch->dma); ltq_dma_enable_irq(&ch->dma);
} }
return pkts; return pkts;
...@@ -342,10 +345,12 @@ static irqreturn_t xrx200_dma_irq(int irq, void *ptr) ...@@ -342,10 +345,12 @@ static irqreturn_t xrx200_dma_irq(int irq, void *ptr)
{ {
struct xrx200_chan *ch = ptr; struct xrx200_chan *ch = ptr;
ltq_dma_disable_irq(&ch->dma); if (napi_schedule_prep(&ch->napi)) {
ltq_dma_ack_irq(&ch->dma); __napi_schedule(&ch->napi);
ltq_dma_disable_irq(&ch->dma);
}
napi_schedule(&ch->napi); ltq_dma_ack_irq(&ch->dma);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -499,7 +504,7 @@ static int xrx200_probe(struct platform_device *pdev) ...@@ -499,7 +504,7 @@ static int xrx200_probe(struct platform_device *pdev)
/* setup NAPI */ /* setup NAPI */
netif_napi_add(net_dev, &priv->chan_rx.napi, xrx200_poll_rx, 32); netif_napi_add(net_dev, &priv->chan_rx.napi, xrx200_poll_rx, 32);
netif_napi_add(net_dev, &priv->chan_tx.napi, xrx200_tx_housekeeping, 32); netif_tx_napi_add(net_dev, &priv->chan_tx.napi, xrx200_tx_housekeeping, 32);
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment