struct rte_eth_xstat_name *xstat_names;
int port_id, num_xstats;
int i, ret;
+ char *end_param;
if (params == NULL || strlen(params) == 0 || !isdigit(*params))
return -1;
- port_id = atoi(params);
+ port_id = strtoul(params, &end_param, 0);
+ if (*end_param != '\0')
+ RTE_ETHDEV_LOG(NOTICE,
+ "Extra parameters passed to ethdev telemetry command, ignoring");
if (!rte_eth_dev_is_valid_port(port_id))
return -1;
static const char *status_str = "status";
int ret, port_id;
struct rte_eth_link link;
+ char *end_param;
if (params == NULL || strlen(params) == 0 || !isdigit(*params))
return -1;
- port_id = atoi(params);
+ port_id = strtoul(params, &end_param, 0);
+ if (*end_param != '\0')
+ RTE_ETHDEV_LOG(NOTICE,
+ "Extra parameters passed to ethdev telemetry command, ignoring");
if (!rte_eth_dev_is_valid_port(port_id))
return -1;
struct rte_rawdev_xstats_name *xstat_names;
int dev_id, num_xstats, i, ret;
unsigned int *ids;
+ char *end_param;
if (params == NULL || strlen(params) == 0 || !isdigit(*params))
return -1;
- dev_id = atoi(params);
+ dev_id = strtoul(params, &end_param, 0);
+ if (*end_param != '\0')
+ RTE_RDEV_LOG(NOTICE,
+ "Extra parameters passed to rawdev telemetry command, ignoring");
if (!rte_rawdev_pmd_is_valid_dev(dev_id))
return -1;
while (bytes > 0) {
buffer[bytes] = 0;
const char *cmd = strtok(buffer, ",");
- const char *param = strtok(NULL, ",");
+ const char *param = strtok(NULL, "\0");
telemetry_cb fn = unknown_command;
int i;