[v5,42/52] net/mlx5: use rte strerror

Message ID 20241104111037.3632161-43-huangdengdui@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series replace strerror |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

huangdengdui Nov. 4, 2024, 11:10 a.m. UTC
The rte_errno may be an RTE-specific error code,
use rte_strerror() instead of strerror().

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/net/mlx5/hws/mlx5dr_matcher.c     |  2 +-
 drivers/net/mlx5/linux/mlx5_ethdev_os.c   | 22 +++++++++++-----------
 drivers/net/mlx5/linux/mlx5_os.c          | 16 ++++++++--------
 drivers/net/mlx5/mlx5.c                   |  8 ++++----
 drivers/net/mlx5/mlx5_mac.c               |  2 +-
 drivers/net/mlx5/mlx5_rxmode.c            |  8 ++++----
 drivers/net/mlx5/mlx5_stats.c             |  2 +-
 drivers/net/mlx5/mlx5_testpmd.c           | 10 +++++-----
 drivers/net/mlx5/mlx5_trigger.c           | 12 ++++++------
 drivers/net/mlx5/mlx5_vlan.c              |  2 +-
 drivers/net/mlx5/windows/mlx5_ethdev_os.c |  2 +-
 drivers/net/mlx5/windows/mlx5_os.c        | 10 +++++-----
 12 files changed, 48 insertions(+), 48 deletions(-)
  

Patch

diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c
index dfa2cd435c..063f6b871e 100644
--- a/drivers/net/mlx5/hws/mlx5dr_matcher.c
+++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c
@@ -1516,7 +1516,7 @@  mlx5dr_match_template_create(const struct rte_flow_item items[],
 	if (ret <= 0) {
 		DR_LOG(ERR, "Unable to process items (%s): %s",
 		       error.message ? error.message : "unspecified",
-		       strerror(rte_errno));
+		       rte_strerror(rte_errno));
 		goto free_template;
 	}
 
diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
index 5d64984022..c874303722 100644
--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c
@@ -314,7 +314,7 @@  mlx5_link_update_unlocked_gset(struct rte_eth_dev *dev,
 	ret = mlx5_ifreq(dev, SIOCGIFFLAGS, &ifr);
 	if (ret) {
 		DRV_LOG(WARNING, "port %u ioctl(SIOCGIFFLAGS) failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		return ret;
 	}
 	dev_link = (struct rte_eth_link) {
@@ -351,7 +351,7 @@  mlx5_link_update_unlocked_gset(struct rte_eth_dev *dev,
 			DRV_LOG(WARNING,
 				"port %u ioctl(SIOCETHTOOL,"
 				" ETHTOOL_GSET) failed: %s",
-				dev->data->port_id, strerror(rte_errno));
+				dev->data->port_id, rte_strerror(rte_errno));
 			return ret;
 		}
 	}
@@ -395,7 +395,7 @@  mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev,
 	ret = mlx5_ifreq(dev, SIOCGIFFLAGS, &ifr);
 	if (ret) {
 		DRV_LOG(WARNING, "port %u ioctl(SIOCGIFFLAGS) failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		return ret;
 	}
 	dev_link = (struct rte_eth_link) {
@@ -430,7 +430,7 @@  mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev,
 			DRV_LOG(DEBUG,
 				"port %u ioctl(SIOCETHTOOL,"
 				" ETHTOOL_GLINKSETTINGS) failed: %s",
-				dev->data->port_id, strerror(rte_errno));
+				dev->data->port_id, rte_strerror(rte_errno));
 			return ret;
 		}
 	}
@@ -448,7 +448,7 @@  mlx5_link_update_unlocked_gs(struct rte_eth_dev *dev,
 		DRV_LOG(DEBUG,
 			"port %u ioctl(SIOCETHTOOL,"
 			"ETHTOOL_GLINKSETTINGS) failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		return ret;
 	}
 
@@ -538,7 +538,7 @@  mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 		DRV_LOG(DEBUG,
 			"port %u ioctl(SIOCETHTOOL, ETHTOOL_GPAUSEPARAM) failed:"
 			" %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		return ret;
 	}
 	fc_conf->autoneg = ethpause.autoneg;
@@ -591,7 +591,7 @@  mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 		DRV_LOG(WARNING,
 			"port %u ioctl(SIOCETHTOOL, ETHTOOL_SPAUSEPARAM)"
 			" failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		return ret;
 	}
 	return 0;
@@ -666,7 +666,7 @@  mlx5_link_update_bond(struct rte_eth_dev *dev)
 	ret = mlx5_ifreq_by_ifname(bond->ifname, SIOCGIFFLAGS, &ifr);
 	if (ret) {
 		DRV_LOG(WARNING, "ifname %s ioctl(SIOCGIFFLAGS) failed: %s",
-			bond->ifname, strerror(rte_errno));
+			bond->ifname, rte_strerror(rte_errno));
 		return;
 	}
 	dev->data->dev_link.link_status =
