From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2855D4332B; Tue, 14 Nov 2023 12:27:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18940427E5; Tue, 14 Nov 2023 12:24:56 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 96F8F4067C for ; Tue, 14 Nov 2023 12:24:14 +0100 (CET) Received: from dggpeml500011.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SV3kt1BhLzmV69; Tue, 14 Nov 2023 19:20:54 +0800 (CST) Received: from localhost.huawei.com (10.50.165.33) by dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 14 Nov 2023 19:24:13 +0800 From: Dengdui Huang To: CC: , , , , Subject: [PATCH v2 34/43] net/mlx5: use rte strerror Date: Tue, 14 Nov 2023 19:23:58 +0800 Message-ID: <20231114112407.3496460-35-huangdengdui@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20231114112407.3496460-1-huangdengdui@huawei.com> References: <20231114082539.1858594-44-huangdengdui@huawei.com> <20231114112407.3496460-1-huangdengdui@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500011.china.huawei.com (7.185.36.84) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The function strerror() is insecure in a multi-thread environment. This patch uses rte_strerror() to replace it. Cc: stable@dpdk.org Signed-off-by: Dengdui Huang Acked-by: Chengwen Feng --- drivers/net/mlx5/hws/mlx5dr_matcher.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 20 ++++++++++---------- drivers/net/mlx5/linux/mlx5_os.c | 18 +++++++++--------- drivers/net/mlx5/linux/mlx5_socket.c | 16 ++++++++-------- drivers/net/mlx5/linux/mlx5_verbs.c | 8 ++++---- drivers/net/mlx5/mlx5.c | 8 ++++---- drivers/net/mlx5/mlx5_devx.c | 4 ++-- drivers/net/mlx5/mlx5_mac.c | 2 +- drivers/net/mlx5/mlx5_rxmode.c | 8 ++++---- drivers/net/mlx5/mlx5_rxq.c | 4 ++-- drivers/net/mlx5/mlx5_rxtx.c | 2 +- drivers/net/mlx5/mlx5_stats.c | 4 ++-- drivers/net/mlx5/mlx5_testpmd.c | 14 +++++++------- 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 | 12 ++++++------ 17 files changed, 69 insertions(+), 69 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c index 4ea161eae6..e5247c1295 100644 --- a/drivers/net/mlx5/hws/mlx5dr_matcher.c +++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c @@ -1421,7 +1421,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 dd5a0c546d..f2364ff44e 100644 --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -398,7 +398,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) { @@ -435,7 +435,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; } } @@ -490,7 +490,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) { @@ -525,7 +525,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; } } @@ -543,7 +543,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; } dev_link.link_speed = (ecmd->speed == UINT32_MAX) ? @@ -674,7 +674,7 @@ mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) DRV_LOG(WARNING, "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; @@ -727,7 +727,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; @@ -1209,7 +1209,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; @@ -1258,7 +1258,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); @@ -1662,7 +1662,7 @@ mlx5_os_stats_init(struct rte_eth_dev *dev) ret = mlx5_os_read_dev_counters(dev, 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 07f31de5ae..108de96cf7 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1176,7 +1176,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, err = mlx5_glue->query_port(sh->cdev->ctx, spawn->phys_port, &port_attr); if (err) { - DRV_LOG(ERR, "port query failed: %s", strerror(err)); + DRV_LOG(ERR, "port query failed: %s", rte_strerror(err)); goto error; } if (port_attr.link_layer != IBV_LINK_LAYER_ETHERNET) { @@ -1191,7 +1191,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; } @@ -1342,7 +1342,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; @@ -1433,7 +1433,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); @@ -1479,7 +1479,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; } @@ -1973,7 +1973,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); @@ -2688,7 +2688,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--) { @@ -2868,13 +2868,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/linux/mlx5_socket.c b/drivers/net/mlx5/linux/mlx5_socket.c index 6ce0e59643..cfcbd5a099 100644 --- a/drivers/net/mlx5/linux/mlx5_socket.c +++ b/drivers/net/mlx5/linux/mlx5_socket.c @@ -61,13 +61,13 @@ mlx5_pmd_socket_handle(void *cb __rte_unused) /* Accept the connection from the client. */ conn_sock = accept(server_socket, NULL, NULL); if (conn_sock < 0) { - DRV_LOG(WARNING, "connection failed: %s", strerror(errno)); + DRV_LOG(WARNING, "connection failed: %s", rte_strerror(errno)); return; } ret = recvmsg(conn_sock, &msg, MSG_WAITALL); if (ret != sizeof(struct mlx5_flow_dump_req)) { DRV_LOG(WARNING, "wrong message received: %s", - strerror(errno)); + rte_strerror(errno)); goto error; } @@ -138,7 +138,7 @@ mlx5_pmd_socket_handle(void *cb __rte_unused) } while (ret < 0 && errno == EINTR); if (ret < 0) DRV_LOG(WARNING, "failed to send response %s", - strerror(errno)); + rte_strerror(errno)); error: if (conn_sock >= 0) close(conn_sock); @@ -167,7 +167,7 @@ mlx5_pmd_socket_init(void) ret = socket(AF_UNIX, SOCK_STREAM, 0); if (ret < 0) { DRV_LOG(WARNING, "Failed to open mlx5 socket: %s", - strerror(errno)); + rte_strerror(errno)); goto error; } server_socket = ret; @@ -183,13 +183,13 @@ mlx5_pmd_socket_init(void) ret = bind(server_socket, (const struct sockaddr *)&sun, sizeof(sun)); if (ret < 0) { DRV_LOG(WARNING, - "cannot bind mlx5 socket: %s", strerror(errno)); + "cannot bind mlx5 socket: %s", rte_strerror(errno)); goto remove; } ret = listen(server_socket, 0); if (ret < 0) { DRV_LOG(WARNING, "cannot listen on mlx5 socket: %s", - strerror(errno)); + rte_strerror(errno)); goto remove; } server_intr_handle = mlx5_os_interrupt_handler_create @@ -197,7 +197,7 @@ mlx5_pmd_socket_init(void) server_socket, mlx5_pmd_socket_handle, NULL); if (server_intr_handle == NULL) { DRV_LOG(WARNING, "cannot register interrupt handler for mlx5 socket: %s", - strerror(errno)); + rte_strerror(errno)); goto remove; } return 0; @@ -207,7 +207,7 @@ mlx5_pmd_socket_init(void) claim_zero(close(server_socket)); server_socket = -1; error: - DRV_LOG(ERR, "Cannot initialize socket: %s", strerror(errno)); + DRV_LOG(ERR, "Cannot initialize socket: %s", rte_strerror(errno)); return -errno; } diff --git a/drivers/net/mlx5/linux/mlx5_verbs.c b/drivers/net/mlx5/linux/mlx5_verbs.c index b54f3ccd9a..9d41f6fbdf 100644 --- a/drivers/net/mlx5/linux/mlx5_verbs.c +++ b/drivers/net/mlx5/linux/mlx5_verbs.c @@ -100,7 +100,7 @@ mlx5_ibv_modify_qp(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type, ret = mlx5_glue->modify_qp(obj->qp, &mod, IBV_QP_STATE); if (ret) { DRV_LOG(ERR, "Cannot change Tx QP state to RESET %s", - strerror(errno)); + rte_strerror(errno)); rte_errno = errno; return ret; } @@ -111,7 +111,7 @@ mlx5_ibv_modify_qp(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type, ret = mlx5_glue->modify_qp(obj->qp, &mod, IBV_QP_STATE | IBV_QP_PORT); if (ret) { DRV_LOG(ERR, "Cannot change Tx QP state to INIT %s", - strerror(errno)); + rte_strerror(errno)); rte_errno = errno; return ret; } @@ -119,7 +119,7 @@ mlx5_ibv_modify_qp(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type, ret = mlx5_glue->modify_qp(obj->qp, &mod, IBV_QP_STATE); if (ret) { DRV_LOG(ERR, "Cannot change Tx QP state to RTR %s", - strerror(errno)); + rte_strerror(errno)); rte_errno = errno; return ret; } @@ -127,7 +127,7 @@ mlx5_ibv_modify_qp(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type, ret = mlx5_glue->modify_qp(obj->qp, &mod, IBV_QP_STATE); if (ret) { DRV_LOG(ERR, "Cannot change Tx QP state to RTS %s", - strerror(errno)); + rte_strerror(errno)); rte_errno = errno; return ret; } diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 2cf21a1921..7f95c0db85 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1504,7 +1504,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; } } @@ -1756,7 +1756,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; @@ -2716,7 +2716,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; } } @@ -2947,7 +2947,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_devx.c b/drivers/net/mlx5/mlx5_devx.c index 9fa400fc48..95bed87103 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -134,7 +134,7 @@ mlx5_txq_devx_modify(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type, ret = mlx5_devx_cmd_modify_sq(obj->sq_obj.sq, &msq_attr); if (ret) { DRV_LOG(ERR, "Cannot change the Tx SQ state to RESET" - " %s", strerror(errno)); + " %s", rte_strerror(errno)); rte_errno = errno; return ret; } @@ -146,7 +146,7 @@ mlx5_txq_devx_modify(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type, ret = mlx5_devx_cmd_modify_sq(obj->sq_obj.sq, &msq_attr); if (ret) { DRV_LOG(ERR, "Cannot change the Tx SQ state to READY" - " %s", strerror(errno)); + " %s", rte_strerror(errno)); rte_errno = errno; 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_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 88b2dc54b3..341714965b 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -488,7 +488,7 @@ mlx5_rx_queue_stop_primary(struct rte_eth_dev *dev, uint16_t idx) ret = priv->obj_ops.rxq_obj_modify(rxq, MLX5_RXQ_MOD_RDY2RST); if (ret) { DRV_LOG(ERR, "Cannot change Rx WQ state to RESET: %s", - strerror(errno)); + rte_strerror(errno)); rte_errno = errno; return ret; } @@ -587,7 +587,7 @@ mlx5_rx_queue_start_primary(struct rte_eth_dev *dev, uint16_t idx) ret = priv->obj_ops.rxq_obj_modify(rxq, MLX5_RXQ_MOD_RST2RDY); if (ret) { DRV_LOG(ERR, "Cannot change Rx WQ state to READY: %s", - strerror(errno)); + rte_strerror(errno)); rte_errno = errno; return ret; } diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 54d410b513..59e49aa5af 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -378,7 +378,7 @@ mlx5_queue_state_modify_primary(struct rte_eth_dev *dev, ret = priv->obj_ops.rxq_obj_modify(rxq, sm->state); if (ret) { DRV_LOG(ERR, "Cannot change Rx WQ state to %u - %s", - sm->state, strerror(errno)); + sm->state, rte_strerror(errno)); rte_errno = errno; return ret; } diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c index 615e1d073d..d2a8b8e852 100644 --- a/drivers/net/mlx5/mlx5_stats.c +++ b/drivers/net/mlx5/mlx5_stats.c @@ -233,7 +233,7 @@ mlx5_xstats_reset(struct rte_eth_dev *dev) stats_n = mlx5_os_get_stats_n(dev); if (stats_n < 0) { DRV_LOG(ERR, "port %u cannot get stats: %s", dev->data->port_id, - strerror(-stats_n)); + rte_strerror(-stats_n)); return stats_n; } if (xstats_ctrl->stats_n != stats_n) @@ -251,7 +251,7 @@ mlx5_xstats_reset(struct rte_eth_dev *dev) ret = mlx5_os_read_dev_counters(dev, 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 403f3a8f83..70d4d0039f 100644 --- a/drivers/net/mlx5/mlx5_testpmd.c +++ b/drivers/net/mlx5/mlx5_testpmd.c @@ -199,13 +199,13 @@ mlx5_test_extend_devargs(char *identifier, char *extend) socket_fd = socket(AF_UNIX, SOCK_SEQPACKET, 0); if (socket_fd < 0) { TESTPMD_LOG(ERR, "Failed to create unix socket: %s\n", - strerror(errno)); + rte_strerror(errno)); return -1; } rte_strlcpy(un.sun_path, path, sizeof(un.sun_path)); if (connect(socket_fd, (struct sockaddr *)&un, sizeof(un)) < 0) { TESTPMD_LOG(ERR, "Failed to connect %s: %s\n", un.sun_path, - strerror(errno)); + rte_strerror(errno)); close(socket_fd); return -1; } @@ -216,7 +216,7 @@ mlx5_test_extend_devargs(char *identifier, char *extend) } while (ret < 0 && errno == EINTR); if (ret < 0) { TESTPMD_LOG(ERR, "Failed to send request to (%s): %s\n", path, - strerror(errno)); + rte_strerror(errno)); close(socket_fd); return -1; } @@ -333,7 +333,7 @@ static void cmd_port_host_shaper_parsed(void *parsed_result, ret = mlx5_test_set_port_host_shaper(res->port_num, res->fr, res->rate_num); if (ret < 0) - printf("cmd_port_host_shaper error: (%s)\n", strerror(-ret)); + printf("cmd_port_host_shaper error: (%s)\n", rte_strerror(-ret)); } static cmdline_parse_token_string_t cmd_port_host_shaper_mlx5 = @@ -492,7 +492,7 @@ mlx5_cmd_map_ext_rxq_parsed(void *parsed_result, res->sw_queue_id); break; default: - fprintf(stderr, "programming error: (%s)\n", strerror(-ret)); + fprintf(stderr, "programming error: (%s)\n", rte_strerror(-ret)); } } @@ -565,7 +565,7 @@ mlx5_cmd_unmap_ext_rxq_parsed(void *parsed_result, fprintf(stderr, "function not implemented or supported\n"); break; default: - fprintf(stderr, "programming error: (%s)\n", strerror(-ret)); + fprintf(stderr, "programming error: (%s)\n", rte_strerror(-ret)); } } @@ -648,7 +648,7 @@ mlx5_cmd_set_flow_engine_mode_parsed(void *parsed_result, if (ret < 0) fprintf(stderr, "Fail to set flow_engine to %s mode with flag 0x%x, error %s\n", mode == RTE_PMD_MLX5_FLOW_ENGINE_MODE_ACTIVE ? "active" : "standby", flag, - strerror(-ret)); + rte_strerror(-ret)); else TESTPMD_LOG(DEBUG, "Set %d ports flow_engine to %s mode with flag 0x%x\n", ret, mode == RTE_PMD_MLX5_FLOW_ENGINE_MODE_ACTIVE ? "active" : "standby", flag); diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index 7bdb897612..eecd39d8a7 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -1190,14 +1190,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) && @@ -1209,7 +1209,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) { @@ -1233,7 +1233,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; } /* @@ -1243,7 +1243,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. */ @@ -1296,7 +1296,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 a31e1b5494..9e31ad9be7 100644 --- a/drivers/net/mlx5/windows/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/windows/mlx5_ethdev_os.c @@ -212,7 +212,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 b731bdff06..9afc240b46 100644 --- a/drivers/net/mlx5/windows/mlx5_os.c +++ b/drivers/net/mlx5/windows/mlx5_os.c @@ -379,7 +379,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, err = mlx5_glue->devx_init_showdown_event(sh->cdev->ctx); if (err) { DRV_LOG(ERR, "failed to init showdown event: %s", - strerror(errno)); + rte_strerror(errno)); goto error; } /* Allocate private eth device data. */ @@ -427,7 +427,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; @@ -437,7 +437,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); @@ -480,7 +480,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; } @@ -730,7 +730,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)) { @@ -849,7 +849,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); -- 2.33.0