dpaa2-eth: add channel stat to debugfs
Compute the average number of frames processed for each CDAN (Channel Data Availability Notification) and export it to debugfs detailed channel stats. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ae23aae229
commit
460fd830dd
|
@ -127,16 +127,19 @@ static int dpaa2_dbg_ch_show(struct seq_file *file, void *offset)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
seq_printf(file, "Channel stats for %s:\n", priv->net_dev->name);
|
seq_printf(file, "Channel stats for %s:\n", priv->net_dev->name);
|
||||||
seq_printf(file, "%s%16s%16s%16s%16s\n",
|
seq_printf(file, "%s%16s%16s%16s%16s%16s%16s\n",
|
||||||
"CHID", "CPU", "Deq busy", "CDANs", "Buf count");
|
"CHID", "CPU", "Deq busy", "Frames", "CDANs",
|
||||||
|
"Avg Frm/CDAN", "Buf count");
|
||||||
|
|
||||||
for (i = 0; i < priv->num_channels; i++) {
|
for (i = 0; i < priv->num_channels; i++) {
|
||||||
ch = priv->channel[i];
|
ch = priv->channel[i];
|
||||||
seq_printf(file, "%4d%16d%16llu%16llu%16d\n",
|
seq_printf(file, "%4d%16d%16llu%16llu%16llu%16llu%16d\n",
|
||||||
ch->ch_id,
|
ch->ch_id,
|
||||||
ch->nctx.desired_cpu,
|
ch->nctx.desired_cpu,
|
||||||
ch->stats.dequeue_portal_busy,
|
ch->stats.dequeue_portal_busy,
|
||||||
|
ch->stats.frames,
|
||||||
ch->stats.cdan,
|
ch->stats.cdan,
|
||||||
|
ch->stats.frames / ch->stats.cdan,
|
||||||
ch->buf_count);
|
ch->buf_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -493,6 +493,7 @@ static int consume_frames(struct dpaa2_eth_channel *ch,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fq->stats.frames += cleaned;
|
fq->stats.frames += cleaned;
|
||||||
|
ch->stats.frames += cleaned;
|
||||||
|
|
||||||
/* A dequeue operation only pulls frames from a single queue
|
/* A dequeue operation only pulls frames from a single queue
|
||||||
* into the store. Return the frame queue as an out param.
|
* into the store. Return the frame queue as an out param.
|
||||||
|
|
|
@ -288,6 +288,8 @@ struct dpaa2_eth_ch_stats {
|
||||||
__u64 xdp_tx;
|
__u64 xdp_tx;
|
||||||
__u64 xdp_tx_err;
|
__u64 xdp_tx_err;
|
||||||
__u64 xdp_redirect;
|
__u64 xdp_redirect;
|
||||||
|
/* Must be last, does not show up in ethtool stats */
|
||||||
|
__u64 frames;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Maximum number of queues associated with a DPNI */
|
/* Maximum number of queues associated with a DPNI */
|
||||||
|
|
|
@ -277,7 +277,7 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev,
|
||||||
/* Per-channel stats */
|
/* Per-channel stats */
|
||||||
for (k = 0; k < priv->num_channels; k++) {
|
for (k = 0; k < priv->num_channels; k++) {
|
||||||
ch_stats = &priv->channel[k]->stats;
|
ch_stats = &priv->channel[k]->stats;
|
||||||
for (j = 0; j < sizeof(*ch_stats) / sizeof(__u64); j++)
|
for (j = 0; j < sizeof(*ch_stats) / sizeof(__u64) - 1; j++)
|
||||||
*((__u64 *)data + i + j) += *((__u64 *)ch_stats + j);
|
*((__u64 *)data + i + j) += *((__u64 *)ch_stats + j);
|
||||||
}
|
}
|
||||||
i += j;
|
i += j;
|
||||||
|
|
Loading…
Reference in New Issue