summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_stats.c
diff options
context:
space:
mode:
authorNĂ©lio Laranjeiro <nelio.laranjeiro@6wind.com>2018-03-13 10:23:55 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-03-30 14:08:44 +0200
commit0f99970b4adc943264df0487904d340124765e68 (patch)
tree0296039e3bccb9b4a7c40a3a34fc5d1f646d7897 /drivers/net/mlx5/mlx5_stats.c
parenta6d83b6a9209a198fa5a7d2f9cbb37190e256f9c (diff)
downloaddpdk-0f99970b4adc943264df0487904d340124765e68.zip
dpdk-0f99970b4adc943264df0487904d340124765e68.tar.gz
dpdk-0f99970b4adc943264df0487904d340124765e68.tar.xz
net/mlx5: use port id in PMD log
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_stats.c')
-rw-r--r--drivers/net/mlx5/mlx5_stats.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 06e9a1f..066d347 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -148,7 +148,8 @@ mlx5_read_dev_counters(struct rte_eth_dev *dev, uint64_t *stats)
ifr.ifr_data = (caddr_t)et_stats;
ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
if (ret) {
- WARN("unable to read statistic values from device");
+ WARN("port %u unable to read statistic values from device",
+ dev->data->port_id);
return ret;
}
for (i = 0; i != xstats_n; ++i) {
@@ -194,7 +195,8 @@ mlx5_ethtool_get_stats_n(struct rte_eth_dev *dev) {
ifr.ifr_data = (caddr_t)&drvinfo;
ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
if (ret) {
- WARN("unable to query number of statistics");
+ WARN("port %u unable to query number of statistics",
+ dev->data->port_id);
return ret;
}
return drvinfo.n_stats;
@@ -221,7 +223,8 @@ mlx5_xstats_init(struct rte_eth_dev *dev)
ret = mlx5_ethtool_get_stats_n(dev);
if (ret < 0) {
- WARN("no extended statistics available");
+ WARN("port %u no extended statistics available",
+ dev->data->port_id);
return;
}
dev_stats_n = ret;
@@ -232,7 +235,8 @@ mlx5_xstats_init(struct rte_eth_dev *dev)
rte_malloc("xstats_strings",
str_sz + sizeof(struct ethtool_gstrings), 0);
if (!strings) {
- WARN("unable to allocate memory for xstats");
+ WARN("port %u unable to allocate memory for xstats",
+ dev->data->port_id);
return;
}
strings->cmd = ETHTOOL_GSTRINGS;
@@ -241,7 +245,8 @@ mlx5_xstats_init(struct rte_eth_dev *dev)
ifr.ifr_data = (caddr_t)strings;
ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
if (ret) {
- WARN("unable to get statistic names");
+ WARN("port %u unable to get statistic names",
+ dev->data->port_id);
goto free;
}
for (j = 0; j != xstats_n; ++j)
@@ -262,7 +267,8 @@ mlx5_xstats_init(struct rte_eth_dev *dev)
if (mlx5_counters_init[j].ib)
continue;
if (xstats_ctrl->dev_table_idx[j] >= dev_stats_n) {
- WARN("counter \"%s\" is not recognized",
+ WARN("port %u counter \"%s\" is not recognized",
+ dev->data->port_id,
mlx5_counters_init[j].dpdk_name);
goto free;
}
@@ -271,7 +277,8 @@ mlx5_xstats_init(struct rte_eth_dev *dev)
assert(xstats_n <= MLX5_MAX_XSTATS);
ret = mlx5_read_dev_counters(dev, xstats_ctrl->base);
if (ret)
- ERROR("cannot read device counters: %s", strerror(rte_errno));
+ ERROR("port %u cannot read device counters: %s",
+ dev->data->port_id, strerror(rte_errno));
free:
rte_free(strings);
}
@@ -438,7 +445,7 @@ mlx5_xstats_reset(struct rte_eth_dev *dev)
stats_n = mlx5_ethtool_get_stats_n(dev);
if (stats_n < 0) {
- ERROR("%p cannot get stats: %s", (void *)dev,
+ ERROR("port %u cannot get stats: %s", dev->data->port_id,
strerror(-stats_n));
return;
}
@@ -446,8 +453,8 @@ mlx5_xstats_reset(struct rte_eth_dev *dev)
mlx5_xstats_init(dev);
ret = mlx5_read_dev_counters(dev, counters);
if (ret) {
- ERROR("%p cannot read device counters: %s", (void *)dev,
- strerror(rte_errno));
+ ERROR("port %u cannot read device counters: %s",
+ dev->data->port_id, strerror(rte_errno));
return;
}
for (i = 0; i != n; ++i)
@@ -469,7 +476,7 @@ mlx5_xstats_reset(struct rte_eth_dev *dev)
*/
int
mlx5_xstats_get_names(struct rte_eth_dev *dev __rte_unused,
- struct rte_eth_xstat_name *xstats_names, unsigned int n)
+ struct rte_eth_xstat_name *xstats_names, unsigned int n)
{
unsigned int i;