@@ -1118,7 +1118,7 @@  mlx5_get_module_info(struct rte_eth_dev *dev,
 	ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
 	if (ret) {
 		DRV_LOG(WARNING, "port %u ioctl(SIOCETHTOOL) failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		return ret;
 	}
 	modinfo->type = info.type;
@@ -1167,7 +1167,7 @@  int mlx5_get_module_eeprom(struct rte_eth_dev *dev,
 	ret = mlx5_ifreq(dev, SIOCETHTOOL, &ifr);
 	if (ret)
 		DRV_LOG(WARNING, "port %u ioctl(SIOCETHTOOL) failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 	else
 		rte_memcpy(info->data, eeprom->data, info->length);
 	mlx5_free(eeprom);
@@ -1725,7 +1725,7 @@  mlx5_os_stats_init(struct rte_eth_dev *dev)
 	ret = mlx5_os_read_dev_counters(dev, bond_master, xstats_ctrl->base);
 	if (ret)
 		DRV_LOG(ERR, "port %u cannot read device counters: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 	mlx5_os_read_dev_stat(priv, "out_of_buffer", &stats_ctrl->imissed_base);
 	stats_ctrl->imissed = 0;
 free:
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 0ed5ba38a5..1a330dd0b7 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1274,7 +1274,7 @@  mlx5_dev_spawn(struct rte_device *dpdk_dev,
 			spawn->phys_port);
 		if (err < 0) {
 			DRV_LOG(INFO, "Failed to get netlink port state: %s",
-				strerror(rte_errno));
+				rte_strerror(rte_errno));
 			err = -rte_errno;
 			goto error;
 		}
@@ -1434,7 +1434,7 @@  mlx5_dev_spawn(struct rte_device *dpdk_dev,
 		if (err) {
 			err = rte_errno;
 			DRV_LOG(ERR, "unable to allocate switch domain: %s",
-				strerror(rte_errno));
+				rte_strerror(rte_errno));
 			goto error;
 		}
 		own_domain_id = 1;
@@ -1525,7 +1525,7 @@  mlx5_dev_spawn(struct rte_device *dpdk_dev,
 	if (err) {
 		err = rte_errno;
 		DRV_LOG(ERR, "Failed to process port configure: %s",
-			strerror(rte_errno));
+			rte_strerror(rte_errno));
 		goto error;
 	}
 	eth_dev = rte_eth_dev_allocate(name);
@@ -1571,7 +1571,7 @@  mlx5_dev_spawn(struct rte_device *dpdk_dev,
 		DRV_LOG(ERR,
 			"port %u cannot get MAC address, is mlx5_en"
 			" loaded? (errno: %s)",
-			eth_dev->data->port_id, strerror(rte_errno));
+			eth_dev->data->port_id, rte_strerror(rte_errno));
 		err = ENODEV;
 		goto error;
 	}
@@ -2037,7 +2037,7 @@  mlx5_device_bond_pci_match(const char *ibdev_name,
 					   bond_info->ifname);
 		if (ret)
 			DRV_LOG(ERR, "unable to get bond info: %s",
-				strerror(rte_errno));
+				rte_strerror(rte_errno));
 		else
 			DRV_LOG(INFO, "PF device %u, bond device %u(%s)",
 				ifindex, bond_info->ifindex, bond_info->ifname);
@@ -2751,7 +2751,7 @@  mlx5_os_pci_probe_pf(struct mlx5_common_device *cdev,
 			" encountering an error: %s",
 			owner_pci.domain, owner_pci.bus,
 			owner_pci.devid, owner_pci.function,
-			strerror(rte_errno));
+			rte_strerror(rte_errno));
 		ret = -rte_errno;
 		/* Roll back. */
 		while (i--) {
@@ -2931,13 +2931,13 @@  mlx5_os_net_probe(struct mlx5_common_device *cdev,
 	ret = mlx5_init_once();
 	if (ret) {
 		DRV_LOG(ERR, "Unable to init PMD global data: %s",
-			strerror(rte_errno));
+			rte_strerror(rte_errno));
 		return -rte_errno;
 	}
 	ret = mlx5_probe_again_args_validate(cdev, mkvlist);
 	if (ret) {
 		DRV_LOG(ERR, "Probe again parameters are not compatible : %s",
-			strerror(rte_errno));
+			rte_strerror(rte_errno));
 		return -rte_errno;
 	}
 	if (mlx5_dev_is_pci(cdev->dev))
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 52b90e6ff3..a44f86d70f 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1506,7 +1506,7 @@  mlx5_shared_dev_ctx_args_config(struct mlx5_dev_ctx_shared *sh,
 					  mlx5_dev_args_check_handler, config);
 		if (ret) {
 			DRV_LOG(ERR, "Failed to process device arguments: %s",
-				strerror(rte_errno));
+				rte_strerror(rte_errno));
 			return -rte_errno;
 		}
 	}
