[PATCH v6 05/14] common/mlx5: use rte strerror
Dengdui Huang
huangdengdui at huawei.com
Thu Nov 14 12:39:51 CET 2024
The rte_errno may be an RTE-specific error code,
use rte_strerror() instead of strerror().
Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
---
drivers/common/mlx5/linux/mlx5_nl.c | 10 +++++-----
drivers/common/mlx5/mlx5_common.c | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c
index a5ac4dc543..5b18d7f8cc 100644
--- a/drivers/common/mlx5/linux/mlx5_nl.c
+++ b/drivers/common/mlx5/linux/mlx5_nl.c
@@ -548,7 +548,7 @@ mlx5_nl_mac_addr_list(int nlsk_fd, unsigned int iface_idx,
return 0;
error:
DRV_LOG(DEBUG, "Interface %u cannot retrieve MAC address list %s",
- iface_idx, strerror(rte_errno));
+ iface_idx, rte_strerror(rte_errno));
return -rte_errno;
}
@@ -618,7 +618,7 @@ mlx5_nl_mac_addr_modify(int nlsk_fd, unsigned int iface_idx,
DRV_LOG(DEBUG,
"Interface %u cannot %s MAC address %s %s",
iface_idx,
- add ? "add" : "remove", m, strerror(rte_errno));
+ add ? "add" : "remove", m, rte_strerror(rte_errno));
}
#endif
return -rte_errno;
@@ -705,7 +705,7 @@ mlx5_nl_vf_mac_addr_modify(int nlsk_fd, unsigned int iface_idx,
RTE_ETHER_ADDR_PRT_FMT " : %s",
vf_index,
RTE_ETHER_ADDR_BYTES(mac),
- strerror(rte_errno));
+ rte_strerror(rte_errno));
return -rte_errno;
}
@@ -930,7 +930,7 @@ mlx5_nl_promisc(int nlsk_fd, unsigned int iface_idx, int enable)
DRV_LOG(DEBUG,
"Interface %u cannot %s promisc mode: Netlink error %s",
iface_idx, enable ? "enable" : "disable",
- strerror(rte_errno));
+ rte_strerror(rte_errno));
return ret;
}
@@ -957,7 +957,7 @@ mlx5_nl_allmulti(int nlsk_fd, unsigned int iface_idx, int enable)
DRV_LOG(DEBUG,
"Interface %u cannot %s allmulti : Netlink error %s",
iface_idx, enable ? "enable" : "disable",
- strerror(rte_errno));
+ rte_strerror(rte_errno));
return ret;
}
diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index ca8543e36e..7aafd0083d 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -762,7 +762,7 @@ mlx5_common_dev_create(struct rte_device *eal_dev, uint32_t classes,
ret = mlx5_common_config_get(mkvlist, &cdev->config);
if (ret < 0) {
DRV_LOG(ERR, "Failed to process device arguments: %s",
- strerror(rte_errno));
+ rte_strerror(rte_errno));
rte_free(cdev);
return NULL;
}
@@ -837,7 +837,7 @@ mlx5_common_probe_again_args_validate(struct mlx5_common_device *cdev,
ret = mlx5_common_config_get(mkvlist, config);
if (ret) {
DRV_LOG(ERR, "Failed to process device configure: %s",
- strerror(rte_errno));
+ rte_strerror(rte_errno));
mlx5_free(config);
return ret;
}
@@ -1011,7 +1011,7 @@ mlx5_common_dev_probe(struct rte_device *eal_dev)
if (ret) {
DRV_LOG(ERR,
"Probe again parameters aren't compatible : %s",
- strerror(rte_errno));
+ rte_strerror(rte_errno));
goto class_err;
}
}
--
2.33.0
More information about the dev
mailing list