ifr.ifr_data = (caddr_t)et_stats;
ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
if (ret) {
- WARN("port %u unable to read statistic values from device",
- dev->data->port_id);
+ DRV_LOG(WARNING,
+ "port %u unable to read statistic values from device",
+ dev->data->port_id);
return ret;
}
for (i = 0; i != xstats_n; ++i) {
ifr.ifr_data = (caddr_t)&drvinfo;
ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
if (ret) {
- WARN("port %u unable to query number of statistics",
- dev->data->port_id);
+ DRV_LOG(WARNING, "port %u unable to query number of statistics",
+ dev->data->port_id);
return ret;
}
return drvinfo.n_stats;
ret = mlx5_ethtool_get_stats_n(dev);
if (ret < 0) {
- WARN("port %u no extended statistics available",
- dev->data->port_id);
+ DRV_LOG(WARNING, "port %u no extended statistics available",
+ dev->data->port_id);
return;
}
dev_stats_n = ret;
rte_malloc("xstats_strings",
str_sz + sizeof(struct ethtool_gstrings), 0);
if (!strings) {
- WARN("port %u unable to allocate memory for xstats",
+ DRV_LOG(WARNING, "port %u unable to allocate memory for xstats",
dev->data->port_id);
return;
}
ifr.ifr_data = (caddr_t)strings;
ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
if (ret) {
- WARN("port %u unable to get statistic names",
- dev->data->port_id);
+ DRV_LOG(WARNING, "port %u unable to get statistic names",
+ dev->data->port_id);
goto free;
}
for (j = 0; j != xstats_n; ++j)
if (mlx5_counters_init[j].ib)
continue;
if (xstats_ctrl->dev_table_idx[j] >= dev_stats_n) {
- WARN("port %u counter \"%s\" is not recognized",
- dev->data->port_id,
- mlx5_counters_init[j].dpdk_name);
+ DRV_LOG(WARNING,
+ "port %u counter \"%s\" is not recognized",
+ dev->data->port_id,
+ mlx5_counters_init[j].dpdk_name);
goto free;
}
}
assert(xstats_n <= MLX5_MAX_XSTATS);
ret = mlx5_read_dev_counters(dev, xstats_ctrl->base);
if (ret)
- ERROR("port %u cannot read device counters: %s",
- dev->data->port_id, strerror(rte_errno));
+ DRV_LOG(ERR, "port %u cannot read device counters: %s",
+ dev->data->port_id, strerror(rte_errno));
free:
rte_free(strings);
}
stats_n = mlx5_ethtool_get_stats_n(dev);
if (stats_n < 0) {
- ERROR("port %u cannot get stats: %s", dev->data->port_id,
- strerror(-stats_n));
+ DRV_LOG(ERR, "port %u cannot get stats: %s", dev->data->port_id,
+ strerror(-stats_n));
return;
}
if (xstats_ctrl->stats_n != stats_n)
mlx5_xstats_init(dev);
ret = mlx5_read_dev_counters(dev, counters);
if (ret) {
- ERROR("port %u cannot read device counters: %s",
- dev->data->port_id, strerror(rte_errno));
+ DRV_LOG(ERR, "port %u cannot read device counters: %s",
+ dev->data->port_id, strerror(rte_errno));
return;
}
for (i = 0; i != n; ++i)