@@ -1835,7 +1835,7 @@  mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn,
 	err = mlx5_shared_dev_ctx_args_config(sh, mkvlist, &sh->config);
 	if (err) {
 		DRV_LOG(ERR, "Failed to process device configure: %s",
-			strerror(rte_errno));
+			rte_strerror(rte_errno));
 		goto error;
 	}
 	sh->refcnt = 1;
@@ -2837,7 +2837,7 @@  mlx5_port_args_config(struct mlx5_priv *priv, struct mlx5_kvargs_ctrl *mkvlist,
 					  mlx5_port_args_check_handler, config);
 		if (ret) {
 			DRV_LOG(ERR, "Failed to process port arguments: %s",
-				strerror(rte_errno));
+				rte_strerror(rte_errno));
 			return -rte_errno;
 		}
 	}
@@ -3068,7 +3068,7 @@  mlx5_probe_again_args_validate(struct mlx5_common_device *cdev,
 	ret = mlx5_shared_dev_ctx_args_config(sh, 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;
 	}
diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c
index 22a756a52b..f73b7bc394 100644
--- a/drivers/net/mlx5/mlx5_mac.c
+++ b/drivers/net/mlx5/mlx5_mac.c
@@ -100,7 +100,7 @@  mlx5_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
 		ret = mlx5_traffic_restart(dev);
 		if (ret)
 			DRV_LOG(ERR, "port %u cannot restart traffic: %s",
-				dev->data->port_id, strerror(rte_errno));
+				dev->data->port_id, rte_strerror(rte_errno));
 	}
 }
 
