summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/rdc
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2016-07-04 14:36:04 -0700
committerDavid S. Miller <davem@davemloft.net>2016-07-05 00:10:29 -0700
commit58e6b056b0daa8f0287061cff2989e9d5e9a9b7c (patch)
tree60470d605c44d17ebf6bdea27b3ffde890fc356d /drivers/net/ethernet/rdc
parenta546e557d9404834159b0599a4383ff4cd3321bf (diff)
downloadlinux-58e6b056b0daa8f0287061cff2989e9d5e9a9b7c.tar.bz2
net: r6040: Reclaim transmitted buffers in NAPI
Instead of taking one interrupt per packet transmitted, re-use the same NAPI context to free transmitted buffers. Since we are no longer in hard IRQ context replace dev_kfree_skb_irq() by dev_kfree_skb(). Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/rdc')
-rw-r--r--drivers/net/ethernet/rdc/r6040.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/ethernet/rdc/r6040.c b/drivers/net/ethernet/rdc/r6040.c
index 46ed093348da..4bf78f18a937 100644
--- a/drivers/net/ethernet/rdc/r6040.c
+++ b/drivers/net/ethernet/rdc/r6040.c
@@ -622,7 +622,7 @@ static void r6040_tx(struct net_device *dev)
pci_unmap_single(priv->pdev, le32_to_cpu(descptr->buf),
skb_ptr->len, PCI_DMA_TODEVICE);
/* Free buffer */
- dev_kfree_skb_irq(skb_ptr);
+ dev_kfree_skb(skb_ptr);
descptr->skb_ptr = NULL;
/* To next descriptor */
descptr = descptr->vndescp;
@@ -643,12 +643,15 @@ static int r6040_poll(struct napi_struct *napi, int budget)
void __iomem *ioaddr = priv->base;
int work_done;
+ r6040_tx(dev);
+
work_done = r6040_rx(dev, budget);
if (work_done < budget) {
napi_complete(napi);
- /* Enable RX interrupt */
- iowrite16(ioread16(ioaddr + MIER) | RX_INTS, ioaddr + MIER);
+ /* Enable RX/TX interrupt */
+ iowrite16(ioread16(ioaddr + MIER) | RX_INTS | TX_INTS,
+ ioaddr + MIER);
}
return work_done;
}
@@ -675,7 +678,7 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
}
/* RX interrupt request */
- if (status & RX_INTS) {
+ if (status & (RX_INTS | TX_INTS)) {
if (status & RX_NO_DESC) {
/* RX descriptor unavailable */
dev->stats.rx_dropped++;
@@ -686,15 +689,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
if (likely(napi_schedule_prep(&lp->napi))) {
/* Mask off RX interrupt */
- misr &= ~RX_INTS;
+ misr &= ~(RX_INTS | TX_INTS);
__napi_schedule(&lp->napi);
}
}
- /* TX interrupt request */
- if (status & TX_INTS)
- r6040_tx(dev);
-
/* Restore RDC MAC interrupt */
iowrite16(misr, ioaddr + MIER);