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 155DB45D04; Thu, 14 Nov 2024 12:40:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1095402D0; Thu, 14 Nov 2024 12:40:07 +0100 (CET) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id B56A640272 for ; Thu, 14 Nov 2024 12:40:03 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4XpyrG1kqQz1yqVF; Thu, 14 Nov 2024 19:40:14 +0800 (CST) Received: from dggpeml500011.china.huawei.com (unknown [7.185.36.84]) by mail.maildlp.com (Postfix) with ESMTPS id 7F6551A0188; Thu, 14 Nov 2024 19:40:02 +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; Thu, 14 Nov 2024 19:40:02 +0800 From: Dengdui Huang To: CC: , , , , , , , , , , Subject: [PATCH v6 10/14] net/mlx4: use rte strerror Date: Thu, 14 Nov 2024 19:39:56 +0800 Message-ID: <20241114114000.1677350-11-huangdengdui@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20241114114000.1677350-1-huangdengdui@huawei.com> References: <20231114082539.1858594-1-huangdengdui@huawei.com> <20241114114000.1677350-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: dggems701-chm.china.huawei.com (10.3.19.178) 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 --- 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 9c2872429f..d4e3e4997d 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -793,7 +793,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 781ee256df..cb8c6fa649 100644 --- a/drivers/net/mlx4/mlx4_rxq.c +++ b/drivers/net/mlx4/mlx4_rxq.c @@ -882,13 +882,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