diff --git a/drivers/net/mlx5/mlx5_rxmode.c b/drivers/net/mlx5/mlx5_rxmode.c
index f44906e1a7..fae684defb 100644
--- a/drivers/net/mlx5/mlx5_rxmode.c
+++ b/drivers/net/mlx5/mlx5_rxmode.c
@@ -44,7 +44,7 @@  mlx5_promiscuous_enable(struct rte_eth_dev *dev)
 	ret = mlx5_traffic_restart(dev);
 	if (ret)
 		DRV_LOG(ERR, "port %u cannot enable promiscuous mode: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 
 	/*
 	 * rte_eth_dev_promiscuous_enable() rollback
@@ -77,7 +77,7 @@  mlx5_promiscuous_disable(struct rte_eth_dev *dev)
 	ret = mlx5_traffic_restart(dev);
 	if (ret)
 		DRV_LOG(ERR, "port %u cannot disable promiscuous mode: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 
 	/*
 	 * rte_eth_dev_promiscuous_disable() rollback
@@ -117,7 +117,7 @@  mlx5_allmulticast_enable(struct rte_eth_dev *dev)
 	ret = mlx5_traffic_restart(dev);
 	if (ret)
 		DRV_LOG(ERR, "port %u cannot enable allmulicast mode: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 error:
 	/*
 	 * rte_eth_allmulticast_enable() rollback
@@ -150,7 +150,7 @@  mlx5_allmulticast_disable(struct rte_eth_dev *dev)
 	ret = mlx5_traffic_restart(dev);
 	if (ret)
 		DRV_LOG(ERR, "port %u cannot disable allmulicast mode: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 error:
 	/*
 	 * rte_eth_allmulticast_disable() rollback
diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
index 83338dc279..ba7789287c 100644
--- a/drivers/net/mlx5/mlx5_stats.c
+++ b/drivers/net/mlx5/mlx5_stats.c
@@ -268,7 +268,7 @@  mlx5_xstats_reset(struct rte_eth_dev *dev)
 	ret = mlx5_os_read_dev_counters(dev, bond_master, counters);
 	if (ret) {
 		DRV_LOG(ERR, "port %u cannot read device counters: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		mlx5_free(counters);
 		return ret;
 	}
diff --git a/drivers/net/mlx5/mlx5_testpmd.c b/drivers/net/mlx5/mlx5_testpmd.c
index 02fbd59582..032382a564 100644
--- a/drivers/net/mlx5/mlx5_testpmd.c
+++ b/drivers/net/mlx5/mlx5_testpmd.c
@@ -1128,7 +1128,7 @@  mlx5_cmd_apply_tlv_options_parsed(void *parsed_result,
 	if (handle == NULL) {
 		fprintf(stderr,
 			"Fail to create GENEVE TLV parser, nb_option=%u: %s\n",
-			tlv_mng.nb_options, strerror(rte_errno));
+			tlv_mng.nb_options, rte_strerror(rte_errno));
 		return;
 	}
 
@@ -1281,10 +1281,10 @@  mlx5_cmd_dump_sq_context_options_parsed(void *parsed_result,
 		fprintf(stderr, "invalid port_id %u\n", res->port_id);
 		break;
 	case -EIO:
-		fprintf(stderr, "File Access Error (%s)\n", strerror(rte_errno));
+		fprintf(stderr, "File Access Error (%s)\n", rte_strerror(rte_errno));
 		break;
 	default:
-		fprintf(stderr, "Unable to dump SQ/CQ HW Context (%s)\n", strerror(rte_errno));
+		fprintf(stderr, "Unable to dump SQ/CQ HW Context (%s)\n", rte_strerror(rte_errno));
 	}
 }
 
@@ -1363,10 +1363,10 @@  mlx5_cmd_dump_rq_context_options_parsed(void *parsed_result,
 		fprintf(stderr, "invalid port_id %u\n", res->port_id);
 		break;
 	case -EIO:
-		fprintf(stderr, "File Access Error (%s)\n", strerror(rte_errno));
+		fprintf(stderr, "File Access Error (%s)\n", rte_strerror(rte_errno));
 		break;
 	default:
-		fprintf(stderr, "Unable to dump RQ/CQ HW Context (%s)\n", strerror(rte_errno));
+		fprintf(stderr, "Unable to dump RQ/CQ HW Context (%s)\n", rte_strerror(rte_errno));
 	}
 }
 
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index bf836c92fc..8ac91e6c71 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -1201,14 +1201,14 @@  mlx5_dev_start(struct rte_eth_dev *dev)
 		ret = mlx5_dev_configure_rss_reta(dev);
 		if (ret) {
 			DRV_LOG(ERR, "port %u reta config failed: %s",
-				dev->data->port_id, strerror(rte_errno));
+				dev->data->port_id, rte_strerror(rte_errno));
 			return -rte_errno;
 		}
 	}
 	ret = mlx5_txpp_start(dev);
 	if (ret) {
 		DRV_LOG(ERR, "port %u Tx packet pacing init failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		goto error;
 	}
 	if (mlx5_devx_obj_ops_en(priv->sh) &&
@@ -1220,7 +1220,7 @@  mlx5_dev_start(struct rte_eth_dev *dev)
 	ret = mlx5_txq_start(dev);
 	if (ret) {
 		DRV_LOG(ERR, "port %u Tx queue allocation failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		goto error;
 	}
 	if (priv->config.std_delay_drop || priv->config.hp_delay_drop) {
@@ -1244,7 +1244,7 @@  mlx5_dev_start(struct rte_eth_dev *dev)
 	ret = mlx5_rxq_start(dev);
 	if (ret) {
 		DRV_LOG(ERR, "port %u Rx queue allocation failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		goto error;
 	}
 	/*
@@ -1254,7 +1254,7 @@  mlx5_dev_start(struct rte_eth_dev *dev)
 	ret = mlx5_hairpin_auto_bind(dev);
 	if (ret) {
 		DRV_LOG(ERR, "port %u hairpin auto binding failed: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		goto error;
 	}
 	/* Set started flag here for the following steps like control flow. */
@@ -1307,7 +1307,7 @@  mlx5_dev_start(struct rte_eth_dev *dev)
 	ret = mlx5_flow_start_default(dev);
 	if (ret) {
 		DRV_LOG(DEBUG, "port %u failed to start default actions: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		goto error;
 	}
 	if (mlx5_dev_ctx_shared_mempool_subscribe(dev) != 0) {
diff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c
index e7161b66fe..e2914844c6 100644
--- a/drivers/net/mlx5/mlx5_vlan.c
+++ b/drivers/net/mlx5/mlx5_vlan.c
@@ -118,7 +118,7 @@  mlx5_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on)
 	ret = priv->obj_ops.rxq_obj_modify_vlan_strip(rxq, on);
 	if (ret) {
 		DRV_LOG(ERR, "Port %u failed to modify object stripping mode:"
-			" %s", dev->data->port_id, strerror(rte_errno));
+			" %s", dev->data->port_id, rte_strerror(rte_errno));
 		return;
 	}
 	/* Update related bits in RX queue. */
diff --git a/drivers/net/mlx5/windows/mlx5_ethdev_os.c b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
index 49f750be68..cd0a02d76b 100644
--- a/drivers/net/mlx5/windows/mlx5_ethdev_os.c
+++ b/drivers/net/mlx5/windows/mlx5_ethdev_os.c
@@ -221,7 +221,7 @@  mlx5_os_stats_init(struct rte_eth_dev *dev)
 	ret = mlx5_os_read_dev_stat(priv, "out_of_buffer", &stats_ctrl->imissed_base);
 	if (ret)
 		DRV_LOG(ERR, "port %u cannot read device counters: %s",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 	stats_ctrl->imissed = 0;
 }
 
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 8032616268..24c24cf7a3 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -432,7 +432,7 @@  mlx5_dev_spawn(struct rte_device *dpdk_dev,
 		if (err) {
 			err = rte_errno;
 			DRV_LOG(ERR, "unable to allocate switch domain: %s",
-				strerror(rte_errno));
+				rte_strerror(rte_errno));
 			goto error;
 		}
 		own_domain_id = 1;
@@ -442,7 +442,7 @@  mlx5_dev_spawn(struct rte_device *dpdk_dev,
 	if (err) {
 		err = rte_errno;
 		DRV_LOG(ERR, "Failed to process port configure: %s",
-			strerror(rte_errno));
+			rte_strerror(rte_errno));
 		goto error;
 	}
 	eth_dev = rte_eth_dev_allocate(name);
@@ -485,7 +485,7 @@  mlx5_dev_spawn(struct rte_device *dpdk_dev,
 		DRV_LOG(ERR,
 			"port %u cannot get MAC address, is mlx5_en"
 			" loaded? (errno: %s).",
-			eth_dev->data->port_id, strerror(rte_errno));
+			eth_dev->data->port_id, rte_strerror(rte_errno));
 		err = ENODEV;
 		goto error;
 	}
@@ -739,7 +739,7 @@  mlx5_os_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac,
 		DRV_LOG(ERR,
 			"port %u cannot get MAC address, is mlx5_en"
 			" loaded? (errno: %s)",
-			dev->data->port_id, strerror(rte_errno));
+			dev->data->port_id, rte_strerror(rte_errno));
 		return rte_errno;
 	}
 	if (!rte_is_same_ether_addr(&lmac, mac)) {
@@ -858,7 +858,7 @@  mlx5_os_net_probe(struct mlx5_common_device *cdev,
 	ret = mlx5_init_once();
 	if (ret) {
 		DRV_LOG(ERR, "unable to init PMD global data: %s",
-			strerror(rte_errno));
+			rte_strerror(rte_errno));
 		return -rte_errno;
 	}
 	spawn.eth_dev = mlx5_dev_spawn(cdev->dev, &spawn, mkvlist);