summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/enetc
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2023-06-09 16:59:16 +0300
committerDavid S. Miller <davem@davemloft.net>2023-06-12 09:43:30 +0100
commit2b84960fc5dd38a19241388fb33f20936cb217e2 (patch)
tree4ba8bdaaffeaac3c1da110fede5214671d5b6aa7 /drivers/net/ethernet/freescale/enetc
parentf2ea0c3582abc721ce9e090cf496b96e6b204e2c (diff)
net/sched: taprio: report class offload stats per TXQ, not per TC
The taprio Qdisc creates child classes per netdev TX queue, but taprio_dump_class_stats() currently reports offload statistics per traffic class. Traffic classes are groups of TXQs sharing the same dequeue priority, so this is incorrect and we shouldn't be bundling up the TXQ stats when reporting them, as we currently do in enetc. Modify the API from taprio to drivers such that they report TXQ offload stats and not TC offload stats. There is no change in the UAPI or in the global Qdisc stats. Fixes: 6c1adb650c8d ("net/sched: taprio: add netlink reporting for offload statistics counters") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/enetc')
-rw-r--r--drivers/net/ethernet/freescale/enetc/enetc_qos.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_qos.c b/drivers/net/ethernet/freescale/enetc/enetc_qos.c
index 71157eba1fbe..58cdd67bb573 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_qos.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_qos.c
@@ -160,20 +160,14 @@ static void enetc_taprio_stats(struct net_device *ndev,
stats->window_drops = window_drops;
}
-static void enetc_taprio_tc_stats(struct net_device *ndev,
- struct tc_taprio_qopt_tc_stats *tc_stats)
+static void enetc_taprio_queue_stats(struct net_device *ndev,
+ struct tc_taprio_qopt_queue_stats *queue_stats)
{
- struct tc_taprio_qopt_stats *stats = &tc_stats->stats;
+ struct tc_taprio_qopt_stats *stats = &queue_stats->stats;
struct enetc_ndev_priv *priv = netdev_priv(ndev);
- int tc = tc_stats->tc;
- u64 window_drops = 0;
- int i;
+ int queue = queue_stats->queue;
- for (i = 0; i < priv->num_tx_rings; i++)
- if (priv->tx_ring[i]->prio == tc)
- window_drops += priv->tx_ring[i]->stats.win_drop;
-
- stats->window_drops = window_drops;
+ stats->window_drops = priv->tx_ring[queue]->stats.win_drop;
}
static int enetc_taprio_replace(struct net_device *ndev,
@@ -208,8 +202,8 @@ int enetc_setup_tc_taprio(struct net_device *ndev, void *type_data)
case TAPRIO_CMD_STATS:
enetc_taprio_stats(ndev, &offload->stats);
break;
- case TAPRIO_CMD_TC_STATS:
- enetc_taprio_tc_stats(ndev, &offload->tc_stats);
+ case TAPRIO_CMD_QUEUE_STATS:
+ enetc_taprio_queue_stats(ndev, &offload->queue_stats);
break;
default:
err = -EOPNOTSUPP;