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 9604945C76; Mon, 4 Nov 2024 12:14:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BCA94279F; Mon, 4 Nov 2024 12:11:23 +0100 (CET) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 5582740E3A for ; Mon, 4 Nov 2024 12:10:46 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Xhpdc1mHCzQsgL; Mon, 4 Nov 2024 19:09:40 +0800 (CST) Received: from dggpeml500011.china.huawei.com (unknown [7.185.36.84]) by mail.maildlp.com (Postfix) with ESMTPS id 411F51400F4; Mon, 4 Nov 2024 19:10:45 +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_256_GCM_SHA384) id 15.1.2507.39; Mon, 4 Nov 2024 19:10:45 +0800 From: Dengdui Huang To: CC: , , , , , , , , , , Subject: [PATCH v5 40/52] net/mlx4: use rte strerror Date: Mon, 4 Nov 2024 19:10:25 +0800 Message-ID: <20241104111037.3632161-41-huangdengdui@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20241104111037.3632161-1-huangdengdui@huawei.com> References: <20231114082539.1858594-1-huangdengdui@huawei.com> <20241104111037.3632161-1-huangdengdui@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500011.china.huawei.com (7.185.36.84) 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 rte_errno may be an RTE-specific error code, use rte_strerror() instead of strerror(). Signed-off-by: Dengdui Huang Acked-by: Chengwen Feng Acked-by: Morten Brørup Acked-by: Huisong Li --- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 18 +++++++++--------- drivers/net/mlx4/mlx4_rxq.c | 4 ++-- drivers/net/mlx4/mlx4_txq.c | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index e8872e105c..c28392bd16 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -802,7 +802,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) err = mlx4_init_once(); if (err) { ERROR("unable to init PMD global data: %s", - strerror(rte_errno)); + rte_strerror(rte_errno)); return -rte_errno; } MLX4_ASSERT(pci_drv == &mlx4_driver); diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c index f11c6b4373..d52d2f5511 100644 --- a/drivers/net/mlx4/mlx4_ethdev.c +++ b/drivers/net/mlx4/mlx4_ethdev.c @@ -373,7 +373,7 @@ mlx4_rxmode_toggle(struct rte_eth_dev *dev, enum rxmode_toggle toggle) ERROR("cannot toggle %s mode (code %d, \"%s\")," " flow error type %d, cause %p, message: %s", - mode, rte_errno, strerror(rte_errno), error.type, error.cause, + mode, rte_errno, rte_strerror(rte_errno), error.type, error.cause, error.message ? error.message : "(unspecified)"); return ret; } @@ -462,7 +462,7 @@ mlx4_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) ERROR("failed to synchronize flow rules after removing MAC address" " at index %d (code %d, \"%s\")," " flow error type %d, cause %p, message: %s", - index, rte_errno, strerror(rte_errno), error.type, error.cause, + index, rte_errno, rte_strerror(rte_errno), error.type, error.cause, error.message ? error.message : "(unspecified)"); } @@ -501,7 +501,7 @@ mlx4_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, ERROR("failed to synchronize flow rules after adding MAC address" " at index %d (code %d, \"%s\")," " flow error type %d, cause %p, message: %s", - index, rte_errno, strerror(rte_errno), error.type, error.cause, + index, rte_errno, rte_strerror(rte_errno), error.type, error.cause, error.message ? error.message : "(unspecified)"); return ret; } @@ -558,7 +558,7 @@ mlx4_set_mc_addr_list(struct rte_eth_dev *dev, struct rte_ether_addr *list, return 0; ERROR("failed to synchronize flow rules after modifying MC list," " (code %d, \"%s\"), flow error type %d, cause %p, message: %s", - rte_errno, strerror(rte_errno), error.type, error.cause, + rte_errno, rte_strerror(rte_errno), error.type, error.cause, error.message ? error.message : "(unspecified)"); return ret; } @@ -600,7 +600,7 @@ mlx4_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) " (code %d, \"%s\"), " " flow error type %d, cause %p, message: %s", on ? "enabling" : "disabling", vlan_id, - rte_errno, strerror(rte_errno), error.type, error.cause, + rte_errno, rte_strerror(rte_errno), error.type, error.cause, error.message ? error.message : "(unspecified)"); return ret; } @@ -807,7 +807,7 @@ mlx4_link_update(struct rte_eth_dev *dev, int wait_to_complete) } (void)wait_to_complete; if (mlx4_ifreq(priv, SIOCGIFFLAGS, &ifr)) { - WARN("ioctl(SIOCGIFFLAGS) failed: %s", strerror(rte_errno)); + WARN("ioctl(SIOCGIFFLAGS) failed: %s", rte_strerror(rte_errno)); return -rte_errno; } memset(&dev_link, 0, sizeof(dev_link)); @@ -816,7 +816,7 @@ mlx4_link_update(struct rte_eth_dev *dev, int wait_to_complete) ifr.ifr_data = (void *)&edata; if (mlx4_ifreq(priv, SIOCETHTOOL, &ifr)) { WARN("ioctl(SIOCETHTOOL, ETHTOOL_GSET) failed: %s", - strerror(rte_errno)); + rte_strerror(rte_errno)); return -rte_errno; } link_speed = ethtool_cmd_speed(&edata); @@ -858,7 +858,7 @@ mlx4_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) ret = rte_errno; WARN("ioctl(SIOCETHTOOL, ETHTOOL_GPAUSEPARAM)" " failed: %s", - strerror(rte_errno)); + rte_strerror(rte_errno)); goto out; } fc_conf->autoneg = ethpause.autoneg; @@ -913,7 +913,7 @@ mlx4_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) ret = rte_errno; WARN("ioctl(SIOCETHTOOL, ETHTOOL_SPAUSEPARAM)" " failed: %s", - strerror(rte_errno)); + rte_strerror(rte_errno)); goto out; } ret = 0; diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c index d147bcad26..6716038e46 100644 --- a/drivers/net/mlx4/mlx4_rxq.c +++ b/drivers/net/mlx4/mlx4_rxq.c @@ -890,13 +890,13 @@ mlx4_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, rte_errno = ENOMEM; ERROR("%p: Rx interrupt completion channel creation" " failure: %s", - (void *)dev, strerror(rte_errno)); + (void *)dev, rte_strerror(rte_errno)); goto error; } if (mlx4_fd_set_non_blocking(rxq->channel->fd) < 0) { ERROR("%p: unable to make Rx interrupt completion" " channel non-blocking: %s", - (void *)dev, strerror(rte_errno)); + (void *)dev, rte_strerror(rte_errno)); goto error; } } diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c index 0db2e55bef..f08c152d5e 100644 --- a/drivers/net/mlx4/mlx4_txq.c +++ b/drivers/net/mlx4/mlx4_txq.c @@ -411,7 +411,7 @@ mlx4_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, if (!txq->cq) { rte_errno = ENOMEM; ERROR("%p: CQ creation failure: %s", - (void *)dev, strerror(rte_errno)); + (void *)dev, rte_strerror(rte_errno)); goto error; } qp_init_attr = (struct ibv_qp_init_attr){ @@ -431,7 +431,7 @@ mlx4_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, if (!txq->qp) { rte_errno = errno ? errno : EINVAL; ERROR("%p: QP creation failure: %s", - (void *)dev, strerror(rte_errno)); + (void *)dev, rte_strerror(rte_errno)); goto error; } txq->max_inline = qp_init_attr.cap.max_inline_data; @@ -445,7 +445,7 @@ mlx4_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, if (ret) { rte_errno = ret; ERROR("%p: QP state to IBV_QPS_INIT failed: %s", - (void *)dev, strerror(rte_errno)); + (void *)dev, rte_strerror(rte_errno)); goto error; } ret = mlx4_glue->modify_qp @@ -457,7 +457,7 @@ mlx4_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, if (ret) { rte_errno = ret; ERROR("%p: QP state to IBV_QPS_RTR failed: %s", - (void *)dev, strerror(rte_errno)); + (void *)dev, rte_strerror(rte_errno)); goto error; } ret = mlx4_glue->modify_qp @@ -469,7 +469,7 @@ mlx4_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, if (ret) { rte_errno = ret; ERROR("%p: QP state to IBV_QPS_RTS failed: %s", - (void *)dev, strerror(rte_errno)); + (void *)dev, rte_strerror(rte_errno)); goto error; } /* Retrieve device queue information. */ -- 2.33.0