From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id A0CE57CFF for ; Thu, 4 May 2017 18:18:58 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5CA8B203AF; Thu, 4 May 2017 12:18:57 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 04 May 2017 12:18:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=jSi jtPwnELqkAXKAcID3pXpDDlIfJJQlkCG2YaUbzqQ=; b=inpuO3IISmlA0acgonr x45GaPl2lO21EiTTwgB3ygITRAkPtx1hpNumTxXcrSHzfa7ZZB5pbTN7nACO4mUc QAZsrjVrmnH4bY3yPUlltS6pfJ2/B/q9cAQamfkLONnFz5srAkpFGZ8SjoD8DbIc o2LZ7jyOI7yw/tQvLASs0BLU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=jSijtPwnELqkAXKAcID3pXpDDlIfJJQlkCG2YaUbz qQ=; b=nOUFKm6e+BrSaukfaOzH6aWzXfRvq32es2SJAmRlZwReouOIT6wCP32kh /c0GWk66Pjup2YdxeDoDkhjA3ZDU+Z9tnD+KQKrp7Z2rnQRa9TELQW3NT1tW0unC lTdFI/C963hTVNF7KIgu7Ok/sGQ0DaN1qCIOZMNCPCkWKx9wNpckb713A9PbDKXR hja52rGPkT1ElCU6PB0/PkIjwIpzkYmu6R+FPY/cWJW6CETZPLw+vQt6E/Nk9GM4 ZANFfSl8uGJF1/0JG38cEEgJh2t68i5acC0N9ICNMx4SZ7cah9UNylR01dYrUNSG ukz9q42uQokb0j0kJCcHKqtZeVZjQ== X-ME-Sender: X-Sasl-enc: +NejAVlhwuOmfrtIGW26ypeIf6d+yI5nvOnvNvQAY6b8 1493914736 Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 8937F7E2E3 for ; Thu, 4 May 2017 12:18:56 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Date: Thu, 4 May 2017 18:18:50 +0200 Message-Id: <20170504161851.26574-2-thomas@monjalon.net> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170504161851.26574-1-thomas@monjalon.net> References: <20170504161851.26574-1-thomas@monjalon.net> Subject: [dpdk-dev] [PATCH 1/2] pci: remove eal prefix X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2017 16:18:59 -0000 The PCI code will move to the bus drivers directory. Rename functions from rte_eal_pci_ to rte_pci_ to prepare the move of the driver out of EAL. Signed-off-by: Thomas Monjalon --- app/test-pmd/testpmd.c | 2 +- .../sample_app_ug/l2_forward_real_virtual.rst | 4 +- doc/guides/sample_app_ug/link_status_intr.rst | 4 +- doc/guides/sample_app_ug/multi_process.rst | 2 +- doc/guides/sample_app_ug/netmap_compatibility.rst | 2 +- doc/guides/sample_app_ug/quota_watermark.rst | 4 +- drivers/net/bnx2x/bnx2x.h | 6 +- drivers/net/cxgbe/base/adapter.h | 10 +-- drivers/net/i40e/i40e_ethdev.c | 6 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 10 +-- drivers/net/virtio/virtio_pci.c | 81 ++++++++++------------ drivers/net/virtio/virtio_user_ethdev.c | 2 +- lib/librte_cryptodev/rte_cryptodev.c | 4 +- lib/librte_eal/bsdapp/eal/eal_pci.c | 40 +++++------ lib/librte_eal/bsdapp/eal/rte_eal_version.map | 30 ++++---- lib/librte_eal/common/eal_common_dev.c | 4 +- lib/librte_eal/common/eal_common_pci.c | 42 +++++------ lib/librte_eal/common/eal_private.h | 8 +-- lib/librte_eal/common/include/rte_pci.h | 46 ++++++------ lib/librte_eal/linuxapp/eal/eal_pci.c | 38 +++++----- lib/librte_eal/linuxapp/eal/rte_eal_version.map | 30 ++++---- lib/librte_eventdev/rte_eventdev.c | 4 +- 24 files changed, 189 insertions(+), 194 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index dfe64427d..cd1240b24 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1779,7 +1779,7 @@ rmv_event_callback(void *arg) if (da->type == RTE_DEVTYPE_VIRTUAL) snprintf(name, sizeof(name), "%s", da->virt.drv_name); else if (da->type == RTE_DEVTYPE_WHITELISTED_PCI) - rte_eal_pci_device_name(&da->pci.addr, name, sizeof(name)); + rte_pci_device_name(&da->pci.addr, name, sizeof(name)); printf("removing device %s\n", name); rte_eal_dev_detach(name); dev->state = RTE_ETH_DEV_UNUSED; diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst index 609c8f531..f579c8fe9 100644 --- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst +++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst @@ -238,7 +238,7 @@ in the *DPDK Programmer's Guide* - Rel 1.4 EAR and the *DPDK API Reference*. .. code-block:: c - if (rte_eal_pci_probe() < 0) + if (rte_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); nb_ports = rte_eth_dev_count(); @@ -279,7 +279,7 @@ Observe that: * rte_igb_pmd_init_all() simultaneously registers the driver as a PCI driver and as an Ethernet* Poll Mode Driver. -* rte_eal_pci_probe() parses the devices on the PCI bus and initializes recognized devices. +* rte_pci_probe() parses the devices on the PCI bus and initializes recognized devices. The next step is to configure the RX and TX queues. For each port, there is only one RX queue (only one lcore is able to poll a given port). diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst index 5234bc083..f9af47492 100644 --- a/doc/guides/sample_app_ug/link_status_intr.rst +++ b/doc/guides/sample_app_ug/link_status_intr.rst @@ -138,7 +138,7 @@ To fully understand this code, it is recommended to study the chapters that rela .. code-block:: c - if (rte_eal_pci_probe() < 0) + if (rte_pci_probe() < 0) rte_exit(EXIT_FAILURE, "Cannot probe PCI\n"); nb_ports = rte_eth_dev_count(); @@ -171,7 +171,7 @@ To fully understand this code, it is recommended to study the chapters that rela Observe that: -* rte_eal_pci_probe() parses the devices on the PCI bus and initializes recognized devices. +* rte_pci_probe() parses the devices on the PCI bus and initializes recognized devices. The next step is to configure the RX and TX queues. For each port, there is only one RX queue (only one lcore is able to poll a given port). diff --git a/doc/guides/sample_app_ug/multi_process.rst b/doc/guides/sample_app_ug/multi_process.rst index c0d441753..d4df2fa72 100644 --- a/doc/guides/sample_app_ug/multi_process.rst +++ b/doc/guides/sample_app_ug/multi_process.rst @@ -254,7 +254,7 @@ How the Application Works ^^^^^^^^^^^^^^^^^^^^^^^^^ The initialization calls in both the primary and secondary instances are the same for the most part, -calling the rte_eal_init(), 1 G and 10 G driver initialization and then rte_eal_pci_probe() functions. +calling the rte_eal_init(), 1 G and 10 G driver initialization and then rte_pci_probe() functions. Thereafter, the initialization done depends on whether the process is configured as a primary or secondary instance. In the primary instance, a memory pool is created for the packet mbufs and the network ports to be used are initialized - diff --git a/doc/guides/sample_app_ug/netmap_compatibility.rst b/doc/guides/sample_app_ug/netmap_compatibility.rst index 41f051863..030fd9803 100644 --- a/doc/guides/sample_app_ug/netmap_compatibility.rst +++ b/doc/guides/sample_app_ug/netmap_compatibility.rst @@ -104,7 +104,7 @@ Porting Netmap applications typically involves two major steps: Since the ``compat_netmap`` functions have the same signature as the usual libc calls, the change is trivial in most cases. -The usual DPDK initialization code involving ``rte_eal_init()`` and ``rte_eal_pci_probe()`` +The usual DPDK initialization code involving ``rte_eal_init()`` and ``rte_pci_probe()`` has to be added to the Netmap application in the same way it is used in all other DPDK sample applications. Please refer to the *DPDK Programmer's Guide* and example source code for details about initialization. diff --git a/doc/guides/sample_app_ug/quota_watermark.rst b/doc/guides/sample_app_ug/quota_watermark.rst index 09530f20a..2c3a4320c 100644 --- a/doc/guides/sample_app_ug/quota_watermark.rst +++ b/doc/guides/sample_app_ug/quota_watermark.rst @@ -204,9 +204,9 @@ Then, a call to init_dpdk(), defined in init.c, is made to initialize the poll m /* Bind the drivers to usable devices */ - ret = rte_eal_pci_probe(); + ret = rte_pci_probe(); if (ret < 0) - rte_exit(EXIT_FAILURE, "rte_eal_pci_probe(): error %d\n", ret); + rte_exit(EXIT_FAILURE, "rte_pci_probe(): error %d\n", ret); if (rte_eth_dev_count() < 2) rte_exit(EXIT_FAILURE, "Not enough Ethernet port available\n"); diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index b3cd5fcc3..91c5aec21 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h @@ -1977,7 +1977,7 @@ bnx2x_set_rx_mode(struct bnx2x_softc *sc) static inline int pci_read(struct bnx2x_softc *sc, size_t addr, void *val, uint8_t size) { - if (rte_eal_pci_read_config(sc->pci_dev, val, size, addr) <= 0) { + if (rte_pci_read_config(sc->pci_dev, val, size, addr) <= 0) { PMD_DRV_LOG(ERR, "Can't read from PCI config space"); return ENXIO; } @@ -1989,7 +1989,7 @@ static inline int pci_write_word(struct bnx2x_softc *sc, size_t addr, off_t val) { uint16_t val16 = val; - if (rte_eal_pci_write_config(sc->pci_dev, &val16, + if (rte_pci_write_config(sc->pci_dev, &val16, sizeof(val16), addr) <= 0) { PMD_DRV_LOG(ERR, "Can't write to PCI config space"); return ENXIO; @@ -2001,7 +2001,7 @@ static inline int pci_write_word(struct bnx2x_softc *sc, size_t addr, off_t val) static inline int pci_write_long(struct bnx2x_softc *sc, size_t addr, off_t val) { uint32_t val32 = val; - if (rte_eal_pci_write_config(sc->pci_dev, &val32, + if (rte_pci_write_config(sc->pci_dev, &val32, sizeof(val32), addr) <= 0) { PMD_DRV_LOG(ERR, "Can't write to PCI config space"); return ENXIO; diff --git a/drivers/net/cxgbe/base/adapter.h b/drivers/net/cxgbe/base/adapter.h index beb1e3e6f..26807900d 100644 --- a/drivers/net/cxgbe/base/adapter.h +++ b/drivers/net/cxgbe/base/adapter.h @@ -478,7 +478,7 @@ static inline void t4_os_pci_write_cfg4(struct adapter *adapter, size_t addr, { u32 val32 = val; - if (rte_eal_pci_write_config(adapter->pdev, &val32, sizeof(val32), + if (rte_pci_write_config(adapter->pdev, &val32, sizeof(val32), addr) < 0) dev_err(adapter, "Can't write to PCI config space\n"); } @@ -494,7 +494,7 @@ static inline void t4_os_pci_write_cfg4(struct adapter *adapter, size_t addr, static inline void t4_os_pci_read_cfg4(struct adapter *adapter, size_t addr, u32 *val) { - if (rte_eal_pci_read_config(adapter->pdev, val, sizeof(*val), + if (rte_pci_read_config(adapter->pdev, val, sizeof(*val), addr) < 0) dev_err(adapter, "Can't read from PCI config space\n"); } @@ -512,7 +512,7 @@ static inline void t4_os_pci_write_cfg2(struct adapter *adapter, size_t addr, { u16 val16 = val; - if (rte_eal_pci_write_config(adapter->pdev, &val16, sizeof(val16), + if (rte_pci_write_config(adapter->pdev, &val16, sizeof(val16), addr) < 0) dev_err(adapter, "Can't write to PCI config space\n"); } @@ -528,7 +528,7 @@ static inline void t4_os_pci_write_cfg2(struct adapter *adapter, size_t addr, static inline void t4_os_pci_read_cfg2(struct adapter *adapter, size_t addr, u16 *val) { - if (rte_eal_pci_read_config(adapter->pdev, val, sizeof(*val), + if (rte_pci_read_config(adapter->pdev, val, sizeof(*val), addr) < 0) dev_err(adapter, "Can't read from PCI config space\n"); } @@ -544,7 +544,7 @@ static inline void t4_os_pci_read_cfg2(struct adapter *adapter, size_t addr, static inline void t4_os_pci_read_cfg(struct adapter *adapter, size_t addr, u8 *val) { - if (rte_eal_pci_read_config(adapter->pdev, val, sizeof(*val), + if (rte_pci_read_config(adapter->pdev, val, sizeof(*val), addr) < 0) dev_err(adapter, "Can't read from PCI config space\n"); } diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 3fa25dcda..a6f29fcf6 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -8991,7 +8991,7 @@ i40e_enable_extended_tag(struct rte_eth_dev *dev) uint32_t buf = 0; int ret; - ret = rte_eal_pci_read_config(pci_dev, &buf, sizeof(buf), + ret = rte_pci_read_config(pci_dev, &buf, sizeof(buf), PCI_DEV_CAP_REG); if (ret < 0) { PMD_DRV_LOG(ERR, "Failed to read PCI offset 0x%x", @@ -9004,7 +9004,7 @@ i40e_enable_extended_tag(struct rte_eth_dev *dev) } buf = 0; - ret = rte_eal_pci_read_config(pci_dev, &buf, sizeof(buf), + ret = rte_pci_read_config(pci_dev, &buf, sizeof(buf), PCI_DEV_CTRL_REG); if (ret < 0) { PMD_DRV_LOG(ERR, "Failed to read PCI offset 0x%x", @@ -9016,7 +9016,7 @@ i40e_enable_extended_tag(struct rte_eth_dev *dev) return; } buf |= PCI_DEV_CTRL_EXT_TAG_MASK; - ret = rte_eal_pci_write_config(pci_dev, &buf, sizeof(buf), + ret = rte_pci_write_config(pci_dev, &buf, sizeof(buf), PCI_DEV_CTRL_REG); if (ret < 0) { PMD_DRV_LOG(ERR, "Failed to write PCI offset 0x%x", diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 0fdba80c3..1e37dd952 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -6086,7 +6086,7 @@ rte_mlx4_pmd_init(void) */ setenv("RDMAV_HUGEPAGES_SAFE", "1", 1); ibv_fork_init(); - rte_eal_pci_register(&mlx4_driver); + rte_pci_register(&mlx4_driver); } RTE_PMD_EXPORT_NAME(net_mlx4, __COUNTER__); diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 2c91317c4..fc99c0d54 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -892,7 +892,7 @@ rte_mlx5_pmd_init(void) */ setenv("RDMAV_HUGEPAGES_SAFE", "1", 1); ibv_fork_init(); - rte_eal_pci_register(&mlx5_driver); + rte_pci_register(&mlx5_driver); } RTE_PMD_EXPORT_NAME(net_mlx5, __COUNTER__); diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index b23f4c278..19235a9fc 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1484,7 +1484,7 @@ virtio_remap_pci(struct rte_pci_device *pci_dev, struct virtio_hw *hw) if (hw->modern) { /* * We don't have to re-parse the PCI config space, since - * rte_eal_pci_map_device() makes sure the mapped address + * rte_pci_map_device() makes sure the mapped address * in secondary process would equal to the one mapped in * the primary process: error will be returned if that * requirement is not met. @@ -1493,12 +1493,12 @@ virtio_remap_pci(struct rte_pci_device *pci_dev, struct virtio_hw *hw) * (such as dev_cfg, common_cfg, etc.) parsed from the * primary process, which is stored in shared memory. */ - if (rte_eal_pci_map_device(pci_dev)) { + if (rte_pci_map_device(pci_dev)) { PMD_INIT_LOG(DEBUG, "failed to map pci device!"); return -1; } } else { - if (rte_eal_pci_ioport_map(pci_dev, 0, VTPCI_IO(hw)) < 0) + if (rte_pci_ioport_map(pci_dev, 0, VTPCI_IO(hw)) < 0) return -1; } @@ -1608,7 +1608,7 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev) virtio_interrupt_handler, eth_dev); if (eth_dev->device) - rte_eal_pci_unmap_device(RTE_DEV_TO_PCI(eth_dev->device)); + rte_pci_unmap_device(RTE_DEV_TO_PCI(eth_dev->device)); PMD_INIT_LOG(DEBUG, "dev_uninit completed"); @@ -1646,7 +1646,7 @@ rte_virtio_pmd_init(void) return; } - rte_eal_pci_register(&rte_virtio_pmd); + rte_pci_register(&rte_virtio_pmd); } /* diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index 1df26a691..b7b3d6157 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -95,17 +95,17 @@ legacy_read_dev_config(struct virtio_hw *hw, size_t offset, while (length > 0) { if (length >= 4) { size = 4; - rte_eal_pci_ioport_read(VTPCI_IO(hw), dst, size, + rte_pci_ioport_read(VTPCI_IO(hw), dst, size, VIRTIO_PCI_CONFIG(hw) + offset); *(uint32_t *)dst = rte_be_to_cpu_32(*(uint32_t *)dst); } else if (length >= 2) { size = 2; - rte_eal_pci_ioport_read(VTPCI_IO(hw), dst, size, + rte_pci_ioport_read(VTPCI_IO(hw), dst, size, VIRTIO_PCI_CONFIG(hw) + offset); *(uint16_t *)dst = rte_be_to_cpu_16(*(uint16_t *)dst); } else { size = 1; - rte_eal_pci_ioport_read(VTPCI_IO(hw), dst, size, + rte_pci_ioport_read(VTPCI_IO(hw), dst, size, VIRTIO_PCI_CONFIG(hw) + offset); } @@ -114,8 +114,8 @@ legacy_read_dev_config(struct virtio_hw *hw, size_t offset, length -= size; } #else - rte_eal_pci_ioport_read(VTPCI_IO(hw), dst, length, - VIRTIO_PCI_CONFIG(hw) + offset); + rte_pci_ioport_read(VTPCI_IO(hw), dst, length, + VIRTIO_PCI_CONFIG(hw) + offset); #endif } @@ -134,16 +134,16 @@ legacy_write_dev_config(struct virtio_hw *hw, size_t offset, if (length >= 4) { size = 4; tmp.u32 = rte_cpu_to_be_32(*(const uint32_t *)src); - rte_eal_pci_ioport_write(VTPCI_IO(hw), &tmp.u32, size, + rte_pci_ioport_write(VTPCI_IO(hw), &tmp.u32, size, VIRTIO_PCI_CONFIG(hw) + offset); } else if (length >= 2) { size = 2; tmp.u16 = rte_cpu_to_be_16(*(const uint16_t *)src); - rte_eal_pci_ioport_write(VTPCI_IO(hw), &tmp.u16, size, + rte_pci_ioport_write(VTPCI_IO(hw), &tmp.u16, size, VIRTIO_PCI_CONFIG(hw) + offset); } else { size = 1; - rte_eal_pci_ioport_write(VTPCI_IO(hw), src, size, + rte_pci_ioport_write(VTPCI_IO(hw), src, size, VIRTIO_PCI_CONFIG(hw) + offset); } @@ -152,8 +152,8 @@ legacy_write_dev_config(struct virtio_hw *hw, size_t offset, length -= size; } #else - rte_eal_pci_ioport_write(VTPCI_IO(hw), src, length, - VIRTIO_PCI_CONFIG(hw) + offset); + rte_pci_ioport_write(VTPCI_IO(hw), src, length, + VIRTIO_PCI_CONFIG(hw) + offset); #endif } @@ -162,8 +162,7 @@ legacy_get_features(struct virtio_hw *hw) { uint32_t dst; - rte_eal_pci_ioport_read(VTPCI_IO(hw), &dst, 4, - VIRTIO_PCI_HOST_FEATURES); + rte_pci_ioport_read(VTPCI_IO(hw), &dst, 4, VIRTIO_PCI_HOST_FEATURES); return dst; } @@ -175,8 +174,8 @@ legacy_set_features(struct virtio_hw *hw, uint64_t features) "only 32 bit features are allowed for legacy virtio!"); return; } - rte_eal_pci_ioport_write(VTPCI_IO(hw), &features, 4, - VIRTIO_PCI_GUEST_FEATURES); + rte_pci_ioport_write(VTPCI_IO(hw), &features, 4, + VIRTIO_PCI_GUEST_FEATURES); } static uint8_t @@ -184,14 +183,14 @@ legacy_get_status(struct virtio_hw *hw) { uint8_t dst; - rte_eal_pci_ioport_read(VTPCI_IO(hw), &dst, 1, VIRTIO_PCI_STATUS); + rte_pci_ioport_read(VTPCI_IO(hw), &dst, 1, VIRTIO_PCI_STATUS); return dst; } static void legacy_set_status(struct virtio_hw *hw, uint8_t status) { - rte_eal_pci_ioport_write(VTPCI_IO(hw), &status, 1, VIRTIO_PCI_STATUS); + rte_pci_ioport_write(VTPCI_IO(hw), &status, 1, VIRTIO_PCI_STATUS); } static void @@ -205,7 +204,7 @@ legacy_get_isr(struct virtio_hw *hw) { uint8_t dst; - rte_eal_pci_ioport_read(VTPCI_IO(hw), &dst, 1, VIRTIO_PCI_ISR); + rte_pci_ioport_read(VTPCI_IO(hw), &dst, 1, VIRTIO_PCI_ISR); return dst; } @@ -215,10 +214,8 @@ legacy_set_config_irq(struct virtio_hw *hw, uint16_t vec) { uint16_t dst; - rte_eal_pci_ioport_write(VTPCI_IO(hw), &vec, 2, - VIRTIO_MSI_CONFIG_VECTOR); - rte_eal_pci_ioport_read(VTPCI_IO(hw), &dst, 2, - VIRTIO_MSI_CONFIG_VECTOR); + rte_pci_ioport_write(VTPCI_IO(hw), &vec, 2, VIRTIO_MSI_CONFIG_VECTOR); + rte_pci_ioport_read(VTPCI_IO(hw), &dst, 2, VIRTIO_MSI_CONFIG_VECTOR); return dst; } @@ -227,11 +224,10 @@ legacy_set_queue_irq(struct virtio_hw *hw, struct virtqueue *vq, uint16_t vec) { uint16_t dst; - rte_eal_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2, - VIRTIO_PCI_QUEUE_SEL); - rte_eal_pci_ioport_write(VTPCI_IO(hw), &vec, 2, - VIRTIO_MSI_QUEUE_VECTOR); - rte_eal_pci_ioport_read(VTPCI_IO(hw), &dst, 2, VIRTIO_MSI_QUEUE_VECTOR); + rte_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2, + VIRTIO_PCI_QUEUE_SEL); + rte_pci_ioport_write(VTPCI_IO(hw), &vec, 2, VIRTIO_MSI_QUEUE_VECTOR); + rte_pci_ioport_read(VTPCI_IO(hw), &dst, 2, VIRTIO_MSI_QUEUE_VECTOR); return dst; } @@ -240,9 +236,8 @@ legacy_get_queue_num(struct virtio_hw *hw, uint16_t queue_id) { uint16_t dst; - rte_eal_pci_ioport_write(VTPCI_IO(hw), &queue_id, 2, - VIRTIO_PCI_QUEUE_SEL); - rte_eal_pci_ioport_read(VTPCI_IO(hw), &dst, 2, VIRTIO_PCI_QUEUE_NUM); + rte_pci_ioport_write(VTPCI_IO(hw), &queue_id, 2, VIRTIO_PCI_QUEUE_SEL); + rte_pci_ioport_read(VTPCI_IO(hw), &dst, 2, VIRTIO_PCI_QUEUE_NUM); return dst; } @@ -254,10 +249,10 @@ legacy_setup_queue(struct virtio_hw *hw, struct virtqueue *vq) if (!check_vq_phys_addr_ok(vq)) return -1; - rte_eal_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2, - VIRTIO_PCI_QUEUE_SEL); + rte_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2, + VIRTIO_PCI_QUEUE_SEL); src = vq->vq_ring_mem >> VIRTIO_PCI_QUEUE_ADDR_SHIFT; - rte_eal_pci_ioport_write(VTPCI_IO(hw), &src, 4, VIRTIO_PCI_QUEUE_PFN); + rte_pci_ioport_write(VTPCI_IO(hw), &src, 4, VIRTIO_PCI_QUEUE_PFN); return 0; } @@ -267,16 +262,16 @@ legacy_del_queue(struct virtio_hw *hw, struct virtqueue *vq) { uint32_t src = 0; - rte_eal_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2, - VIRTIO_PCI_QUEUE_SEL); - rte_eal_pci_ioport_write(VTPCI_IO(hw), &src, 4, VIRTIO_PCI_QUEUE_PFN); + rte_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2, + VIRTIO_PCI_QUEUE_SEL); + rte_pci_ioport_write(VTPCI_IO(hw), &src, 4, VIRTIO_PCI_QUEUE_PFN); } static void legacy_notify_queue(struct virtio_hw *hw, struct virtqueue *vq) { - rte_eal_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2, - VIRTIO_PCI_QUEUE_NOTIFY); + rte_pci_ioport_write(VTPCI_IO(hw), &vq->vq_queue_index, 2, + VIRTIO_PCI_QUEUE_NOTIFY); } const struct virtio_pci_ops legacy_ops = { @@ -591,19 +586,19 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw) struct virtio_pci_cap cap; int ret; - if (rte_eal_pci_map_device(dev)) { + if (rte_pci_map_device(dev)) { PMD_INIT_LOG(DEBUG, "failed to map pci device!"); return -1; } - ret = rte_eal_pci_read_config(dev, &pos, 1, PCI_CAPABILITY_LIST); + ret = rte_pci_read_config(dev, &pos, 1, PCI_CAPABILITY_LIST); if (ret < 0) { PMD_INIT_LOG(DEBUG, "failed to read pci capability list"); return -1; } while (pos) { - ret = rte_eal_pci_read_config(dev, &cap, sizeof(cap), pos); + ret = rte_pci_read_config(dev, &cap, sizeof(cap), pos); if (ret < 0) { PMD_INIT_LOG(ERR, "failed to read pci cap at pos: %x", pos); @@ -629,8 +624,8 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw) hw->common_cfg = get_cfg_addr(dev, &cap); break; case VIRTIO_PCI_CAP_NOTIFY_CFG: - rte_eal_pci_read_config(dev, &hw->notify_off_multiplier, - 4, pos + sizeof(cap)); + rte_pci_read_config(dev, &hw->notify_off_multiplier, + 4, pos + sizeof(cap)); hw->notify_base = get_cfg_addr(dev, &cap); break; case VIRTIO_PCI_CAP_DEVICE_CFG: @@ -686,7 +681,7 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw) } PMD_INIT_LOG(INFO, "trying with legacy virtio pci."); - if (rte_eal_pci_ioport_map(dev, 0, VTPCI_IO(hw)) < 0) { + if (rte_pci_ioport_map(dev, 0, VTPCI_IO(hw)) < 0) { if (dev->kdrv == RTE_KDRV_UNKNOWN && (!dev->device.devargs || dev->device.devargs->type != diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 1894310cf..280406c02 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -510,7 +510,7 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev) goto end; } - /* previously called by rte_eal_pci_probe() for physical dev */ + /* previously called by rte_pci_probe() for physical dev */ if (eth_virtio_dev_init(eth_dev) < 0) { PMD_INIT_LOG(ERR, "eth_virtio_dev_init fails"); virtio_user_eth_dev_free(eth_dev); diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 6f5080c0c..02db8a582 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -716,7 +716,7 @@ rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv, if (cryptodrv == NULL) return -ENODEV; - rte_eal_pci_device_name(&pci_dev->addr, cryptodev_name, + rte_pci_device_name(&pci_dev->addr, cryptodev_name, sizeof(cryptodev_name)); cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id()); @@ -772,7 +772,7 @@ rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev) if (pci_dev == NULL) return -EINVAL; - rte_eal_pci_device_name(&pci_dev->addr, cryptodev_name, + rte_pci_device_name(&pci_dev->addr, cryptodev_name, sizeof(cryptodev_name)); cryptodev = rte_cryptodev_pmd_get_named_dev(cryptodev_name); diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 6e289da48..6294b7eab 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -91,7 +91,7 @@ extern struct rte_pci_bus rte_pci_bus; /* Map pci device */ int -rte_eal_pci_map_device(struct rte_pci_device *dev) +rte_pci_map_device(struct rte_pci_device *dev) { int ret = -1; @@ -113,7 +113,7 @@ rte_eal_pci_map_device(struct rte_pci_device *dev) /* Unmap pci device */ void -rte_eal_pci_unmap_device(struct rte_pci_device *dev) +rte_pci_unmap_device(struct rte_pci_device *dev) { /* try unmapping the NIC resources */ switch (dev->kdrv) { @@ -282,7 +282,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) /* FreeBSD has no NUMA support (yet) */ dev->device.numa_node = 0; - rte_eal_pci_device_name(&dev->addr, dev->name, sizeof(dev->name)); + rte_pci_device_name(&dev->addr, dev->name, sizeof(dev->name)); dev->device.name = dev->name; /* FreeBSD has only one pass through driver */ @@ -319,7 +319,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) /* device is valid, add in list (sorted) */ if (TAILQ_EMPTY(&rte_pci_bus.device_list)) { - rte_eal_pci_add_device(dev); + rte_pci_add_device(dev); } else { struct rte_pci_device *dev2 = NULL; @@ -330,7 +330,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) if (ret > 0) continue; else if (ret < 0) { - rte_eal_pci_insert_device(dev2, dev); + rte_pci_insert_device(dev2, dev); } else { /* already registered */ dev2->kdrv = dev->kdrv; dev2->max_vfs = dev->max_vfs; @@ -341,7 +341,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) } return 0; } - rte_eal_pci_add_device(dev); + rte_pci_add_device(dev); } return 0; @@ -356,7 +356,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) * list. Call pci_scan_one() for each pci entry found. */ int -rte_eal_pci_scan(void) +rte_pci_scan(void) { int fd; unsigned dev_count = 0; @@ -455,8 +455,8 @@ pci_update_device(const struct rte_pci_addr *addr) } /* Read PCI config space. */ -int rte_eal_pci_read_config(const struct rte_pci_device *dev, - void *buf, size_t len, off_t offset) +int rte_pci_read_config(const struct rte_pci_device *dev, + void *buf, size_t len, off_t offset) { int fd = -1; struct pci_io pi = { @@ -495,8 +495,8 @@ int rte_eal_pci_read_config(const struct rte_pci_device *dev, } /* Write PCI config space. */ -int rte_eal_pci_write_config(const struct rte_pci_device *dev, - const void *buf, size_t len, off_t offset) +int rte_pci_write_config(const struct rte_pci_device *dev, + const void *buf, size_t len, off_t offset) { int fd = -1; @@ -538,8 +538,8 @@ int rte_eal_pci_write_config(const struct rte_pci_device *dev, } int -rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar, - struct rte_pci_ioport *p) +rte_pci_ioport_map(struct rte_pci_device *dev, int bar, + struct rte_pci_ioport *p) { int ret; @@ -566,7 +566,7 @@ rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar, static void pci_uio_ioport_read(struct rte_pci_ioport *p, - void *data, size_t len, off_t offset) + void *data, size_t len, off_t offset) { #if defined(RTE_ARCH_X86) uint8_t *d; @@ -594,8 +594,8 @@ pci_uio_ioport_read(struct rte_pci_ioport *p, } void -rte_eal_pci_ioport_read(struct rte_pci_ioport *p, - void *data, size_t len, off_t offset) +rte_pci_ioport_read(struct rte_pci_ioport *p, + void *data, size_t len, off_t offset) { switch (p->dev->kdrv) { case RTE_KDRV_NIC_UIO: @@ -608,7 +608,7 @@ rte_eal_pci_ioport_read(struct rte_pci_ioport *p, static void pci_uio_ioport_write(struct rte_pci_ioport *p, - const void *data, size_t len, off_t offset) + const void *data, size_t len, off_t offset) { #if defined(RTE_ARCH_X86) const uint8_t *s; @@ -636,8 +636,8 @@ pci_uio_ioport_write(struct rte_pci_ioport *p, } void -rte_eal_pci_ioport_write(struct rte_pci_ioport *p, - const void *data, size_t len, off_t offset) +rte_pci_ioport_write(struct rte_pci_ioport *p, + const void *data, size_t len, off_t offset) { switch (p->dev->kdrv) { case RTE_KDRV_NIC_UIO: @@ -649,7 +649,7 @@ rte_eal_pci_ioport_write(struct rte_pci_ioport *p, } int -rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p) +rte_pci_ioport_unmap(struct rte_pci_ioport *p) { int ret; diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 183ce0f4d..804b94170 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -35,12 +35,6 @@ DPDK_2.0 { rte_eal_mp_remote_launch; rte_eal_mp_wait_lcore; rte_eal_parse_devargs_str; - rte_eal_pci_dump; - rte_eal_pci_probe; - rte_eal_pci_probe_one; - rte_eal_pci_register; - rte_eal_pci_scan; - rte_eal_pci_unregister; rte_eal_process_type; rte_eal_remote_launch; rte_eal_tailq_lookup; @@ -106,9 +100,6 @@ DPDK_2.0 { DPDK_2.1 { global: - rte_eal_pci_detach; - rte_eal_pci_read_config; - rte_eal_pci_write_config; rte_intr_allow_others; rte_intr_dp_is_en; rte_intr_efd_disable; @@ -134,12 +125,6 @@ DPDK_16.04 { global: rte_cpu_get_flag_name; - rte_eal_pci_ioport_map; - rte_eal_pci_ioport_read; - rte_eal_pci_ioport_unmap; - rte_eal_pci_ioport_write; - rte_eal_pci_map_device; - rte_eal_pci_unmap_device; rte_eal_primary_proc_alive; } DPDK_2.2; @@ -188,6 +173,21 @@ DPDK_17.05 { rte_log_set_global_level; rte_log_set_level; rte_log_set_level_regexp; + rte_pci_detach; + rte_pci_dump; + rte_pci_ioport_map; + rte_pci_ioport_read; + rte_pci_ioport_unmap; + rte_pci_ioport_write; + rte_pci_map_device; + rte_pci_probe; + rte_pci_probe_one; + rte_pci_read_config; + rte_pci_register; + rte_pci_scan; + rte_pci_unmap_device; + rte_pci_unregister; + rte_pci_write_config; vfio_get_container_fd; vfio_get_group_fd; vfio_get_group_no; diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c index a306e2525..a7a2c4bd2 100644 --- a/lib/librte_eal/common/eal_common_dev.c +++ b/lib/librte_eal/common/eal_common_dev.c @@ -55,7 +55,7 @@ int rte_eal_dev_attach(const char *name, const char *devargs) } if (eal_parse_pci_DomBDF(name, &addr) == 0) { - if (rte_eal_pci_probe_one(&addr) < 0) + if (rte_pci_probe_one(&addr) < 0) goto err; } else { @@ -80,7 +80,7 @@ int rte_eal_dev_detach(const char *name) } if (eal_parse_pci_DomBDF(name, &addr) == 0) { - if (rte_eal_pci_detach(&addr) < 0) + if (rte_pci_detach(&addr) < 0) goto err; } else { if (rte_eal_vdev_uninit(name)) diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index b6b41be31..b74999137 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -200,8 +200,8 @@ rte_pci_match(const struct rte_pci_driver *pci_drv, * driver. */ static int -rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, - struct rte_pci_device *dev) +rte_pci_probe_one_driver(struct rte_pci_driver *dr, + struct rte_pci_device *dev) { int ret; struct rte_pci_addr *loc; @@ -237,7 +237,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) { /* map resources for devices that use igb_uio */ - ret = rte_eal_pci_map_device(dev); + ret = rte_pci_map_device(dev); if (ret != 0) return ret; } @@ -251,7 +251,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, if (ret) { dev->driver = NULL; if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) - rte_eal_pci_unmap_device(dev); + rte_pci_unmap_device(dev); } return ret; @@ -262,7 +262,7 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, * driver. */ static int -rte_eal_pci_detach_dev(struct rte_pci_device *dev) +rte_pci_detach_dev(struct rte_pci_device *dev) { struct rte_pci_addr *loc; struct rte_pci_driver *dr; @@ -288,7 +288,7 @@ rte_eal_pci_detach_dev(struct rte_pci_device *dev) if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) /* unmap resources for devices that use igb_uio */ - rte_eal_pci_unmap_device(dev); + rte_pci_unmap_device(dev); return 0; } @@ -312,7 +312,7 @@ pci_probe_all_drivers(struct rte_pci_device *dev) return 0; FOREACH_DRIVER_ON_PCIBUS(dr) { - rc = rte_eal_pci_probe_one_driver(dr, dev); + rc = rte_pci_probe_one_driver(dr, dev); if (rc < 0) /* negative value is an error */ return -1; @@ -329,7 +329,7 @@ pci_probe_all_drivers(struct rte_pci_device *dev) * the driver of the devive. */ int -rte_eal_pci_probe_one(const struct rte_pci_addr *addr) +rte_pci_probe_one(const struct rte_pci_addr *addr) { struct rte_pci_device *dev = NULL; @@ -366,7 +366,7 @@ rte_eal_pci_probe_one(const struct rte_pci_addr *addr) * Detach device specified by its pci address. */ int -rte_eal_pci_detach(const struct rte_pci_addr *addr) +rte_pci_detach(const struct rte_pci_addr *addr) { struct rte_pci_device *dev = NULL; int ret = 0; @@ -378,7 +378,7 @@ rte_eal_pci_detach(const struct rte_pci_addr *addr) if (rte_eal_compare_pci_addr(&dev->addr, addr)) continue; - ret = rte_eal_pci_detach_dev(dev); + ret = rte_pci_detach_dev(dev); if (ret < 0) /* negative value is an error */ goto err_return; @@ -386,7 +386,7 @@ rte_eal_pci_detach(const struct rte_pci_addr *addr) /* positive value means driver doesn't support it */ continue; - rte_eal_pci_remove_device(dev); + rte_pci_remove_device(dev); free(dev); return 0; } @@ -405,7 +405,7 @@ rte_eal_pci_detach(const struct rte_pci_addr *addr) * for discovered devices. */ int -rte_eal_pci_probe(void) +rte_pci_probe(void) { struct rte_pci_device *dev = NULL; size_t probed = 0, failed = 0; @@ -465,7 +465,7 @@ pci_dump_one_device(FILE *f, struct rte_pci_device *dev) /* dump devices on the bus */ void -rte_eal_pci_dump(FILE *f) +rte_pci_dump(FILE *f) { struct rte_pci_device *dev = NULL; @@ -476,7 +476,7 @@ rte_eal_pci_dump(FILE *f) /* register a driver */ void -rte_eal_pci_register(struct rte_pci_driver *driver) +rte_pci_register(struct rte_pci_driver *driver) { TAILQ_INSERT_TAIL(&rte_pci_bus.driver_list, driver, next); driver->bus = &rte_pci_bus; @@ -484,7 +484,7 @@ rte_eal_pci_register(struct rte_pci_driver *driver) /* unregister a driver */ void -rte_eal_pci_unregister(struct rte_pci_driver *driver) +rte_pci_unregister(struct rte_pci_driver *driver) { TAILQ_REMOVE(&rte_pci_bus.driver_list, driver, next); driver->bus = NULL; @@ -492,30 +492,30 @@ rte_eal_pci_unregister(struct rte_pci_driver *driver) /* Add a device to PCI bus */ void -rte_eal_pci_add_device(struct rte_pci_device *pci_dev) +rte_pci_add_device(struct rte_pci_device *pci_dev) { TAILQ_INSERT_TAIL(&rte_pci_bus.device_list, pci_dev, next); } /* Insert a device into a predefined position in PCI bus */ void -rte_eal_pci_insert_device(struct rte_pci_device *exist_pci_dev, - struct rte_pci_device *new_pci_dev) +rte_pci_insert_device(struct rte_pci_device *exist_pci_dev, + struct rte_pci_device *new_pci_dev) { TAILQ_INSERT_BEFORE(exist_pci_dev, new_pci_dev, next); } /* Remove a device from PCI bus */ void -rte_eal_pci_remove_device(struct rte_pci_device *pci_dev) +rte_pci_remove_device(struct rte_pci_device *pci_dev) { TAILQ_REMOVE(&rte_pci_bus.device_list, pci_dev, next); } struct rte_pci_bus rte_pci_bus = { .bus = { - .scan = rte_eal_pci_scan, - .probe = rte_eal_pci_probe, + .scan = rte_pci_scan, + .probe = rte_pci_probe, }, .device_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.device_list), .driver_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.driver_list), diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h index 280126d68..6cacce073 100644 --- a/lib/librte_eal/common/eal_private.h +++ b/lib/librte_eal/common/eal_private.h @@ -121,7 +121,7 @@ struct rte_pci_device; * PCI device to add * @return void */ -void rte_eal_pci_add_device(struct rte_pci_device *pci_dev); +void rte_pci_add_device(struct rte_pci_device *pci_dev); /** * Insert a PCI device in the PCI Bus at a particular location in the device @@ -134,8 +134,8 @@ void rte_eal_pci_add_device(struct rte_pci_device *pci_dev); * PCI device to be added before exist_pci_dev * @return void */ -void rte_eal_pci_insert_device(struct rte_pci_device *exist_pci_dev, - struct rte_pci_device *new_pci_dev); +void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev, + struct rte_pci_device *new_pci_dev); /** * Remove a PCI device from the PCI Bus. This sets to NULL the bus references @@ -145,7 +145,7 @@ void rte_eal_pci_insert_device(struct rte_pci_device *exist_pci_dev, * PCI device to be removed from PCI Bus * @return void */ -void rte_eal_pci_remove_device(struct rte_pci_device *pci_device); +void rte_pci_remove_device(struct rte_pci_device *pci_device); /** * Update a pci device object by asking the kernel for the latest information. diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 6effb7ad1..ab64c63c5 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -342,8 +342,8 @@ eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr) * The output buffer size */ static inline void -rte_eal_pci_device_name(const struct rte_pci_addr *addr, - char *output, size_t size) +rte_pci_device_name(const struct rte_pci_addr *addr, + char *output, size_t size) { RTE_VERIFY(size >= PCI_PRI_STR_SIZE); RTE_VERIFY(snprintf(output, size, PCI_PRI_FMT, @@ -393,7 +393,7 @@ rte_eal_compare_pci_addr(const struct rte_pci_addr *addr, * @return * 0 on success, negative on error */ -int rte_eal_pci_scan(void); +int rte_pci_scan(void); /** * Probe the PCI bus @@ -403,7 +403,7 @@ int rte_eal_pci_scan(void); * - !0 on error. */ int -rte_eal_pci_probe(void); +rte_pci_probe(void); /** * Map the PCI device resources in user space virtual memory address @@ -420,7 +420,7 @@ rte_eal_pci_probe(void); * 0 on success, negative on error and positive if no driver * is found for the device. */ -int rte_eal_pci_map_device(struct rte_pci_device *dev); +int rte_pci_map_device(struct rte_pci_device *dev); /** * Unmap this device @@ -429,7 +429,7 @@ int rte_eal_pci_map_device(struct rte_pci_device *dev); * A pointer to a rte_pci_device structure describing the device * to use */ -void rte_eal_pci_unmap_device(struct rte_pci_device *dev); +void rte_pci_unmap_device(struct rte_pci_device *dev); /** * @internal @@ -476,7 +476,7 @@ void pci_unmap_resource(void *requested_addr, size_t size); * - 0 on success. * - Negative on error. */ -int rte_eal_pci_probe_one(const struct rte_pci_addr *addr); +int rte_pci_probe_one(const struct rte_pci_addr *addr); /** * Close the single PCI device. @@ -491,7 +491,7 @@ int rte_eal_pci_probe_one(const struct rte_pci_addr *addr); * - 0 on success. * - Negative on error. */ -int rte_eal_pci_detach(const struct rte_pci_addr *addr); +int rte_pci_detach(const struct rte_pci_addr *addr); /** * Dump the content of the PCI bus. @@ -499,7 +499,7 @@ int rte_eal_pci_detach(const struct rte_pci_addr *addr); * @param f * A pointer to a file for output */ -void rte_eal_pci_dump(FILE *f); +void rte_pci_dump(FILE *f); /** * Register a PCI driver. @@ -508,7 +508,7 @@ void rte_eal_pci_dump(FILE *f); * A pointer to a rte_pci_driver structure describing the driver * to be registered. */ -void rte_eal_pci_register(struct rte_pci_driver *driver); +void rte_pci_register(struct rte_pci_driver *driver); /** Helper for PCI device registration from driver (eth, crypto) instance */ #define RTE_PMD_REGISTER_PCI(nm, pci_drv) \ @@ -516,7 +516,7 @@ RTE_INIT(pciinitfn_ ##nm); \ static void pciinitfn_ ##nm(void) \ {\ (pci_drv).driver.name = RTE_STR(nm);\ - rte_eal_pci_register(&pci_drv); \ + rte_pci_register(&pci_drv); \ } \ RTE_PMD_EXPORT_NAME(nm, __COUNTER__) @@ -527,7 +527,7 @@ RTE_PMD_EXPORT_NAME(nm, __COUNTER__) * A pointer to a rte_pci_driver structure describing the driver * to be unregistered. */ -void rte_eal_pci_unregister(struct rte_pci_driver *driver); +void rte_pci_unregister(struct rte_pci_driver *driver); /** * Read PCI config space. @@ -542,8 +542,8 @@ void rte_eal_pci_unregister(struct rte_pci_driver *driver); * @param offset * The offset into PCI config space */ -int rte_eal_pci_read_config(const struct rte_pci_device *device, - void *buf, size_t len, off_t offset); +int rte_pci_read_config(const struct rte_pci_device *device, + void *buf, size_t len, off_t offset); /** * Write PCI config space. @@ -558,8 +558,8 @@ int rte_eal_pci_read_config(const struct rte_pci_device *device, * @param offset * The offset into PCI config space */ -int rte_eal_pci_write_config(const struct rte_pci_device *device, - const void *buf, size_t len, off_t offset); +int rte_pci_write_config(const struct rte_pci_device *device, + const void *buf, size_t len, off_t offset); /** * A structure used to access io resources for a pci device. @@ -587,8 +587,8 @@ struct rte_pci_ioport { * @return * 0 on success, negative on error. */ -int rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar, - struct rte_pci_ioport *p); +int rte_pci_ioport_map(struct rte_pci_device *dev, int bar, + struct rte_pci_ioport *p); /** * Release any resources used in a rte_pci_ioport object. @@ -598,7 +598,7 @@ int rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar, * @return * 0 on success, negative on error. */ -int rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p); +int rte_pci_ioport_unmap(struct rte_pci_ioport *p); /** * Read from a io pci resource. @@ -612,8 +612,8 @@ int rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p); * @param offset * The offset into the pci io resource. */ -void rte_eal_pci_ioport_read(struct rte_pci_ioport *p, - void *data, size_t len, off_t offset); +void rte_pci_ioport_read(struct rte_pci_ioport *p, + void *data, size_t len, off_t offset); /** * Write to a io pci resource. @@ -627,8 +627,8 @@ void rte_eal_pci_ioport_read(struct rte_pci_ioport *p, * @param offset * The offset into the pci io resource. */ -void rte_eal_pci_ioport_write(struct rte_pci_ioport *p, - const void *data, size_t len, off_t offset); +void rte_pci_ioport_write(struct rte_pci_ioport *p, + const void *data, size_t len, off_t offset); #ifdef __cplusplus } diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index ab5f8c66e..595622b21 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -88,7 +88,7 @@ pci_get_kernel_driver_by_path(const char *filename, char *dri_name) /* Map pci device */ int -rte_eal_pci_map_device(struct rte_pci_device *dev) +rte_pci_map_device(struct rte_pci_device *dev) { int ret = -1; @@ -119,7 +119,7 @@ rte_eal_pci_map_device(struct rte_pci_device *dev) /* Unmap pci device */ void -rte_eal_pci_unmap_device(struct rte_pci_device *dev) +rte_pci_unmap_device(struct rte_pci_device *dev) { /* try unmapping the NIC resources using VFIO if it exists */ switch (dev->kdrv) { @@ -324,7 +324,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) dev->device.numa_node = tmp; } - rte_eal_pci_device_name(addr, dev->name, sizeof(dev->name)); + rte_pci_device_name(addr, dev->name, sizeof(dev->name)); dev->device.name = dev->name; /* parse resources */ @@ -358,7 +358,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) /* device is valid, add in list (sorted) */ if (TAILQ_EMPTY(&rte_pci_bus.device_list)) { - rte_eal_pci_add_device(dev); + rte_pci_add_device(dev); } else { struct rte_pci_device *dev2; int ret; @@ -369,7 +369,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) continue; if (ret < 0) { - rte_eal_pci_insert_device(dev2, dev); + rte_pci_insert_device(dev2, dev); } else { /* already registered */ dev2->kdrv = dev->kdrv; dev2->max_vfs = dev->max_vfs; @@ -380,7 +380,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) return 0; } - rte_eal_pci_add_device(dev); + rte_pci_add_device(dev); } return 0; @@ -449,7 +449,7 @@ parse_pci_addr_format(const char *buf, int bufsize, struct rte_pci_addr *addr) * list */ int -rte_eal_pci_scan(void) +rte_pci_scan(void) { struct dirent *e; DIR *dir; @@ -489,8 +489,8 @@ rte_eal_pci_scan(void) } /* Read PCI config space. */ -int rte_eal_pci_read_config(const struct rte_pci_device *device, - void *buf, size_t len, off_t offset) +int rte_pci_read_config(const struct rte_pci_device *device, + void *buf, size_t len, off_t offset) { const struct rte_intr_handle *intr_handle = &device->intr_handle; @@ -514,8 +514,8 @@ int rte_eal_pci_read_config(const struct rte_pci_device *device, } /* Write PCI config space. */ -int rte_eal_pci_write_config(const struct rte_pci_device *device, - const void *buf, size_t len, off_t offset) +int rte_pci_write_config(const struct rte_pci_device *device, + const void *buf, size_t len, off_t offset) { const struct rte_intr_handle *intr_handle = &device->intr_handle; @@ -541,7 +541,7 @@ int rte_eal_pci_write_config(const struct rte_pci_device *device, #if defined(RTE_ARCH_X86) static int pci_ioport_map(struct rte_pci_device *dev, int bar __rte_unused, - struct rte_pci_ioport *p) + struct rte_pci_ioport *p) { uint16_t start, end; FILE *fp; @@ -599,8 +599,8 @@ pci_ioport_map(struct rte_pci_device *dev, int bar __rte_unused, #endif int -rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar, - struct rte_pci_ioport *p) +rte_pci_ioport_map(struct rte_pci_device *dev, int bar, + struct rte_pci_ioport *p) { int ret = -1; @@ -637,8 +637,8 @@ rte_eal_pci_ioport_map(struct rte_pci_device *dev, int bar, } void -rte_eal_pci_ioport_read(struct rte_pci_ioport *p, - void *data, size_t len, off_t offset) +rte_pci_ioport_read(struct rte_pci_ioport *p, + void *data, size_t len, off_t offset) { switch (p->dev->kdrv) { #ifdef VFIO_PRESENT @@ -663,8 +663,8 @@ rte_eal_pci_ioport_read(struct rte_pci_ioport *p, } void -rte_eal_pci_ioport_write(struct rte_pci_ioport *p, - const void *data, size_t len, off_t offset) +rte_pci_ioport_write(struct rte_pci_ioport *p, + const void *data, size_t len, off_t offset) { switch (p->dev->kdrv) { #ifdef VFIO_PRESENT @@ -689,7 +689,7 @@ rte_eal_pci_ioport_write(struct rte_pci_ioport *p, } int -rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p) +rte_pci_ioport_unmap(struct rte_pci_ioport *p) { int ret = -1; diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 4607b7658..4595a8d6d 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -35,12 +35,6 @@ DPDK_2.0 { rte_eal_mp_remote_launch; rte_eal_mp_wait_lcore; rte_eal_parse_devargs_str; - rte_eal_pci_dump; - rte_eal_pci_probe; - rte_eal_pci_probe_one; - rte_eal_pci_register; - rte_eal_pci_scan; - rte_eal_pci_unregister; rte_eal_process_type; rte_eal_remote_launch; rte_eal_tailq_lookup; @@ -106,9 +100,6 @@ DPDK_2.0 { DPDK_2.1 { global: - rte_eal_pci_detach; - rte_eal_pci_read_config; - rte_eal_pci_write_config; rte_epoll_ctl; rte_epoll_wait; rte_intr_allow_others; @@ -138,12 +129,6 @@ DPDK_16.04 { global: rte_cpu_get_flag_name; - rte_eal_pci_ioport_map; - rte_eal_pci_ioport_read; - rte_eal_pci_ioport_unmap; - rte_eal_pci_ioport_write; - rte_eal_pci_map_device; - rte_eal_pci_unmap_device; rte_eal_primary_proc_alive; } DPDK_2.2; @@ -193,6 +178,21 @@ DPDK_17.05 { rte_log_set_global_level; rte_log_set_level; rte_log_set_level_regexp; + rte_pci_detach; + rte_pci_dump; + rte_pci_ioport_map; + rte_pci_ioport_read; + rte_pci_ioport_unmap; + rte_pci_ioport_write; + rte_pci_map_device; + rte_pci_probe; + rte_pci_probe_one; + rte_pci_read_config; + rte_pci_register; + rte_pci_scan; + rte_pci_unmap_device; + rte_pci_unregister; + rte_pci_write_config; vfio_get_container_fd; vfio_get_group_fd; vfio_get_group_no; diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 5875eb037..20afc3f0e 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -1263,7 +1263,7 @@ rte_event_pmd_pci_probe(struct rte_pci_driver *pci_drv, if (eventdrv == NULL) return -ENODEV; - rte_eal_pci_device_name(&pci_dev->addr, eventdev_name, + rte_pci_device_name(&pci_dev->addr, eventdev_name, sizeof(eventdev_name)); eventdev = rte_event_pmd_allocate(eventdev_name, @@ -1317,7 +1317,7 @@ rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev) if (pci_dev == NULL) return -EINVAL; - rte_eal_pci_device_name(&pci_dev->addr, eventdev_name, + rte_pci_device_name(&pci_dev->addr, eventdev_name, sizeof(eventdev_name)); eventdev = rte_event_pmd_get_named_dev(eventdev_name); -- 2.12.2