"default\n"
" --metrics: to display derived metrics of the ports, disabled by "
"default\n"
- " --xstats-name NAME: to display single xstat value by NAME\n"
+ " --xstats-name NAME: to display single xstat id by NAME\n"
" --xstats-ids IDLIST: to display xstat values by id. "
"The argument is comma-separated list of xstat ids to print out.\n"
" --stats-reset: to reset port statistics\n"
int ret, i;
static const char *nic_stats_border = "########################";
- values = malloc(sizeof(values) * len);
+ values = malloc(sizeof(*values) * len);
if (values == NULL) {
printf("Cannot allocate memory for xstats\n");
return;
return;
}
- if (len != rte_eth_xstats_get_names(
+ if (len != rte_eth_xstats_get_names_by_id(
port_id, xstats_names, len, ids)) {
printf("Cannot get xstat names\n");
goto err;
printf("###### NIC extended statistics for port %-2d #########\n",
port_id);
printf("%s############################\n", nic_stats_border);
- ret = rte_eth_xstats_get(port_id, ids, values, len);
+ ret = rte_eth_xstats_get_by_id(port_id, ids, values, len);
if (ret < 0 || ret > len) {
printf("Cannot get xstats\n");
goto err;
int len, ret, i;
static const char *nic_stats_border = "########################";
- len = rte_eth_xstats_get_names(port_id, NULL, 0, NULL);
+ len = rte_eth_xstats_get_names_by_id(port_id, NULL, 0, NULL);
if (len < 0) {
printf("Cannot get xstats count\n");
return;
}
- values = malloc(sizeof(values) * len);
+ values = malloc(sizeof(*values) * len);
if (values == NULL) {
printf("Cannot allocate memory for xstats\n");
return;
free(values);
return;
}
- if (len != rte_eth_xstats_get_names(
+ if (len != rte_eth_xstats_get_names_by_id(
port_id, xstats_names, len, NULL)) {
printf("Cannot get xstat names\n");
goto err;
port_id);
printf("%s############################\n",
nic_stats_border);
- ret = rte_eth_xstats_get(port_id, NULL, values, len);
+ ret = rte_eth_xstats_get_by_id(port_id, NULL, values, len);
if (ret < 0 || ret > len) {
printf("Cannot get xstats\n");
goto err;