Commit 184ec856 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: abm: add up bands for sto/non-sto stats

Add up stats for all bands for the extra ethtool statistics.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarJohn Hurley <john.hurley@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 57f31bba
......@@ -94,24 +94,36 @@ int nfp_abm_ctrl_set_q_lvl(struct nfp_abm_link *alink, unsigned int band,
return __nfp_abm_ctrl_set_q_lvl(alink->abm, threshold, val);
}
u64 nfp_abm_ctrl_stat_non_sto(struct nfp_abm_link *alink, unsigned int i)
u64 nfp_abm_ctrl_stat_non_sto(struct nfp_abm_link *alink, unsigned int queue)
{
u64 val;
unsigned int band;
u64 val, sum = 0;
for (band = 0; band < alink->abm->num_bands; band++) {
if (nfp_abm_ctrl_stat(alink, alink->abm->qm_stats,
NFP_QMSTAT_STRIDE, NFP_QMSTAT_NON_STO,
band, queue, true, &val))
return 0;
sum += val;
}
if (nfp_abm_ctrl_stat(alink, alink->abm->qm_stats, NFP_QMSTAT_STRIDE,
NFP_QMSTAT_NON_STO, 0, i, true, &val))
return 0;
return val;
return sum;
}
u64 nfp_abm_ctrl_stat_sto(struct nfp_abm_link *alink, unsigned int i)
u64 nfp_abm_ctrl_stat_sto(struct nfp_abm_link *alink, unsigned int queue)
{
u64 val;
unsigned int band;
u64 val, sum = 0;
for (band = 0; band < alink->abm->num_bands; band++) {
if (nfp_abm_ctrl_stat(alink, alink->abm->qm_stats,
NFP_QMSTAT_STRIDE, NFP_QMSTAT_STO,
band, queue, true, &val))
return 0;
sum += val;
}
if (nfp_abm_ctrl_stat(alink, alink->abm->qm_stats, NFP_QMSTAT_STRIDE,
NFP_QMSTAT_STO, 0, i, true, &val))
return 0;
return val;
return sum;
}
static int
......
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