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 3277C45C76; Mon, 4 Nov 2024 12:10:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC31240E32; Mon, 4 Nov 2024 12:10:43 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 2DA5740659 for ; Mon, 4 Nov 2024 12:10:39 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Xhpcj5PvwzyTgP; Mon, 4 Nov 2024 19:08:53 +0800 (CST) Received: from dggpeml500011.china.huawei.com (unknown [7.185.36.84]) by mail.maildlp.com (Postfix) with ESMTPS id 4EB99180105; Mon, 4 Nov 2024 19:10:38 +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:38 +0800 From: Dengdui Huang To: CC: , , , , , , , , , , Subject: [PATCH v5 00/52] replace strerror Date: Mon, 4 Nov 2024 19:09:45 +0800 Message-ID: <20241104111037.3632161-1-huangdengdui@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20231114082539.1858594-1-huangdengdui@huawei.com> References: <20231114082539.1858594-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 function strerror() is insecure in a multi-thread environment. It is better to use strerror_r() instead of strerror(). In addition, rte_errno should obtain the error description through rte_strerror() instead of strerror(). In this patchset, only the libs and drivers are modified. v4->v5 strerror_r(errno) replace strerror(errno), and rte_strerror replace strerror(rte_errno). v3->v4 fix ci error v2->v3 drop patch "telemetry: replace strerror" due to compile fail v1-v2 fix ci error Dengdui Huang (52): eal: fix use rte errno for libc function devtools: forbid use of strerror eal: replace strerror with reentrant version eventdev: replace strerror with reentrant version latency: replace strerror with reentrant version node: replace strerror with reentrant version pdump: replace strerror with reentrant version pdump: use rte strerror power: replace strerror with reentrant version vhost: replace strerror with reentrant version bpf: replace strerror with reentrant version bus/cdx: replace strerror with reentrant version bus/dpaa: replace strerror with reentrant version bus/fslmc: replace strerror with reentrant version bus/pci: replace strerror with reentrant version bus/vmbus: replace strerror with reentrant version bus/vdev: use rte strerror common/cnxk: replace strerror with reentrant version common/mlx5: replace strerror with reentrant version common/mlx5: use rte strerror crypto/caam_jr: replace strerror with reentrant version dma/idxd: replace strerror with reentrant version net/bnxt: replace strerror with reentrant version net/af_xdp: replace strerror with reentrant version net/af_xdp: use rte strerror net/bonding: replace strerror with reentrant version net/bonding: use rte strerror net/cnxk: replace strerror with reentrant version net/dpaa: replace strerror with reentrant version net/dpaa2: replace strerror with reentrant version net/enetfec: replace strerror with reentrant version net/failsafe: replace strerror with reentrant version net/failsafe: use rte strerror net/i40e: replace strerror with reentrant version net/ice: replace strerror with reentrant version net/ixgbe: replace strerror with reentrant version net/memif: replace strerror with reentrant version net/memif: use rte strerror net/mlx4: replace strerror with reentrant version net/mlx4: use rte strerror net/mlx5: replace strerror with reentrant version net/mlx5: use rte strerror net/qede: replace strerror with reentrant version net/sfc: replace strerror with reentrant version net/tap: replace strerror with reentrant version net/tap: use rte strerror net/vhost: replace strerror with reentrant version net/virtio: replace strerror with reentrant version raw/ifpga: replace strerror with reentrant version vdpa/ifc: replace strerror with reentrant version vdpa/mlx5: replace strerror with reentrant version vdpa/sfc: replace strerror with reentrant version devtools/checkpatches.sh | 8 + drivers/bus/cdx/cdx.c | 6 +- drivers/bus/cdx/cdx_vfio.c | 58 +- drivers/bus/dpaa/base/fman/fman.c | 8 +- drivers/bus/dpaa/dpaa_bus.c | 5 +- drivers/bus/fslmc/fslmc_vfio.c | 28 +- drivers/bus/pci/bsd/pci.c | 20 +- drivers/bus/pci/linux/pci.c | 16 +- drivers/bus/pci/linux/pci_uio.c | 50 +- drivers/bus/pci/linux/pci_vfio.c | 52 +- drivers/bus/pci/pci_common_uio.c | 6 +- drivers/bus/vdev/vdev.c | 2 +- drivers/bus/vmbus/linux/vmbus_bus.c | 16 +- drivers/bus/vmbus/linux/vmbus_uio.c | 55 +- drivers/bus/vmbus/vmbus_common.c | 13 +- drivers/bus/vmbus/vmbus_common_uio.c | 7 +- drivers/common/cnxk/roc_dev.c | 12 +- drivers/common/cnxk/roc_model.c | 8 +- drivers/common/mlx5/linux/mlx5_nl.c | 15 +- drivers/common/mlx5/mlx5_common.c | 6 +- drivers/crypto/caam_jr/caam_jr_uio.c | 11 +- drivers/dma/idxd/idxd_bus.c | 33 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 27 +- drivers/net/bnxt/bnxt_stats.c | 8 +- drivers/net/bnxt/rte_pmd_bnxt.c | 65 ++- drivers/net/bnxt/tf_core/tf_core.c | 509 +++++++++++++----- drivers/net/bnxt/tf_core/tf_em_common.c | 56 +- .../net/bnxt/tf_core/tf_em_hash_internal.c | 10 +- drivers/net/bnxt/tf_core/tf_em_host.c | 51 +- drivers/net/bnxt/tf_core/tf_em_internal.c | 32 +- drivers/net/bnxt/tf_core/tf_global_cfg.c | 23 +- drivers/net/bnxt/tf_core/tf_identifier.c | 20 +- drivers/net/bnxt/tf_core/tf_if_tbl.c | 15 +- drivers/net/bnxt/tf_core/tf_msg.c | 347 +++++++++--- drivers/net/bnxt/tf_core/tf_rm.c | 14 +- drivers/net/bnxt/tf_core/tf_session.c | 161 ++++-- drivers/net/bnxt/tf_core/tf_sram_mgr.c | 51 +- drivers/net/bnxt/tf_core/tf_tbl.c | 62 ++- drivers/net/bnxt/tf_core/tf_tbl_sram.c | 103 +++- drivers/net/bnxt/tf_core/tf_tcam.c | 53 +- drivers/net/bonding/bonding_testpmd.c | 18 +- drivers/net/bonding/rte_eth_bond_api.c | 5 +- drivers/net/bonding/rte_eth_bond_flow.c | 4 +- drivers/net/bonding/rte_eth_bond_pmd.c | 16 +- drivers/net/cnxk/cnxk_rep_msg.c | 9 +- drivers/net/dpaa/dpaa_ethdev.c | 10 +- drivers/net/dpaa/fmlib/fm_lib.c | 15 +- drivers/net/dpaa2/dpaa2_ethdev.c | 12 +- drivers/net/enetfec/enet_uio.c | 5 +- drivers/net/failsafe/failsafe.c | 15 +- drivers/net/failsafe/failsafe_args.c | 12 +- drivers/net/failsafe/failsafe_eal.c | 7 +- drivers/net/failsafe/failsafe_flow.c | 4 +- drivers/net/failsafe/failsafe_ops.c | 5 +- drivers/net/failsafe/failsafe_private.h | 17 +- drivers/net/i40e/i40e_testpmd.c | 109 +++- drivers/net/ice/ice_testpmd.c | 10 +- drivers/net/ixgbe/ixgbe_testpmd.c | 30 +- drivers/net/memif/memif_socket.c | 10 +- drivers/net/memif/rte_eth_memif.c | 45 +- drivers/net/mlx4/mlx4.c | 29 +- drivers/net/mlx4/mlx4_ethdev.c | 18 +- drivers/net/mlx4/mlx4_rxq.c | 18 +- drivers/net/mlx4/mlx4_txq.c | 10 +- drivers/net/mlx5/hws/mlx5dr_matcher.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 22 +- drivers/net/mlx5/linux/mlx5_os.c | 21 +- drivers/net/mlx5/linux/mlx5_socket.c | 40 +- drivers/net/mlx5/linux/mlx5_verbs.c | 20 +- drivers/net/mlx5/mlx5.c | 8 +- drivers/net/mlx5/mlx5_devx.c | 9 +- drivers/net/mlx5/mlx5_mac.c | 2 +- drivers/net/mlx5/mlx5_rxmode.c | 8 +- drivers/net/mlx5/mlx5_rxq.c | 12 +- drivers/net/mlx5/mlx5_rxtx.c | 5 +- drivers/net/mlx5/mlx5_stats.c | 7 +- drivers/net/mlx5/mlx5_testpmd.c | 58 +- 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 | 16 +- drivers/net/qede/qede_regs.c | 9 +- drivers/net/sfc/sfc_flow.c | 5 +- drivers/net/sfc/sfc_flow_tunnel.c | 6 +- drivers/net/sfc/sfc_mae.c | 152 ++++-- drivers/net/tap/rte_eth_tap.c | 55 +- drivers/net/tap/tap_flow.c | 33 +- drivers/net/tap/tap_netlink.c | 12 +- drivers/net/tap/tap_tcmsgs.c | 12 +- drivers/net/vhost/rte_eth_vhost.c | 14 +- drivers/net/virtio/virtio_user/vhost_kernel.c | 21 +- .../net/virtio/virtio_user/vhost_kernel_tap.c | 56 +- drivers/net/virtio/virtio_user/vhost_user.c | 52 +- drivers/net/virtio/virtio_user/vhost_vdpa.c | 30 +- .../net/virtio/virtio_user/virtio_user_dev.c | 26 +- drivers/net/virtio/virtio_user_ethdev.c | 21 +- drivers/raw/ifpga/afu_pmd_n3000.c | 10 +- drivers/raw/ifpga/base/ifpga_fme_rsu.c | 24 +- drivers/raw/ifpga/ifpga_rawdev.c | 5 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 57 +- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 5 +- drivers/vdpa/sfc/sfc_vdpa_ops.c | 15 +- lib/bpf/bpf_load_elf.c | 5 +- lib/eal/common/eal_common_fbarray.c | 6 +- lib/eal/common/eal_common_options.c | 19 +- lib/eal/common/eal_common_proc.c | 32 +- lib/eal/common/eal_common_trace_utils.c | 14 +- lib/eal/freebsd/eal.c | 10 +- lib/eal/freebsd/eal_interrupts.c | 26 +- lib/eal/freebsd/eal_memory.c | 6 +- lib/eal/freebsd/eal_timer.c | 22 +- lib/eal/include/rte_errno.h | 3 + lib/eal/linux/eal.c | 25 +- lib/eal/linux/eal_dev.c | 5 +- lib/eal/linux/eal_hugepage_info.c | 17 +- lib/eal/linux/eal_interrupts.c | 51 +- lib/eal/linux/eal_memalloc.c | 118 ++-- lib/eal/linux/eal_memory.c | 102 +++- lib/eal/linux/eal_timer.c | 6 +- lib/eal/linux/eal_vfio.c | 102 +++- lib/eal/unix/eal_filesystem.c | 12 +- lib/eal/unix/eal_unix_memory.c | 19 +- lib/eal/unix/rte_thread.c | 18 +- lib/eal/windows/include/rte_os_shim.h | 1 + lib/eventdev/rte_event_eth_rx_adapter.c | 8 +- lib/latencystats/rte_latencystats.c | 10 +- lib/node/kernel_tx.c | 8 +- lib/pdump/rte_pdump.c | 12 +- lib/power/guest_channel.c | 15 +- lib/power/power_kvm_vm.c | 6 +- lib/power/power_pstate_cpufreq.c | 14 +- lib/power/rte_power_pmd_mgmt.c | 6 +- lib/vhost/fd_man.c | 14 +- lib/vhost/socket.c | 34 +- lib/vhost/vduse.c | 105 +++- lib/vhost/vhost_user.c | 25 +- 136 files changed, 3172 insertions(+), 1045 deletions(-) -- 2.33.0