Commit ad5a87d7 authored by Joao Pinto's avatar Joao Pinto Committed by David S. Miller

net: stmmac: mac debug prepared for multiple queues

This patch prepares mac debug dump for multiple queues.
Signed-off-by: default avatarJoao Pinto <jpinto@synopsys.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8f71a88d
...@@ -491,7 +491,8 @@ struct stmmac_ops { ...@@ -491,7 +491,8 @@ struct stmmac_ops {
void (*reset_eee_mode)(struct mac_device_info *hw); void (*reset_eee_mode)(struct mac_device_info *hw);
void (*set_eee_timer)(struct mac_device_info *hw, int ls, int tw); void (*set_eee_timer)(struct mac_device_info *hw, int ls, int tw);
void (*set_eee_pls)(struct mac_device_info *hw, int link); void (*set_eee_pls)(struct mac_device_info *hw, int link);
void (*debug)(void __iomem *ioaddr, struct stmmac_extra_stats *x); void (*debug)(void __iomem *ioaddr, struct stmmac_extra_stats *x,
u32 rx_queues, u32 tx_queues);
/* PCS calls */ /* PCS calls */
void (*pcs_ctrl_ane)(void __iomem *ioaddr, bool ane, bool srgmi_ral, void (*pcs_ctrl_ane)(void __iomem *ioaddr, bool ane, bool srgmi_ral,
bool loopback); bool loopback);
......
...@@ -413,7 +413,8 @@ static void dwmac1000_get_adv_lp(void __iomem *ioaddr, struct rgmii_adv *adv) ...@@ -413,7 +413,8 @@ static void dwmac1000_get_adv_lp(void __iomem *ioaddr, struct rgmii_adv *adv)
dwmac_get_adv_lp(ioaddr, GMAC_PCS_BASE, adv); dwmac_get_adv_lp(ioaddr, GMAC_PCS_BASE, adv);
} }
static void dwmac1000_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x) static void dwmac1000_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x,
u32 rx_queues, u32 tx_queues)
{ {
u32 value = readl(ioaddr + GMAC_DEBUG); u32 value = readl(ioaddr + GMAC_DEBUG);
......
...@@ -469,12 +469,14 @@ static int dwmac4_irq_status(struct mac_device_info *hw, ...@@ -469,12 +469,14 @@ static int dwmac4_irq_status(struct mac_device_info *hw,
return ret; return ret;
} }
static void dwmac4_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x) static void dwmac4_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x,
u32 rx_queues, u32 tx_queues)
{ {
u32 value; u32 value;
u32 queue;
/* Currently only channel 0 is supported */ for (queue = 0; queue < tx_queues; queue++) {
value = readl(ioaddr + MTL_CHAN_TX_DEBUG(STMMAC_CHAN0)); value = readl(ioaddr + MTL_CHAN_TX_DEBUG(queue));
if (value & MTL_DEBUG_TXSTSFSTS) if (value & MTL_DEBUG_TXSTSFSTS)
x->mtl_tx_status_fifo_full++; x->mtl_tx_status_fifo_full++;
...@@ -496,8 +498,10 @@ static void dwmac4_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x) ...@@ -496,8 +498,10 @@ static void dwmac4_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x)
} }
if (value & MTL_DEBUG_TXPAUSED) if (value & MTL_DEBUG_TXPAUSED)
x->mac_tx_in_pause++; x->mac_tx_in_pause++;
}
value = readl(ioaddr + MTL_CHAN_RX_DEBUG(STMMAC_CHAN0)); for (queue = 0; queue < rx_queues; queue++) {
value = readl(ioaddr + MTL_CHAN_RX_DEBUG(queue));
if (value & MTL_DEBUG_RXFSTS_MASK) { if (value & MTL_DEBUG_RXFSTS_MASK) {
u32 rxfsts = (value & MTL_DEBUG_RXFSTS_MASK) u32 rxfsts = (value & MTL_DEBUG_RXFSTS_MASK)
...@@ -527,6 +531,7 @@ static void dwmac4_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x) ...@@ -527,6 +531,7 @@ static void dwmac4_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x)
} }
if (value & MTL_DEBUG_RWCSTS) if (value & MTL_DEBUG_RWCSTS)
x->mtl_rx_fifo_ctrl_active++; x->mtl_rx_fifo_ctrl_active++;
}
/* GMAC debug */ /* GMAC debug */
value = readl(ioaddr + GMAC_DEBUG); value = readl(ioaddr + GMAC_DEBUG);
......
...@@ -520,6 +520,8 @@ static void stmmac_get_ethtool_stats(struct net_device *dev, ...@@ -520,6 +520,8 @@ static void stmmac_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *dummy, u64 *data) struct ethtool_stats *dummy, u64 *data)
{ {
struct stmmac_priv *priv = netdev_priv(dev); struct stmmac_priv *priv = netdev_priv(dev);
u32 rx_queues_count = priv->plat->rx_queues_to_use;
u32 tx_queues_count = priv->plat->tx_queues_to_use;
int i, j = 0; int i, j = 0;
/* Update the DMA HW counters for dwmac10/100 */ /* Update the DMA HW counters for dwmac10/100 */
...@@ -550,7 +552,8 @@ static void stmmac_get_ethtool_stats(struct net_device *dev, ...@@ -550,7 +552,8 @@ static void stmmac_get_ethtool_stats(struct net_device *dev,
if ((priv->hw->mac->debug) && if ((priv->hw->mac->debug) &&
(priv->synopsys_id >= DWMAC_CORE_3_50)) (priv->synopsys_id >= DWMAC_CORE_3_50))
priv->hw->mac->debug(priv->ioaddr, priv->hw->mac->debug(priv->ioaddr,
(void *)&priv->xstats); (void *)&priv->xstats,
rx_queues_count, tx_queues_count);
} }
for (i = 0; i < STMMAC_STATS_LEN; i++) { for (i = 0; i < STMMAC_STATS_LEN; i++) {
char *p = (char *)priv + stmmac_gstrings_stats[i].stat_offset; char *p = (char *)priv + stmmac_gstrings_stats[i].stat_offset;
......
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