summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_stats.c
diff options
context:
space:
mode:
authorShahaf Shuler <shahafs@mellanox.com>2017-02-14 16:31:06 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2017-04-04 15:52:50 +0200
commit859081d3fbbf81501726a5920749e47a2a65e9d3 (patch)
treeb77053782ae797b653fb6f193a32d901cb22100f /drivers/net/mlx5/mlx5_stats.c
parent865787886101310954ddc35eb5c29b3ab7b9c055 (diff)
downloaddpdk-859081d3fbbf81501726a5920749e47a2a65e9d3.zip
dpdk-859081d3fbbf81501726a5920749e47a2a65e9d3.tar.gz
dpdk-859081d3fbbf81501726a5920749e47a2a65e9d3.tar.xz
net/mlx5: add out of buffer counter to extended statistic
This commit adds RX out of buffer counter to xstats report. The counter counts the number of dropped occurred due to lack of buffers on device RX queues. Signed-off-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_stats.c')
-rw-r--r--drivers/net/mlx5/mlx5_stats.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 20c957e..a48ebea 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -125,6 +125,10 @@ static const struct mlx5_counter_ctrl mlx5_counters_init[] = {
.dpdk_name = "tx_errors_phy",
.ctr_name = "tx_errors_phy",
},
+ {
+ .dpdk_name = "rx_out_of_buffer",
+ .ctr_name = "out_of_buffer",
+ },
};
static const unsigned int xstats_n = RTE_DIM(mlx5_counters_init);
@@ -159,9 +163,15 @@ priv_read_dev_counters(struct priv *priv, uint64_t *stats)
WARN("unable to read statistic values from device");
return -1;
}
- for (i = 0; i != xstats_n; ++i)
- stats[i] = (uint64_t)
- et_stats->data[xstats_ctrl->dev_table_idx[i]];
+ for (i = 0; i != xstats_n; ++i) {
+ if (priv_is_ib_cntr(mlx5_counters_init[i].ctr_name))
+ priv_get_cntr_sysfs(priv,
+ mlx5_counters_init[i].ctr_name,
+ &stats[i]);
+ else
+ stats[i] = (uint64_t)
+ et_stats->data[xstats_ctrl->dev_table_idx[i]];
+ }
return 0;
}
@@ -233,6 +243,8 @@ priv_xstats_init(struct priv *priv)
}
}
for (j = 0; j != xstats_n; ++j) {
+ if (priv_is_ib_cntr(mlx5_counters_init[i].ctr_name))
+ continue;
if (xstats_ctrl->dev_table_idx[j] >= dev_stats_n) {
WARN("counter \"%s\" is not recognized",
mlx5_counters_init[j].dpdk_name);