summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
diff options
context:
space:
mode:
authorJoao Pinto2017-03-15 12:04:55 +0100
committerDavid S. Miller2017-03-15 22:44:33 +0100
commit7bac4e1ec3ca2342929a39638d615c6b672c27a0 (patch)
treef4c7116c80d1ff9827a432b63bdc3199ead3ee15 /drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
parentnet: stmmac: tso init prepared for multiple queues (diff)
downloadkernel-qcow2-linux-7bac4e1ec3ca2342929a39638d615c6b672c27a0.tar.gz
kernel-qcow2-linux-7bac4e1ec3ca2342929a39638d615c6b672c27a0.tar.xz
kernel-qcow2-linux-7bac4e1ec3ca2342929a39638d615c6b672c27a0.zip
net: stmmac: stmmac interrupt treatment prepared for multiple queues
This patch prepares the main ISR for multiple queues. Signed-off-by: Joao Pinto <jpinto@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_main.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c802286380dc..d3a21519e4c0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3115,6 +3115,12 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *)dev_id;
struct stmmac_priv *priv = netdev_priv(dev);
+ u32 rx_cnt = priv->plat->rx_queues_to_use;
+ u32 tx_cnt = priv->plat->tx_queues_to_use;
+ u32 queues_count;
+ u32 queue;
+
+ queues_count = (rx_cnt > tx_cnt) ? rx_cnt : tx_cnt;
if (priv->irq_wake)
pm_wakeup_event(priv->device, 0);
@@ -3129,20 +3135,26 @@ static irqreturn_t stmmac_interrupt(int irq, void *dev_id)
int status = priv->hw->mac->host_irq_status(priv->hw,
&priv->xstats);
- if (priv->synopsys_id >= DWMAC_CORE_4_00)
- status |= priv->hw->mac->host_mtl_irq_status(priv->hw,
- STMMAC_CHAN0);
-
if (unlikely(status)) {
/* For LPI we need to save the tx status */
if (status & CORE_IRQ_TX_PATH_IN_LPI_MODE)
priv->tx_path_in_lpi_mode = true;
if (status & CORE_IRQ_TX_PATH_EXIT_LPI_MODE)
priv->tx_path_in_lpi_mode = false;
- if (status & CORE_IRQ_MTL_RX_OVERFLOW && priv->hw->dma->set_rx_tail_ptr)
- priv->hw->dma->set_rx_tail_ptr(priv->ioaddr,
- priv->rx_tail_addr,
- STMMAC_CHAN0);
+ }
+
+ if (priv->synopsys_id >= DWMAC_CORE_4_00) {
+ for (queue = 0; queue < queues_count; queue++) {
+ status |=
+ priv->hw->mac->host_mtl_irq_status(priv->hw,
+ queue);
+
+ if (status & CORE_IRQ_MTL_RX_OVERFLOW &&
+ priv->hw->dma->set_rx_tail_ptr)
+ priv->hw->dma->set_rx_tail_ptr(priv->ioaddr,
+ priv->rx_tail_addr,
+ queue);
+ }
}
/* PCS link status */