@@ -122,6 +122,7 @@ cmd_set_vf_split_drop_en_parsed(void *parsed_result,
struct cmd_vf_split_drop_en_result *res = parsed_result;
int ret = -ENOTSUP;
int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+ char errmsg[RTE_STRERR_BUFSIZE];
if (port_id_is_invalid(res->port_id, ENABLED_WARN))
return;
@@ -141,7 +142,9 @@ cmd_set_vf_split_drop_en_parsed(void *parsed_result,
fprintf(stderr, "not supported on port %d\n", res->port_id);
break;
default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+ if (strerror_r(-ret, errmsg, sizeof(errmsg)) != 0)
+ snprintf(errmsg, sizeof(errmsg), "Unknown error %d", -ret);
+ fprintf(stderr, "programming error: (%s)\n", errmsg);
}
}
@@ -215,6 +218,7 @@ cmd_set_macsec_offload_on_parsed(void *parsed_result,
int en = (strcmp(res->en_on_off, "on") == 0) ? 1 : 0;
int rp = (strcmp(res->rp_on_off, "on") == 0) ? 1 : 0;
struct rte_eth_dev_info dev_info;
+ char errmsg[RTE_STRERR_BUFSIZE];
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
@@ -243,7 +247,9 @@ cmd_set_macsec_offload_on_parsed(void *parsed_result,
fprintf(stderr, "not supported on port %d\n", port_id);
break;
default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+ if (strerror_r(-ret, errmsg, sizeof(errmsg)) != 0)
+ snprintf(errmsg, sizeof(errmsg), "Unknown error %d", -ret);
+ fprintf(stderr, "programming error: (%s)\n", errmsg);
}
}
@@ -300,6 +306,7 @@ cmd_set_macsec_offload_off_parsed(void *parsed_result,
int ret = -ENOTSUP;
struct rte_eth_dev_info dev_info;
portid_t port_id = res->port_id;
+ char errmsg[RTE_STRERR_BUFSIZE];
if (port_id_is_invalid(port_id, ENABLED_WARN))
return;
@@ -327,7 +334,9 @@ cmd_set_macsec_offload_off_parsed(void *parsed_result,
fprintf(stderr, "not supported on port %d\n", port_id);
break;
default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+ if (strerror_r(-ret, errmsg, sizeof(errmsg)) != 0)
+ snprintf(errmsg, sizeof(errmsg), "Unknown error %d", -ret);
+ fprintf(stderr, "programming error: (%s)\n", errmsg);
}
}
@@ -386,6 +395,7 @@ cmd_set_macsec_sc_parsed(void *parsed_result,
struct cmd_macsec_sc_result *res = parsed_result;
int ret = -ENOTSUP;
int is_tx = (strcmp(res->tx_rx, "tx") == 0) ? 1 : 0;
+ char errmsg[RTE_STRERR_BUFSIZE];
ret = is_tx ?
rte_pmd_ixgbe_macsec_config_txsc(res->port_id,
@@ -402,7 +412,9 @@ cmd_set_macsec_sc_parsed(void *parsed_result,
fprintf(stderr, "not supported on port %d\n", res->port_id);
break;
default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+ if (strerror_r(-ret, errmsg, sizeof(errmsg)) != 0)
+ snprintf(errmsg, sizeof(errmsg), "Unknown error %d", -ret);
+ fprintf(stderr, "programming error: (%s)\n", errmsg);
}
}
@@ -471,6 +483,7 @@ cmd_set_macsec_sa_parsed(void *parsed_result,
struct cmd_macsec_sa_result *res = parsed_result;
int ret = -ENOTSUP;
int is_tx = (strcmp(res->tx_rx, "tx") == 0) ? 1 : 0;
+ char errmsg[RTE_STRERR_BUFSIZE];
uint8_t key[16] = { 0 };
uint8_t xdgt0;
uint8_t xdgt1;
@@ -510,7 +523,9 @@ cmd_set_macsec_sa_parsed(void *parsed_result,
fprintf(stderr, "not supported on port %d\n", res->port_id);
break;
default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+ if (strerror_r(-ret, errmsg, sizeof(errmsg)) != 0)
+ snprintf(errmsg, sizeof(errmsg), "Unknown error %d", -ret);
+ fprintf(stderr, "programming error: (%s)\n", errmsg);
}
}
@@ -565,6 +580,7 @@ cmd_tc_min_bw_parsed(void *parsed_result,
__rte_unused struct cmdline *cl, __rte_unused void *data)
{
struct cmd_vf_tc_bw_result *res = parsed_result;
+ char errmsg[RTE_STRERR_BUFSIZE];
struct rte_port *port;
uint8_t tc_num;
uint8_t bw[16];
@@ -599,7 +615,9 @@ cmd_tc_min_bw_parsed(void *parsed_result,
fprintf(stderr, "function not implemented\n");
break;
default:
- fprintf(stderr, "programming error: (%s)\n", strerror(-ret));
+ if (strerror_r(-ret, errmsg, sizeof(errmsg)) != 0)
+ snprintf(errmsg, sizeof(errmsg), "Unknown error %d", -ret);
+ fprintf(stderr, "programming error: (%s)\n", errmsg);
}
}