20.11 announced cleanups
cover 20.11 announced cleanups
I put those EAL and PCI cleanups as a single series since I intend to apply them at once with the rte_logs series.
Nothing really hard in this series, but the devil is in the details, reviews welcome.
Signature · 37 lines
David Marchand David Marchand (5): bus/pci: switch to private kernel driver enum pci: move resource mapping to the PCI bus mem: drop mapping API workaround eal: hide internal device event structure bus/pci: remove duplicate declaration doc/guides/rel_notes/deprecation.rst | 18 ------- doc/guides/rel_notes/release_20_11.rst | 12 +++++ drivers/bus/pci/bsd/pci.c | 19 ++++--- drivers/bus/pci/linux/pci.c | 64 +++++++++++------------ drivers/bus/pci/linux/pci_init.h | 2 + drivers/bus/pci/linux/pci_uio.c | 5 +- drivers/bus/pci/linux/pci_vfio.c | 4 +- drivers/bus/pci/pci_common.c | 56 +++++++++++++++++--- drivers/bus/pci/pci_common_uio.c | 2 +- drivers/bus/pci/private.h | 68 ++++++++++++++++++++++++- drivers/bus/pci/rte_bus_pci.h | 11 +++- drivers/bus/pci/windows/pci.c | 6 +-- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hns3/hns3_ethdev_vf.c | 4 +- drivers/net/liquidio/lio_ethdev.c | 4 +- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/virtio/virtio_pci.c | 2 +- lib/librte_eal/include/rte_dev.h | 18 ------- lib/librte_eal/include/rte_eal_paging.h | 10 ---- lib/librte_eal/linux/eal_dev.c | 6 +++ lib/librte_eal/windows/include/rte_os.h | 6 --- lib/librte_pci/rte_pci.c | 42 --------------- lib/librte_pci/rte_pci.h | 66 ------------------------ lib/librte_pci/rte_pci_version.map | 2 - 24 files changed, 201 insertions(+), 230 deletions(-) -- 2.23.0
PATCH 1/5 bus/pci: switch to private kernel driver enum
The rte_kernel_driver enum actually only pointed at PCI drivers and is only used in the PCI subsystem.
Remove it from the generic device API and use a private enum in the PCI code.
--- doc/guides/rel_notes/deprecation.rst | 4 -- doc/guides/rel_notes/release_20_11.rst | 3 ++ drivers/bus/pci/bsd/pci.c | 17 ++++--- drivers/bus/pci/linux/pci.c | 64 ++++++++++++------------- drivers/bus/pci/linux/pci_uio.c | 2 +- drivers/bus/pci/pci_common.c | 16 +++---- drivers/bus/pci/rte_bus_pci.h | 11 ++++- drivers/bus/pci/windows/pci.c | 6 +-- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hns3/hns3_ethdev_vf.c | 4 +- drivers/net/liquidio/lio_ethdev.c | 4 +- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/virtio/virtio_pci.c | 2 +- lib/librte_eal/include/rte_dev.h | 12 ----- 14 files changed, 72 insertions(+), 77 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -4
@@ -124,10 +124,6 @@ Deprecation Notices With this removal, there won't be a need for the mentioned workaround which will be reverted. -* pci: The ``rte_kernel_driver`` enum defined in rte_dev.h will be made private - to the PCI subsystem as it is used only by the PCI bus driver and PCI - drivers. - * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in `this presentation <https://www.youtube.com/watch?v=Ttl6MlhmzWY>`_.
doc/guides/rel_notes/release_20_11.rst +3 -0
@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and + replaced with a private enum in the PCI subsystem. + * ethdev: Removed the ``kdrv`` field in the ethdev ``rte_eth_dev_data`` structure as it gave no useful abstracted information to the applications.
drivers/bus/pci/bsd/pci.c +8 -9
@@ -65,7 +65,7 @@ rte_pci_map_device(struct rte_pci_device *dev)/* try mapping the NIC resources */ switch (dev->kdrv) { -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO :/* map resources for devices that use uio */ ret =pci_uio_map_resource (dev);break ;
@@ -85,7 +85,7 @@ rte_pci_unmap_device(struct rte_pci_device *dev) {/* try unmapping the NIC resources */ switch (dev->kdrv) { -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO :/* unmap resources for devices that use uio */ pci_uio_unmap_resource (dev);break ;
@@ -255,7 +255,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)pci_name_set (dev);/* FreeBSD has only one pass through driver */ - dev->kdrv =RTE_KDRV_NIC_UIO ; + dev->kdrv =RTE_PCI_KDRV_NIC_UIO ;/* parse resources */ switch (conf->pc_hdr &PCIM_HDRTYPE ) {
@@ -395,8 +395,7 @@ enum rte_iova_mode pci_device_iova_mode(const struct rte_pci_driver *pdrv __rte_unused, const struct rte_pci_device *pdev) { -/* Supports only RTE_KDRV_NIC_UIO */ -if (pdev->kdrv !=RTE_KDRV_NIC_UIO ) +if (pdev->kdrv !=RTE_PCI_KDRV_NIC_UIO )RTE_LOG (DEBUG ,EAL ,"Unsupported kernel driver? Defaulting to IOVA as 'PA'\n" );return RTE_IOVA_PA ;
@@ -548,7 +547,7 @@ rte_pci_ioport_map(struct rte_pci_device *dev, int bar,switch (dev->kdrv) {#if defined(RTE_ARCH_X86 ) -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO :if (rte_eal_iopl_init () !=0 ) {RTE_LOG (ERR ,EAL ,"%s(): insufficient ioport permissions for PCI device %s\n" , __func__, dev->name);
@@ -606,7 +605,7 @@ 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: + case RTE_PCI_KDRV_NIC_UIO:pci_uio_ioport_read (p ,data ,len ,offset );break ;default :
@@ -648,7 +647,7 @@ 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: + case RTE_PCI_KDRV_NIC_UIO:pci_uio_ioport_write (p ,data ,len ,offset );break ;default :
@@ -663,7 +662,7 @@ rte_pci_ioport_unmap(struct rte_pci_ioport *p)switch (p->dev->kdrv) {#if defined(RTE_ARCH_X86 ) -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO : ret =0 ;break ;#endif
drivers/bus/pci/linux/pci.c +32 -32
170 lines not on this page · raw message
drivers/bus/pci/linux/pci_uio.c +1 -1
@@ -248,7 +248,7 @@ pci_uio_alloc_resource(struct rte_pci_device *dev, goto error; } -if (dev->kdrv ==RTE_KDRV_IGB_UIO ) +if (dev->kdrv ==RTE_PCI_KDRV_IGB_UIO ) dev->intr_handle.type =RTE_INTR_HANDLE_UIO ;else { dev->intr_handle.type =RTE_INTR_HANDLE_UIO_INTX ;
drivers/bus/pci/pci_common.c +8 -8
@@ -465,7 +465,7 @@ pci_hot_unplug_handler(struct rte_device *dev)switch (pdev->kdrv) {#ifdef HAVE_VFIO_DEV_REQ_INTERFACE -case RTE_KDRV_VFIO : +case RTE_PCI_KDRV_VFIO :/* * vfio kernel module guaranty the pci device would not be * deleted until the user space release the resource, so no
@@ -476,9 +476,9 @@ pci_hot_unplug_handler(struct rte_device *dev) RTE_DEV_EVENT_REMOVE);break ;#endif -case RTE_KDRV_IGB_UIO : -case RTE_KDRV_UIO_GENERIC : -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_IGB_UIO : +case RTE_PCI_KDRV_UIO_GENERIC : +case RTE_PCI_KDRV_NIC_UIO :/* BARs resource is invalid, remap it to be safe. */ ret =pci_uio_remap_resource (pdev);break ;
@@ -552,7 +552,7 @@ pci_dma_map(struct rte_device *dev, void *addr, uint64_t iova, size_t len)* In case driver don't provides any specific mapping * try fallback to VFIO. */ -if (pdev->kdrv ==RTE_KDRV_VFIO ) +if (pdev->kdrv ==RTE_PCI_KDRV_VFIO )return rte_vfio_container_dma_map (RTE_VFIO_DEFAULT_CONTAINER_FD , (uintptr_t )addr, iova, len);
@@ -575,7 +575,7 @@ pci_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova, size_t len)* In case driver don't provides any specific mapping * try fallback to VFIO. */ -if (pdev->kdrv ==RTE_KDRV_VFIO ) +if (pdev->kdrv ==RTE_PCI_KDRV_VFIO )return rte_vfio_container_dma_unmap (RTE_VFIO_DEFAULT_CONTAINER_FD , (uintptr_t )addr, iova, len);
@@ -622,8 +622,8 @@ rte_pci_get_iommu_class(void) iommu_no_va =pci_device_iommu_support_va (dev) ?0 :1 ; -if (dev->kdrv ==RTE_KDRV_UNKNOWN || - dev->kdrv ==RTE_KDRV_NONE ) +if (dev->kdrv ==RTE_PCI_KDRV_UNKNOWN || + dev->kdrv ==RTE_PCI_KDRV_NONE )continue ;FOREACH_DRIVER_ON_PCIBUS (drv) {enum rte_iova_mode dev_iova_mode;
drivers/bus/pci/rte_bus_pci.h +10 -1
@@ -51,6 +51,15 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);struct rte_devargs ; +enum rte_pci_kernel_driver { +RTE_PCI_KDRV_UNKNOWN =0 , +RTE_PCI_KDRV_IGB_UIO , +RTE_PCI_KDRV_VFIO , +RTE_PCI_KDRV_UIO_GENERIC , +RTE_PCI_KDRV_NIC_UIO , +RTE_PCI_KDRV_NONE , +}; +/** * A structure describing a PCI device. */
@@ -64,7 +73,7 @@ struct rte_pci_device {struct rte_intr_handle intr_handle;/**< Interrupt handle */ struct rte_pci_driver *driver;/**< PCI driver used in probing */ uint16_t max_vfs;/**< sriov enable if not zero */ -enum rte_kernel_driver kdrv;/**< Kernel driver passthrough */ +enum rte_pci_kernel_driver kdrv;/**< Kernel driver passthrough */ char name[PCI_PRI_STR_SIZE +1 ];/**< PCI location (ASCII) */ struct rte_intr_handle vfio_req_intr_handle;/**< Handler of VFIO request interrupt */
drivers/bus/pci/windows/pci.c +3 -3
@@ -211,7 +211,7 @@ get_device_resource_info(HDEVINFO dev_info,BOOL res;switch (dev->kdrv) { -case RTE_KDRV_NONE : +case RTE_PCI_KDRV_NONE :/* Get NUMA node using DEVPKEY_Device_Numa_Node */ res = SetupDiGetDevicePropertyW(dev_info, dev_info_data, &DEVPKEY_Device_Numa_Node, &property_type,
@@ -223,7 +223,7 @@ get_device_resource_info(HDEVINFO dev_info,return -1 ; } dev->device.numa_node = numa_node; -/* mem_resource - Unneeded for RTE_KDRV_NONE */ +/* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */ dev->mem_resource[0 ].phys_addr =0 ; dev->mem_resource[0 ].len =0 ; dev->mem_resource[0 ].addr =NULL ;
@@ -292,7 +292,7 @@ get_kernel_driver_type(struct rte_pci_device *dev)* If another kernel driver is supported the relevant checking * functions should be here */ - dev->kdrv =RTE_KDRV_NONE ; + dev->kdrv =RTE_PCI_KDRV_NONE ; } static int
drivers/net/hinic/base/hinic_pmd_hwif.c +1 -1
@@ -280,7 +280,7 @@ void hinic_set_msix_state(void *hwdev, u16 msix_idx, enum hinic_msix_state flag)/* vfio-pci does not mmap msi-x vector table to user space, * we can not access the space when kernel driver is vfio-pci */ -if (hw->pcidev_hdl->kdrv ==RTE_KDRV_VFIO ) +if (hw->pcidev_hdl->kdrv ==RTE_PCI_KDRV_VFIO )return ; mask_bits =readl (hwif->intr_regs_base + offset);
drivers/net/hns3/hns3_ethdev_vf.c +2 -2
@@ -2425,8 +2425,8 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)* UIO enables msix by writing the pcie configuration space * vfio_pci enables msix in rte_intr_enable. */ -if (pci_dev->kdrv ==RTE_KDRV_IGB_UIO || - pci_dev->kdrv ==RTE_KDRV_UIO_GENERIC ) { +if (pci_dev->kdrv ==RTE_PCI_KDRV_IGB_UIO || + pci_dev->kdrv ==RTE_PCI_KDRV_UIO_GENERIC ) {if (hns3vf_enable_msix (pci_dev, true))hns3_err (hw,"Failed to enable msix" ); }
drivers/net/liquidio/lio_ethdev.c +2 -2
@@ -1563,7 +1563,7 @@ lio_dev_close(struct rte_eth_dev *eth_dev)/* Reset ioq regs */ lio_dev->fn_list.setup_device_regs (lio_dev); -if (lio_dev->pci_dev->kdrv ==RTE_KDRV_IGB_UIO ) { +if (lio_dev->pci_dev->kdrv ==RTE_PCI_KDRV_IGB_UIO ) {cn23xx_vf_ask_pf_to_do_flr (lio_dev);rte_delay_ms (LIO_PCI_FLR_WAIT ); }
@@ -2012,7 +2012,7 @@ lio_first_time_init(struct lio_device *lio_dev, goto error;/* Request and wait for device reset. */ -if (pdev->kdrv ==RTE_KDRV_IGB_UIO ) { +if (pdev->kdrv ==RTE_PCI_KDRV_IGB_UIO ) {cn23xx_vf_ask_pf_to_do_flr (lio_dev);/* FLR wait time doubled as a precaution. */ rte_delay_ms (LIO_PCI_FLR_WAIT *2 );
drivers/net/nfp/nfp_net.c +1 -1
@@ -3614,7 +3614,7 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,* interface. Here we avoid this telling to the CPP init code to * use a lock file if UIO is being used. */ -if (dev->kdrv ==RTE_KDRV_VFIO ) +if (dev->kdrv ==RTE_PCI_KDRV_VFIO ) cpp =nfp_cpp_from_device_name (dev,0 );else cpp =nfp_cpp_from_device_name (dev,1 );
drivers/net/virtio/virtio_pci.c +1 -1
@@ -704,7 +704,7 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)PMD_INIT_LOG (INFO ,"trying with legacy virtio pci." );if (rte_pci_ioport_map (dev,0 ,VTPCI_IO (hw)) <0 ) {rte_pci_unmap_device (dev); -if (dev->kdrv ==RTE_KDRV_UNKNOWN && +if (dev->kdrv ==RTE_PCI_KDRV_UNKNOWN && (!dev->device.devargs || dev->device.devargs->bus !=rte_bus_find_by_name ("pci" ))) {
lib/librte_eal/include/rte_dev.h +0 -12
@@ -54,18 +54,6 @@ typedef void (*rte_dev_event_cb_fn)(const char *device_name,return ; \ }while (0 ) -/** -* Device driver. -*/ -enum rte_kernel_driver { -RTE_KDRV_UNKNOWN =0 , -RTE_KDRV_IGB_UIO , -RTE_KDRV_VFIO , -RTE_KDRV_UIO_GENERIC , -RTE_KDRV_NIC_UIO , - RTE_KDRV_NONE, -}; -/** * Device policies. */
Signature · 1 line
2.23.0
PATCH 2/5 pci: move resource mapping to the PCI bus
In reply to David MarchandAs reported during 20.08 work for Windows, the pci_map_resource API was built with the assumption that its flags would be passed to mmap().
This introduced a regression when adding the rte_mem_map API as reported in the workaround commit 9d2b24593724 ("pci: keep API compatibility with mmap values").
This API was only used in the PCI bus code, so move it there. With this move, there is no other user so no ambiguity anymore: the passed additional flags are documented as rte_mem_map API flags.
--- doc/guides/rel_notes/deprecation.rst | 11 ----- doc/guides/rel_notes/release_20_11.rst | 6 +++ drivers/bus/pci/linux/pci_init.h | 2 + drivers/bus/pci/linux/pci_uio.c | 1 + drivers/bus/pci/pci_common.c | 41 ++++++++++++++++ drivers/bus/pci/private.h | 66 ++++++++++++++++++++++++++ lib/librte_pci/rte_pci.c | 42 ---------------- lib/librte_pci/rte_pci.h | 66 -------------------------- lib/librte_pci/rte_pci_version.map | 2 - 9 files changed, 116 insertions(+), 121 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -11
@@ -113,17 +113,6 @@ Deprecation Notices us extending existing enum/define. One solution can be using a fixed size array instead of ``.*MAX.*`` value. -* pci: The PCI resources map API (``pci_map_resource`` and - ``pci_unmap_resource``) was not abstracting the Unix mmap flags (see the - workaround for Windows support implemented in the commit - 9d2b24593724 ("pci: keep API compatibility with mmap values")). - This API will be removed from the public API in 20.11 and moved to the PCI - bus driver along with the PCI resources lists and associated structures - (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and - ``mapped_pci_res_list``). - With this removal, there won't be a need for the mentioned workaround which - will be reverted. - * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in `this presentation <https://www.youtube.com/watch?v=Ttl6MlhmzWY>`_.
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -90,6 +90,12 @@ API Changes * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem. +* pci: Removed the PCI resources map API from the public API + (``pci_map_resource`` and ``pci_unmap_resource``) and moved it to the + PCI bus driver along with the PCI resources lists and associated structures + (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and + ``mapped_pci_res_list``). + * ethdev: Removed the ``kdrv`` field in the ethdev ``rte_eth_dev_data`` structure as it gave no useful abstracted information to the applications.
drivers/bus/pci/linux/pci_init.h +2 -0
@@ -7,6 +7,8 @@#include <rte_vfio.h> +#include "private.h" +/** IO resource type: */ #define IORESOURCE_IO 0x00000100#define IORESOURCE_MEM 0x00000200
drivers/bus/pci/linux/pci_uio.c +1 -0
@@ -25,6 +25,7 @@#include "eal_filesystem.h" #include "pci_init.h" +#include "private.h" void *pci_map_addr =NULL ;
drivers/bus/pci/pci_common.c +41 -0
53 lines not on this page · raw message
drivers/bus/pci/private.h +66 -0
72 lines not on this page · raw message
lib/librte_pci/rte_pci.c +0 -42
45 lines not on this page · raw message
lib/librte_pci/rte_pci.h +0 -66
78 lines not on this page · raw message
lib/librte_pci/rte_pci_version.map +0 -2
@@ -1,8 +1,6 @@ DPDK_21 { global: - pci_map_resource; - pci_unmap_resource; rte_pci_addr_cmp; rte_pci_addr_parse; rte_pci_device_name;
Signature · 1 line
2.23.0
PATCH 3/5 mem: drop mapping API workaround
In reply to David MarchandNow that the pci_map_resource API is private to the PCI bus, we can drop the compatibility workaround we had implemented in 20.08.
--- drivers/bus/pci/bsd/pci.c | 2 +- drivers/bus/pci/linux/pci_uio.c | 2 +- drivers/bus/pci/linux/pci_vfio.c | 4 ++-- drivers/bus/pci/pci_common.c | 1 - drivers/bus/pci/pci_common_uio.c | 2 +- drivers/bus/pci/private.h | 2 +- lib/librte_eal/include/rte_eal_paging.h | 10 ---------- lib/librte_eal/windows/include/rte_os.h | 6 ------ 8 files changed, 6 insertions(+), 23 deletions(-)
drivers/bus/pci/bsd/pci.c +1 -1
@@ -192,7 +192,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, mapaddr =pci_map_resource (NULL , fd, (off_t )offset, (size_t )dev->mem_resource[res_idx].len,0 );close (fd); -if (mapaddr ==MAP_FAILED ) +if (mapaddr ==NULL ) goto error; maps[map_idx].phaddr = dev->mem_resource[res_idx].phys_addr;
drivers/bus/pci/linux/pci_uio.c +1 -1
@@ -346,7 +346,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, mapaddr =pci_map_resource (pci_map_addr, fd,0 , (size_t )dev->mem_resource[res_idx].len,0 );close (fd); -if (mapaddr ==MAP_FAILED ) +if (mapaddr ==NULL ) goto error; pci_map_addr = RTE_PTR_ADD(mapaddr,
drivers/bus/pci/linux/pci_vfio.c +2 -2
@@ -565,7 +565,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res, }/* if there's a second part, try to map it */ -if (map_addr !=MAP_FAILED +if (map_addr !=NULL && memreg[1 ].offset && memreg[1 ].size) { void *second_addr = RTE_PTR_ADD(bar_addr, (uintptr_t)(memreg[1].offset -
@@ -577,7 +577,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res, RTE_MAP_FORCE_ADDRESS); } -if (map_addr ==NULL || map_addr ==MAP_FAILED ) { +if (map_addr ==NULL ) {munmap (bar_addr, bar->size); bar_addr =MAP_FAILED ; RTE_LOG(ERR, EAL, "Failed to map pci BAR%d\n",
drivers/bus/pci/pci_common.c +0 -1
@@ -97,7 +97,6 @@ pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size, __func__, fd, requested_addr, size, (unsigned long long )offset, rte_strerror(rte_errno), mapaddr); - mapaddr =MAP_FAILED ;/* API uses mmap error code */ }else RTE_LOG (DEBUG ,EAL ," PCI memory mapped at %p\n" , mapaddr);
drivers/bus/pci/pci_common_uio.c +1 -1
@@ -58,7 +58,7 @@ pci_uio_map_secondary(struct rte_pci_device *dev)"Cannot mmap device resource file %s to address: %p\n" , uio_res->maps[i].path, uio_res->maps[i].addr); -if (mapaddr !=MAP_FAILED ) { +if (mapaddr !=NULL ) {/* unmap addrs correctly mapped */ for (j =0 ; j < i; j++) pci_unmap_resource(
drivers/bus/pci/private.h +1 -1
@@ -132,7 +132,7 @@ TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);* The additional rte_mem_map() flags for the mapping range. * @return * - On success, the function returns a pointer to the mapped area. -* - On error, MAP_FAILED is returned. +* - On error, NULL is returned. */ void *pci_map_resource (void *requested_addr,int fd,off_t offset,size_t size,int additional_flags);
lib/librte_eal/include/rte_eal_paging.h +0 -10
@@ -3,9 +3,6 @@*/ #include <stdint.h> -#ifndef RTE_EXEC_ENV_WINDOWS -#include <sys/mman.h> -#endif #include <rte_compat.h>
@@ -25,7 +22,6 @@ enum rte_mem_prot {/** Additional flags for memory mapping. */ enum rte_map_flags { -#ifdef RTE_EXEC_ENV_WINDOWS /** Changes to the mapped memory are visible to other processes. */ RTE_MAP_SHARED =1 <<0 ,/** Mapping is not backed by a regular file. */
@@ -39,12 +35,6 @@ enum rte_map_flags {* it is not required to do so, thus mapping with this flag may fail. */ RTE_MAP_FORCE_ADDRESS = 1 << 3 -#else /* map mmap flags because they are exposed in pci_map_resource() API */ -RTE_MAP_SHARED =MAP_SHARED , -RTE_MAP_ANONYMOUS =MAP_ANONYMOUS , -RTE_MAP_PRIVATE =MAP_PRIVATE , - RTE_MAP_FORCE_ADDRESS = MAP_FIXED, -#endif };/**
lib/librte_eal/windows/include/rte_os.h +0 -6
@@ -25,12 +25,6 @@ extern "C" {#define PATH_MAX _MAX_PATH#endif -/* sys/mman.h -* The syscall mmap does not exist on Windows, -* but this error code is used in a badly defined DPDK API for PCI mapping. -*/ -#define MAP_FAILED ((void *) -1) -#define sleep (x) Sleep(1000 * (x))#define strerror_r (a, b, c) strerror_s(b, c, a)
Signature · 1 line
2.23.0
PATCH 4/5 eal: hide internal device event structure
In reply to David MarchandThis structure is not used in the public API.
--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ lib/librte_eal/include/rte_dev.h | 6 ------ lib/librte_eal/linux/eal_dev.c | 6 ++++++ 4 files changed, 9 insertions(+), 9 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -70,9 +70,6 @@ Deprecation Notices * eal: The function ``rte_eal_remote_launch`` will return new error codes after read or write error on the pipe, instead of calling ``rte_panic``. -* eal: The ``rte_dev_event`` structure will be made private to the EAL as no - public API makes use of it. - * rte_atomicNN_xxx: These APIs do not take memory order parameter. This does not allow for writing optimized code for all the CPU architectures supported in DPDK. DPDK will adopt C11 atomic operations semantics and provide wrappers
doc/guides/rel_notes/release_20_11.rst +3 -0
@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* eal: Made the ``rte_dev_event`` structure private to the EAL as no public API + used it. + * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem.
lib/librte_eal/include/rte_dev.h +0 -6
@@ -33,12 +33,6 @@ enum rte_dev_event_type { RTE_DEV_EVENT_MAX /**< max value of this enum */ }; -struct rte_dev_event { -enum rte_dev_event_type type;/**< device event type */ -int subsystem;/**< subsystem id */ -char *devname;/**< device name */ -}; -typedef void (*rte_dev_event_cb_fn )(const char *device_name,enum rte_dev_event_type event,void *cb_arg);
lib/librte_eal/linux/eal_dev.c +6 -0
@@ -133,6 +133,12 @@ dev_uev_socket_fd_create(void)return ret; } +struct rte_dev_event { +enum rte_dev_event_type type;/**< device event type */ +int subsystem;/**< subsystem id */ +char *devname;/**< device name */ +}; +static int dev_uev_parse (const char *buf,struct rte_dev_event *event,int length) {
Signature · 1 line
2.23.0
PATCH 5/5 bus/pci: remove duplicate declaration
In reply to David MarchandThis declaration is the same as the one a few lines before.
--- drivers/bus/pci/private.h | 2 -- 1 file changed, 2 deletions(-)
drivers/bus/pci/private.h +0 -2
@@ -15,8 +15,6 @@ extern struct rte_pci_bus rte_pci_bus;struct rte_pci_driver ;struct rte_pci_device ; -extern struct rte_pci_bus rte_pci_bus; -/** * Scan the content of the PCI bus, and the devices in the devices * list
Signature · 1 line
2.23.0
v2 cover 20.11 announced cleanups
In reply to David MarchandI put those EAL and PCI cleanups as a single series since I intend to apply them at once with the rte_logs series.
Nothing really hard in this series, but the devil is in the details, reviews welcome.
Signature · 49 lines
David Marchand Changelog since v1: - added missing first patch, I suspect this will be a long week... David Marchand (6): ethdev: remove unused kernel driver field bus/pci: switch to private kernel driver enum pci: move resource mapping to the PCI bus mem: drop mapping API workaround eal: hide internal device event structure bus/pci: remove duplicate declaration doc/guides/rel_notes/deprecation.rst | 21 -------- doc/guides/rel_notes/release_20_11.rst | 15 ++++++ drivers/bus/pci/bsd/pci.c | 19 ++++--- drivers/bus/pci/linux/pci.c | 64 +++++++++++------------ drivers/bus/pci/linux/pci_init.h | 2 + drivers/bus/pci/linux/pci_uio.c | 5 +- drivers/bus/pci/linux/pci_vfio.c | 4 +- drivers/bus/pci/pci_common.c | 56 +++++++++++++++++--- drivers/bus/pci/pci_common_uio.c | 2 +- drivers/bus/pci/private.h | 68 ++++++++++++++++++++++++- drivers/bus/pci/rte_bus_pci.h | 11 +++- drivers/bus/pci/windows/pci.c | 6 +-- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hns3/hns3_ethdev_vf.c | 4 +- drivers/net/liquidio/lio_ethdev.c | 4 +- drivers/net/mvneta/mvneta_ethdev.c | 1 - drivers/net/mvpp2/mrvl_ethdev.c | 1 - drivers/net/nfp/nfp_net.c | 2 +- drivers/net/octeontx/octeontx_ethdev.c | 1 - drivers/net/ring/rte_eth_ring.c | 1 - drivers/net/softnic/rte_eth_softnic.c | 1 - drivers/net/virtio/virtio_pci.c | 2 +- lib/librte_eal/include/rte_dev.h | 18 ------- lib/librte_eal/include/rte_eal_paging.h | 10 ---- lib/librte_eal/linux/eal_dev.c | 6 +++ lib/librte_eal/windows/include/rte_os.h | 6 --- lib/librte_ethdev/rte_ethdev_core.h | 1 - lib/librte_ethdev/rte_ethdev_pci.h | 1 - lib/librte_ethdev/rte_ethdev_vdev.h | 1 - lib/librte_pci/rte_pci.c | 42 --------------- lib/librte_pci/rte_pci.h | 66 ------------------------ lib/librte_pci/rte_pci_version.map | 2 - 32 files changed, 204 insertions(+), 241 deletions(-) -- 2.23.0
PATCH v2 1/6 ethdev: remove unused kernel driver field
This field was not generic as it was filled with PCI kernel drivers only. It has no known in-tree user (and I could not find opensource projects using it).
--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ drivers/net/mvneta/mvneta_ethdev.c | 1 - drivers/net/mvpp2/mrvl_ethdev.c | 1 - drivers/net/octeontx/octeontx_ethdev.c | 1 - drivers/net/ring/rte_eth_ring.c | 1 - drivers/net/softnic/rte_eth_softnic.c | 1 - lib/librte_ethdev/rte_ethdev_core.h | 1 - lib/librte_ethdev/rte_ethdev_pci.h | 1 - lib/librte_ethdev/rte_ethdev_vdev.h | 1 - 10 files changed, 3 insertions(+), 11 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -127,9 +127,6 @@ Deprecation Notices * pci: The ``rte_kernel_driver`` enum defined in rte_dev.h will be made private to the PCI subsystem as it is used only by the PCI bus driver and PCI drivers. - The associated field ``kdrv`` in the ethdev ``rte_eth_dev_data`` structure - will be removed as it gave no useful abstracted information to the - applications and had no user (neither internal nor external). * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in
doc/guides/rel_notes/release_20_11.rst +3 -0
@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* ethdev: Removed the ``kdrv`` field in the ethdev ``rte_eth_dev_data`` + structure as it gave no useful abstracted information to the applications. + * rawdev: Added a structure size parameter to the functions ``rte_rawdev_queue_setup()``, ``rte_rawdev_queue_conf_get()``, ``rte_rawdev_info_get()`` and ``rte_rawdev_configure()``,
drivers/net/mvneta/mvneta_ethdev.c +0 -1
@@ -827,7 +827,6 @@ mvneta_eth_dev_create(struct rte_vdev_device *vdev, const char *name)memcpy (eth_dev->data->mac_addrs[0 ].addr_bytes, req.ifr_addr.sa_data,RTE_ETHER_ADDR_LEN ); - eth_dev->data->kdrv =RTE_KDRV_NONE ; eth_dev->device = &vdev->device; eth_dev->rx_pkt_burst = mvneta_rx_pkt_burst;mvneta_set_tx_function (eth_dev);
drivers/net/mvpp2/mrvl_ethdev.c +0 -1
@@ -2856,7 +2856,6 @@ mrvl_eth_dev_create(struct rte_vdev_device *vdev, const char *name)memcpy (eth_dev->data->mac_addrs[0 ].addr_bytes, req.ifr_addr.sa_data,RTE_ETHER_ADDR_LEN ); - eth_dev->data->kdrv =RTE_KDRV_NONE ; eth_dev->device = &vdev->device; eth_dev->rx_pkt_burst = mrvl_rx_pkt_burst;mrvl_set_tx_function (eth_dev);
drivers/net/octeontx/octeontx_ethdev.c +0 -1
@@ -1363,7 +1363,6 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, eth_dev->device = &dev->device; eth_dev->intr_handle =NULL ; - eth_dev->data->kdrv =RTE_KDRV_NONE ; eth_dev->data->numa_node = dev->device.numa_node; data->port_id = eth_dev->data->port_id;
drivers/net/ring/rte_eth_ring.c +0 -1
@@ -326,7 +326,6 @@ do_eth_dev_ring_create(const char *name, data->all_multicast =1 ; eth_dev->dev_ops = &ops; - data->kdrv =RTE_KDRV_NONE ; data->numa_node = numa_node;/* finally assign rx and tx ops */
drivers/net/softnic/rte_eth_softnic.c +0 -1
@@ -391,7 +391,6 @@ pmd_ethdev_register(struct rte_vdev_device *vdev, dev->data->dev_link.link_status =ETH_LINK_DOWN ; dev->data->mac_addrs = ð_addr; dev->data->promiscuous =1 ; - dev->data->kdrv =RTE_KDRV_NONE ; dev->data->numa_node = params->cpu_id;rte_eth_dev_probing_finish (dev);
lib/librte_ethdev/rte_ethdev_core.h +0 -1
@@ -866,7 +866,6 @@ struct rte_eth_dev_data {uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT ];/**< Queues state: HAIRPIN(2) / STARTED(1) / STOPPED(0). */ uint32_t dev_flags;/**< Capabilities. */ -enum rte_kernel_driver kdrv;/**< Kernel driver passthrough. */ int numa_node;/**< NUMA node connection. */ struct rte_vlan_filter_conf vlan_filter_conf;/**< VLAN filter configuration. */
lib/librte_ethdev/rte_ethdev_pci.h +0 -1
@@ -67,7 +67,6 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,if (pci_dev->driver->drv_flags &RTE_PCI_DRV_INTR_RMV ) eth_dev->data->dev_flags |=RTE_ETH_DEV_INTR_RMV ; - eth_dev->data->kdrv = pci_dev->kdrv; eth_dev->data->numa_node = pci_dev->device.numa_node; } }
lib/librte_ethdev/rte_ethdev_vdev.h +0 -1
@@ -74,7 +74,6 @@ rte_eth_vdev_allocate(struct rte_vdev_device *dev, size_t private_data_size) eth_dev->device = &dev->device; eth_dev->intr_handle =NULL ; - eth_dev->data->kdrv =RTE_KDRV_NONE ; eth_dev->data->numa_node = dev->device.numa_node;return eth_dev; }
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH v2 1/6] ethdev: remove unused kernel driver field
Quoted 5 lines · David Marchand
This field was not generic as it was filled with PCI kernel drivers only. It has no known in-tree user (and I could not find opensource projects using it).
Signed-off-by David Marchand <[email protected]>
PATCH v2 2/6 bus/pci: switch to private kernel driver enum
In reply to David MarchandThe rte_kernel_driver enum actually only pointed at PCI drivers and is only used in the PCI subsystem.
Remove it from the generic device API and use a private enum in the PCI code.
--- doc/guides/rel_notes/deprecation.rst | 4 -- doc/guides/rel_notes/release_20_11.rst | 3 ++ drivers/bus/pci/bsd/pci.c | 17 ++++--- drivers/bus/pci/linux/pci.c | 64 ++++++++++++------------- drivers/bus/pci/linux/pci_uio.c | 2 +- drivers/bus/pci/pci_common.c | 16 +++---- drivers/bus/pci/rte_bus_pci.h | 11 ++++- drivers/bus/pci/windows/pci.c | 6 +-- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hns3/hns3_ethdev_vf.c | 4 +- drivers/net/liquidio/lio_ethdev.c | 4 +- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/virtio/virtio_pci.c | 2 +- lib/librte_eal/include/rte_dev.h | 12 ----- 14 files changed, 72 insertions(+), 77 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -4
@@ -124,10 +124,6 @@ Deprecation Notices With this removal, there won't be a need for the mentioned workaround which will be reverted. -* pci: The ``rte_kernel_driver`` enum defined in rte_dev.h will be made private - to the PCI subsystem as it is used only by the PCI bus driver and PCI - drivers. - * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in `this presentation <https://www.youtube.com/watch?v=Ttl6MlhmzWY>`_.
doc/guides/rel_notes/release_20_11.rst +3 -0
@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and + replaced with a private enum in the PCI subsystem. + * ethdev: Removed the ``kdrv`` field in the ethdev ``rte_eth_dev_data`` structure as it gave no useful abstracted information to the applications.
drivers/bus/pci/bsd/pci.c +8 -9
@@ -65,7 +65,7 @@ rte_pci_map_device(struct rte_pci_device *dev)/* try mapping the NIC resources */ switch (dev->kdrv) { -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO :/* map resources for devices that use uio */ ret =pci_uio_map_resource (dev);break ;
@@ -85,7 +85,7 @@ rte_pci_unmap_device(struct rte_pci_device *dev) {/* try unmapping the NIC resources */ switch (dev->kdrv) { -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO :/* unmap resources for devices that use uio */ pci_uio_unmap_resource (dev);break ;
@@ -255,7 +255,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)pci_name_set (dev);/* FreeBSD has only one pass through driver */ - dev->kdrv =RTE_KDRV_NIC_UIO ; + dev->kdrv =RTE_PCI_KDRV_NIC_UIO ;/* parse resources */ switch (conf->pc_hdr &PCIM_HDRTYPE ) {
@@ -395,8 +395,7 @@ enum rte_iova_mode pci_device_iova_mode(const struct rte_pci_driver *pdrv __rte_unused, const struct rte_pci_device *pdev) { -/* Supports only RTE_KDRV_NIC_UIO */ -if (pdev->kdrv !=RTE_KDRV_NIC_UIO ) +if (pdev->kdrv !=RTE_PCI_KDRV_NIC_UIO )RTE_LOG (DEBUG ,EAL ,"Unsupported kernel driver? Defaulting to IOVA as 'PA'\n" );return RTE_IOVA_PA ;
@@ -548,7 +547,7 @@ rte_pci_ioport_map(struct rte_pci_device *dev, int bar,switch (dev->kdrv) {#if defined(RTE_ARCH_X86 ) -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO :if (rte_eal_iopl_init () !=0 ) {RTE_LOG (ERR ,EAL ,"%s(): insufficient ioport permissions for PCI device %s\n" , __func__, dev->name);
@@ -606,7 +605,7 @@ 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: + case RTE_PCI_KDRV_NIC_UIO:pci_uio_ioport_read (p ,data ,len ,offset );break ;default :
@@ -648,7 +647,7 @@ 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: + case RTE_PCI_KDRV_NIC_UIO:pci_uio_ioport_write (p ,data ,len ,offset );break ;default :
@@ -663,7 +662,7 @@ rte_pci_ioport_unmap(struct rte_pci_ioport *p)switch (p->dev->kdrv) {#if defined(RTE_ARCH_X86 ) -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO : ret =0 ;break ;#endif
drivers/bus/pci/linux/pci.c +32 -32
170 lines not on this page · raw message
drivers/bus/pci/linux/pci_uio.c +1 -1
@@ -248,7 +248,7 @@ pci_uio_alloc_resource(struct rte_pci_device *dev, goto error; } -if (dev->kdrv ==RTE_KDRV_IGB_UIO ) +if (dev->kdrv ==RTE_PCI_KDRV_IGB_UIO ) dev->intr_handle.type =RTE_INTR_HANDLE_UIO ;else { dev->intr_handle.type =RTE_INTR_HANDLE_UIO_INTX ;
drivers/bus/pci/pci_common.c +8 -8
@@ -465,7 +465,7 @@ pci_hot_unplug_handler(struct rte_device *dev)switch (pdev->kdrv) {#ifdef HAVE_VFIO_DEV_REQ_INTERFACE -case RTE_KDRV_VFIO : +case RTE_PCI_KDRV_VFIO :/* * vfio kernel module guaranty the pci device would not be * deleted until the user space release the resource, so no
@@ -476,9 +476,9 @@ pci_hot_unplug_handler(struct rte_device *dev) RTE_DEV_EVENT_REMOVE);break ;#endif -case RTE_KDRV_IGB_UIO : -case RTE_KDRV_UIO_GENERIC : -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_IGB_UIO : +case RTE_PCI_KDRV_UIO_GENERIC : +case RTE_PCI_KDRV_NIC_UIO :/* BARs resource is invalid, remap it to be safe. */ ret =pci_uio_remap_resource (pdev);break ;
@@ -552,7 +552,7 @@ pci_dma_map(struct rte_device *dev, void *addr, uint64_t iova, size_t len)* In case driver don't provides any specific mapping * try fallback to VFIO. */ -if (pdev->kdrv ==RTE_KDRV_VFIO ) +if (pdev->kdrv ==RTE_PCI_KDRV_VFIO )return rte_vfio_container_dma_map (RTE_VFIO_DEFAULT_CONTAINER_FD , (uintptr_t )addr, iova, len);
@@ -575,7 +575,7 @@ pci_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova, size_t len)* In case driver don't provides any specific mapping * try fallback to VFIO. */ -if (pdev->kdrv ==RTE_KDRV_VFIO ) +if (pdev->kdrv ==RTE_PCI_KDRV_VFIO )return rte_vfio_container_dma_unmap (RTE_VFIO_DEFAULT_CONTAINER_FD , (uintptr_t )addr, iova, len);
@@ -622,8 +622,8 @@ rte_pci_get_iommu_class(void) iommu_no_va =pci_device_iommu_support_va (dev) ?0 :1 ; -if (dev->kdrv ==RTE_KDRV_UNKNOWN || - dev->kdrv ==RTE_KDRV_NONE ) +if (dev->kdrv ==RTE_PCI_KDRV_UNKNOWN || + dev->kdrv ==RTE_PCI_KDRV_NONE )continue ;FOREACH_DRIVER_ON_PCIBUS (drv) {enum rte_iova_mode dev_iova_mode;
drivers/bus/pci/rte_bus_pci.h +10 -1
@@ -51,6 +51,15 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);struct rte_devargs ; +enum rte_pci_kernel_driver { +RTE_PCI_KDRV_UNKNOWN =0 , +RTE_PCI_KDRV_IGB_UIO , +RTE_PCI_KDRV_VFIO , +RTE_PCI_KDRV_UIO_GENERIC , +RTE_PCI_KDRV_NIC_UIO , +RTE_PCI_KDRV_NONE , +}; +/** * A structure describing a PCI device. */
@@ -64,7 +73,7 @@ struct rte_pci_device {struct rte_intr_handle intr_handle;/**< Interrupt handle */ struct rte_pci_driver *driver;/**< PCI driver used in probing */ uint16_t max_vfs;/**< sriov enable if not zero */ -enum rte_kernel_driver kdrv;/**< Kernel driver passthrough */ +enum rte_pci_kernel_driver kdrv;/**< Kernel driver passthrough */ char name[PCI_PRI_STR_SIZE +1 ];/**< PCI location (ASCII) */ struct rte_intr_handle vfio_req_intr_handle;/**< Handler of VFIO request interrupt */
drivers/bus/pci/windows/pci.c +3 -3
@@ -211,7 +211,7 @@ get_device_resource_info(HDEVINFO dev_info,BOOL res;switch (dev->kdrv) { -case RTE_KDRV_NONE : +case RTE_PCI_KDRV_NONE :/* Get NUMA node using DEVPKEY_Device_Numa_Node */ res = SetupDiGetDevicePropertyW(dev_info, dev_info_data, &DEVPKEY_Device_Numa_Node, &property_type,
@@ -223,7 +223,7 @@ get_device_resource_info(HDEVINFO dev_info,return -1 ; } dev->device.numa_node = numa_node; -/* mem_resource - Unneeded for RTE_KDRV_NONE */ +/* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */ dev->mem_resource[0 ].phys_addr =0 ; dev->mem_resource[0 ].len =0 ; dev->mem_resource[0 ].addr =NULL ;
@@ -292,7 +292,7 @@ get_kernel_driver_type(struct rte_pci_device *dev)* If another kernel driver is supported the relevant checking * functions should be here */ - dev->kdrv =RTE_KDRV_NONE ; + dev->kdrv =RTE_PCI_KDRV_NONE ; } static int
drivers/net/hinic/base/hinic_pmd_hwif.c +1 -1
@@ -280,7 +280,7 @@ void hinic_set_msix_state(void *hwdev, u16 msix_idx, enum hinic_msix_state flag)/* vfio-pci does not mmap msi-x vector table to user space, * we can not access the space when kernel driver is vfio-pci */ -if (hw->pcidev_hdl->kdrv ==RTE_KDRV_VFIO ) +if (hw->pcidev_hdl->kdrv ==RTE_PCI_KDRV_VFIO )return ; mask_bits =readl (hwif->intr_regs_base + offset);
drivers/net/hns3/hns3_ethdev_vf.c +2 -2
@@ -2425,8 +2425,8 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)* UIO enables msix by writing the pcie configuration space * vfio_pci enables msix in rte_intr_enable. */ -if (pci_dev->kdrv ==RTE_KDRV_IGB_UIO || - pci_dev->kdrv ==RTE_KDRV_UIO_GENERIC ) { +if (pci_dev->kdrv ==RTE_PCI_KDRV_IGB_UIO || + pci_dev->kdrv ==RTE_PCI_KDRV_UIO_GENERIC ) {if (hns3vf_enable_msix (pci_dev, true))hns3_err (hw,"Failed to enable msix" ); }
drivers/net/liquidio/lio_ethdev.c +2 -2
@@ -1563,7 +1563,7 @@ lio_dev_close(struct rte_eth_dev *eth_dev)/* Reset ioq regs */ lio_dev->fn_list.setup_device_regs (lio_dev); -if (lio_dev->pci_dev->kdrv ==RTE_KDRV_IGB_UIO ) { +if (lio_dev->pci_dev->kdrv ==RTE_PCI_KDRV_IGB_UIO ) {cn23xx_vf_ask_pf_to_do_flr (lio_dev);rte_delay_ms (LIO_PCI_FLR_WAIT ); }
@@ -2012,7 +2012,7 @@ lio_first_time_init(struct lio_device *lio_dev, goto error;/* Request and wait for device reset. */ -if (pdev->kdrv ==RTE_KDRV_IGB_UIO ) { +if (pdev->kdrv ==RTE_PCI_KDRV_IGB_UIO ) {cn23xx_vf_ask_pf_to_do_flr (lio_dev);/* FLR wait time doubled as a precaution. */ rte_delay_ms (LIO_PCI_FLR_WAIT *2 );
drivers/net/nfp/nfp_net.c +1 -1
@@ -3614,7 +3614,7 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,* interface. Here we avoid this telling to the CPP init code to * use a lock file if UIO is being used. */ -if (dev->kdrv ==RTE_KDRV_VFIO ) +if (dev->kdrv ==RTE_PCI_KDRV_VFIO ) cpp =nfp_cpp_from_device_name (dev,0 );else cpp =nfp_cpp_from_device_name (dev,1 );
drivers/net/virtio/virtio_pci.c +1 -1
@@ -704,7 +704,7 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)PMD_INIT_LOG (INFO ,"trying with legacy virtio pci." );if (rte_pci_ioport_map (dev,0 ,VTPCI_IO (hw)) <0 ) {rte_pci_unmap_device (dev); -if (dev->kdrv ==RTE_KDRV_UNKNOWN && +if (dev->kdrv ==RTE_PCI_KDRV_UNKNOWN && (!dev->device.devargs || dev->device.devargs->bus !=rte_bus_find_by_name ("pci" ))) {
lib/librte_eal/include/rte_dev.h +0 -12
@@ -54,18 +54,6 @@ typedef void (*rte_dev_event_cb_fn)(const char *device_name,return ; \ }while (0 ) -/** -* Device driver. -*/ -enum rte_kernel_driver { -RTE_KDRV_UNKNOWN =0 , -RTE_KDRV_IGB_UIO , -RTE_KDRV_VFIO , -RTE_KDRV_UIO_GENERIC , -RTE_KDRV_NIC_UIO , - RTE_KDRV_NONE, -}; -/** * Device policies. */
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH v2 2/6] bus/pci: switch to private kernel driver enum
Quoted 6 lines · David Marchand
The
rte_kernel_driverenum actually only pointed at PCI drivers and is only used in the PCI subsystem.
Remove it from the generic device API and use a private enum in the PCI code.Signed-off-by David Marchand <[email protected]>
PATCH v2 3/6 pci: move resource mapping to the PCI bus
In reply to David MarchandAs reported during 20.08 work for Windows, the pci_map_resource API was built with the assumption that its flags would be passed to mmap().
This introduced a regression when adding the rte_mem_map API as reported in the workaround commit 9d2b24593724 ("pci: keep API compatibility with mmap values").
This API was only used in the PCI bus code, so move it there. With this move, there is no other user so no ambiguity anymore: the passed additional flags are documented as rte_mem_map API flags.
--- doc/guides/rel_notes/deprecation.rst | 11 ----- doc/guides/rel_notes/release_20_11.rst | 6 +++ drivers/bus/pci/linux/pci_init.h | 2 + drivers/bus/pci/linux/pci_uio.c | 1 + drivers/bus/pci/pci_common.c | 41 ++++++++++++++++ drivers/bus/pci/private.h | 66 ++++++++++++++++++++++++++ lib/librte_pci/rte_pci.c | 42 ---------------- lib/librte_pci/rte_pci.h | 66 -------------------------- lib/librte_pci/rte_pci_version.map | 2 - 9 files changed, 116 insertions(+), 121 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -11
@@ -113,17 +113,6 @@ Deprecation Notices us extending existing enum/define. One solution can be using a fixed size array instead of ``.*MAX.*`` value. -* pci: The PCI resources map API (``pci_map_resource`` and - ``pci_unmap_resource``) was not abstracting the Unix mmap flags (see the - workaround for Windows support implemented in the commit - 9d2b24593724 ("pci: keep API compatibility with mmap values")). - This API will be removed from the public API in 20.11 and moved to the PCI - bus driver along with the PCI resources lists and associated structures - (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and - ``mapped_pci_res_list``). - With this removal, there won't be a need for the mentioned workaround which - will be reverted. - * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in `this presentation <https://www.youtube.com/watch?v=Ttl6MlhmzWY>`_.
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -90,6 +90,12 @@ API Changes * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem. +* pci: Removed the PCI resources map API from the public API + (``pci_map_resource`` and ``pci_unmap_resource``) and moved it to the + PCI bus driver along with the PCI resources lists and associated structures + (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and + ``mapped_pci_res_list``). + * ethdev: Removed the ``kdrv`` field in the ethdev ``rte_eth_dev_data`` structure as it gave no useful abstracted information to the applications.
drivers/bus/pci/linux/pci_init.h +2 -0
@@ -7,6 +7,8 @@#include <rte_vfio.h> +#include "private.h" +/** IO resource type: */ #define IORESOURCE_IO 0x00000100#define IORESOURCE_MEM 0x00000200
drivers/bus/pci/linux/pci_uio.c +1 -0
@@ -25,6 +25,7 @@#include "eal_filesystem.h" #include "pci_init.h" +#include "private.h" void *pci_map_addr =NULL ;
drivers/bus/pci/pci_common.c +41 -0
53 lines not on this page · raw message
drivers/bus/pci/private.h +66 -0
72 lines not on this page · raw message
lib/librte_pci/rte_pci.c +0 -42
45 lines not on this page · raw message
lib/librte_pci/rte_pci.h +0 -66
78 lines not on this page · raw message
lib/librte_pci/rte_pci_version.map +0 -2
@@ -1,8 +1,6 @@ DPDK_21 { global: - pci_map_resource; - pci_unmap_resource; rte_pci_addr_cmp; rte_pci_addr_parse; rte_pci_device_name;
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH v2 3/6] pci: move resource mapping to the PCI bus
Quoted 7 lines · David Marchand
As reported during 20.08 work for Windows, the
pci_map_resourceAPI was built with the assumption that its flags would be passed tommap().This introduced a regression when adding the
rte_mem_mapAPI as reported in the workaround commit9d2b24593724("pci: keep API compatibility with mmap values").
Quoted 5 lines
This API was only used in the PCI bus code, so move it there. With this move, there is no other user so no ambiguity anymore: the passed additional flags are documented as
rte_mem_mapAPI flags.Signed-off-by David Marchand <[email protected]>
PATCH v2 4/6 mem: drop mapping API workaround
In reply to David MarchandNow that the pci_map_resource API is private to the PCI bus, we can drop the compatibility workaround we had implemented in 20.08.
--- drivers/bus/pci/bsd/pci.c | 2 +- drivers/bus/pci/linux/pci_uio.c | 2 +- drivers/bus/pci/linux/pci_vfio.c | 4 ++-- drivers/bus/pci/pci_common.c | 1 - drivers/bus/pci/pci_common_uio.c | 2 +- drivers/bus/pci/private.h | 2 +- lib/librte_eal/include/rte_eal_paging.h | 10 ---------- lib/librte_eal/windows/include/rte_os.h | 6 ------ 8 files changed, 6 insertions(+), 23 deletions(-)
drivers/bus/pci/bsd/pci.c +1 -1
@@ -192,7 +192,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, mapaddr =pci_map_resource (NULL , fd, (off_t )offset, (size_t )dev->mem_resource[res_idx].len,0 );close (fd); -if (mapaddr ==MAP_FAILED ) +if (mapaddr ==NULL ) goto error; maps[map_idx].phaddr = dev->mem_resource[res_idx].phys_addr;
drivers/bus/pci/linux/pci_uio.c +1 -1
@@ -346,7 +346,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, mapaddr =pci_map_resource (pci_map_addr, fd,0 , (size_t )dev->mem_resource[res_idx].len,0 );close (fd); -if (mapaddr ==MAP_FAILED ) +if (mapaddr ==NULL ) goto error; pci_map_addr = RTE_PTR_ADD(mapaddr,
drivers/bus/pci/linux/pci_vfio.c +2 -2
@@ -565,7 +565,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res, }/* if there's a second part, try to map it */ -if (map_addr !=MAP_FAILED +if (map_addr !=NULL && memreg[1 ].offset && memreg[1 ].size) { void *second_addr = RTE_PTR_ADD(bar_addr, (uintptr_t)(memreg[1].offset -
@@ -577,7 +577,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res, RTE_MAP_FORCE_ADDRESS); } -if (map_addr ==NULL || map_addr ==MAP_FAILED ) { +if (map_addr ==NULL ) {munmap (bar_addr, bar->size); bar_addr =MAP_FAILED ; RTE_LOG(ERR, EAL, "Failed to map pci BAR%d\n",
drivers/bus/pci/pci_common.c +0 -1
@@ -97,7 +97,6 @@ pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size, __func__, fd, requested_addr, size, (unsigned long long )offset, rte_strerror(rte_errno), mapaddr); - mapaddr =MAP_FAILED ;/* API uses mmap error code */ }else RTE_LOG (DEBUG ,EAL ," PCI memory mapped at %p\n" , mapaddr);
drivers/bus/pci/pci_common_uio.c +1 -1
@@ -58,7 +58,7 @@ pci_uio_map_secondary(struct rte_pci_device *dev)"Cannot mmap device resource file %s to address: %p\n" , uio_res->maps[i].path, uio_res->maps[i].addr); -if (mapaddr !=MAP_FAILED ) { +if (mapaddr !=NULL ) {/* unmap addrs correctly mapped */ for (j =0 ; j < i; j++) pci_unmap_resource(
drivers/bus/pci/private.h +1 -1
@@ -132,7 +132,7 @@ TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);* The additional rte_mem_map() flags for the mapping range. * @return * - On success, the function returns a pointer to the mapped area. -* - On error, MAP_FAILED is returned. +* - On error, NULL is returned. */ void *pci_map_resource (void *requested_addr,int fd,off_t offset,size_t size,int additional_flags);
lib/librte_eal/include/rte_eal_paging.h +0 -10
@@ -3,9 +3,6 @@*/ #include <stdint.h> -#ifndef RTE_EXEC_ENV_WINDOWS -#include <sys/mman.h> -#endif #include <rte_compat.h>
@@ -25,7 +22,6 @@ enum rte_mem_prot {/** Additional flags for memory mapping. */ enum rte_map_flags { -#ifdef RTE_EXEC_ENV_WINDOWS /** Changes to the mapped memory are visible to other processes. */ RTE_MAP_SHARED =1 <<0 ,/** Mapping is not backed by a regular file. */
@@ -39,12 +35,6 @@ enum rte_map_flags {* it is not required to do so, thus mapping with this flag may fail. */ RTE_MAP_FORCE_ADDRESS = 1 << 3 -#else /* map mmap flags because they are exposed in pci_map_resource() API */ -RTE_MAP_SHARED =MAP_SHARED , -RTE_MAP_ANONYMOUS =MAP_ANONYMOUS , -RTE_MAP_PRIVATE =MAP_PRIVATE , - RTE_MAP_FORCE_ADDRESS = MAP_FIXED, -#endif };/**
lib/librte_eal/windows/include/rte_os.h +0 -6
@@ -25,12 +25,6 @@ extern "C" {#define PATH_MAX _MAX_PATH#endif -/* sys/mman.h -* The syscall mmap does not exist on Windows, -* but this error code is used in a badly defined DPDK API for PCI mapping. -*/ -#define MAP_FAILED ((void *) -1) -#define sleep (x) Sleep(1000 * (x))#define strerror_r (a, b, c) strerror_s(b, c, a)
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH v2 4/6] mem: drop mapping API workaround
Quoted 4 lines · David Marchand
Now that the
pci_map_resourceAPI is private to the PCI bus, we can drop the compatibility workaround we had implemented in 20.08.Signed-off-by David Marchand <[email protected]>
PATCH v2 5/6 eal: hide internal device event structure
In reply to David MarchandThis structure is not used in the public API.
--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ lib/librte_eal/include/rte_dev.h | 6 ------ lib/librte_eal/linux/eal_dev.c | 6 ++++++ 4 files changed, 9 insertions(+), 9 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -70,9 +70,6 @@ Deprecation Notices * eal: The function ``rte_eal_remote_launch`` will return new error codes after read or write error on the pipe, instead of calling ``rte_panic``. -* eal: The ``rte_dev_event`` structure will be made private to the EAL as no - public API makes use of it. - * rte_atomicNN_xxx: These APIs do not take memory order parameter. This does not allow for writing optimized code for all the CPU architectures supported in DPDK. DPDK will adopt C11 atomic operations semantics and provide wrappers
doc/guides/rel_notes/release_20_11.rst +3 -0
@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* eal: Made the ``rte_dev_event`` structure private to the EAL as no public API + used it. + * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem.
lib/librte_eal/include/rte_dev.h +0 -6
@@ -33,12 +33,6 @@ enum rte_dev_event_type { RTE_DEV_EVENT_MAX /**< max value of this enum */ }; -struct rte_dev_event { -enum rte_dev_event_type type;/**< device event type */ -int subsystem;/**< subsystem id */ -char *devname;/**< device name */ -}; -typedef void (*rte_dev_event_cb_fn )(const char *device_name,enum rte_dev_event_type event,void *cb_arg);
lib/librte_eal/linux/eal_dev.c +6 -0
@@ -133,6 +133,12 @@ dev_uev_socket_fd_create(void)return ret; } +struct rte_dev_event { +enum rte_dev_event_type type;/**< device event type */ +int subsystem;/**< subsystem id */ +char *devname;/**< device name */ +}; +static int dev_uev_parse (const char *buf,struct rte_dev_event *event,int length) {
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH v2 5/6] eal: hide internal device event structure
Quoted 65 lines · David Marchand
This structure is not used in the public API.
Fixes a753e53d517b ("eal: add device event monitor framework")Signed-off-by David Marchand <[email protected]>--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ lib/librte_eal/include/rte_dev.h | 6 ------ lib/librte_eal/linux/eal_dev.c | 6 ++++++ 4 files changed, 9 insertions(+), 9 deletions(-)doc/guides/rel_notes/deprecation.rst +0
-3@@ -70,9 +70,6 @@ Deprecation Notices * eal: The function ``rte_eal_remote_launch`` will return new error codes after read or write error on the pipe, instead of calling ``rte_panic``. -* eal: The ``rte_dev_event`` structure will be made private to the EAL as no - public API makes use of it. - * rte_atomicNN_xxx: These APIs do not take memory order parameter. This does not allow for writing optimized code for all the CPU architectures supported in DPDK. DPDK will adopt C11 atomic operations semantics and provide wrappersdoc/guides/rel_notes/release_20_11.rst +3
-0@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* eal: Made the ``rte_dev_event`` structure private to the EAL as no public API + used it. + * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem.lib/librte_eal/include/rte_dev.h +0
-6@@ -33,12 +33,6 @@ enum rte_dev_event_type { RTE_DEV_EVENT_MAX /**< max value of this enum */ }; -struct rte_dev_event { -enum rte_dev_event_type type;/**< device event type */ -int subsystem;/**< subsystem id */ -char *devname;/**< device name */ -}; -typedef void (*rte_dev_event_cb_fn )(const char *device_name,enum rte_dev_event_type event,void *cb_arg);lib/librte_eal/linux/eal_dev.c +0
-0@@ -133,6 +133,12 @@ dev_uev_socket_fd_create(void)return ret; }
lib/librte_eal/linux/eal_dev.c dev_uev_socket_fd_create(void) · line 144
Quoted 10 lines
lib/librte_eal/linux/eal_dev.c +6
-0+struct rte_dev_event { +enum rte_dev_event_type type;/**< device event type */ +int subsystem;/**< subsystem id */ +char *devname;/**< device name */ +}; +static int dev_uev_parse (const char *buf,struct rte_dev_event *event,int length) {
PATCH v2 6/6 bus/pci: remove duplicate declaration
In reply to David MarchandThis declaration is the same as the one a few lines before.
--- drivers/bus/pci/private.h | 2 -- 1 file changed, 2 deletions(-)
drivers/bus/pci/private.h +0 -2
@@ -15,8 +15,6 @@ extern struct rte_pci_bus rte_pci_bus;struct rte_pci_driver ;struct rte_pci_device ; -extern struct rte_pci_bus rte_pci_bus; -/** * Scan the content of the PCI bus, and the devices in the devices * list
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH v2 6/6] bus/pci: remove duplicate declaration
Quoted 6 lines · David Marchand
This declaration is the same as the one a few lines before.
Fixes 6844d146ff39 ("eal: add bus pointer in device structure")Signed-off-by David Marchand <[email protected]>
v3 cover 20.11 announced cleanups
In reply to David MarchandI put those EAL and PCI cleanups as a single series since I intend to apply them at once with the rte_logs series.
Nothing really hard in this series, but the devil is in the details, reviews welcome.
Signature · 52 lines
David Marchand Changelog since v2: - no change: rebased, added acks, reworded patch3 commitlog for Thomas, Changelog since v1: - added missing first patch, I suspect this will be a long week... David Marchand (6): ethdev: remove unused kernel driver field bus/pci: switch to private kernel driver enum pci: move resource mapping to the PCI bus mem: drop mapping API workaround eal: hide internal device event structure bus/pci: remove duplicate declaration doc/guides/rel_notes/deprecation.rst | 21 -------- doc/guides/rel_notes/release_20_11.rst | 15 ++++++ drivers/bus/pci/bsd/pci.c | 19 ++++--- drivers/bus/pci/linux/pci.c | 64 +++++++++++------------ drivers/bus/pci/linux/pci_init.h | 2 + drivers/bus/pci/linux/pci_uio.c | 5 +- drivers/bus/pci/linux/pci_vfio.c | 4 +- drivers/bus/pci/pci_common.c | 56 ++++++++++++++++++--- drivers/bus/pci/pci_common_uio.c | 2 +- drivers/bus/pci/private.h | 67 ++++++++++++++++++++++++- drivers/bus/pci/rte_bus_pci.h | 11 +++- drivers/bus/pci/windows/pci.c | 6 +-- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hns3/hns3_ethdev_vf.c | 4 +- drivers/net/liquidio/lio_ethdev.c | 4 +- drivers/net/mvneta/mvneta_ethdev.c | 1 - drivers/net/mvpp2/mrvl_ethdev.c | 1 - drivers/net/nfp/nfp_net.c | 2 +- drivers/net/octeontx/octeontx_ethdev.c | 1 - drivers/net/ring/rte_eth_ring.c | 1 - drivers/net/softnic/rte_eth_softnic.c | 1 - drivers/net/virtio/virtio_pci.c | 2 +- lib/librte_eal/include/rte_dev.h | 18 ------- lib/librte_eal/include/rte_eal_paging.h | 10 ---- lib/librte_eal/linux/eal_dev.c | 6 +++ lib/librte_eal/windows/include/rte_os.h | 6 --- lib/librte_ethdev/rte_ethdev_core.h | 1 - lib/librte_ethdev/rte_ethdev_pci.h | 1 - lib/librte_ethdev/rte_ethdev_vdev.h | 1 - lib/librte_pci/rte_pci.c | 42 ---------------- lib/librte_pci/rte_pci.h | 66 ------------------------ lib/librte_pci/rte_pci_version.map | 2 - 32 files changed, 203 insertions(+), 241 deletions(-) -- 2.23.0
PATCH v3 1/6 ethdev: remove unused kernel driver field
This field was not generic as it was filled with PCI kernel drivers only. It has no known in-tree user (and I could not find opensource projects using it).
--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ drivers/net/mvneta/mvneta_ethdev.c | 1 - drivers/net/mvpp2/mrvl_ethdev.c | 1 - drivers/net/octeontx/octeontx_ethdev.c | 1 - drivers/net/ring/rte_eth_ring.c | 1 - drivers/net/softnic/rte_eth_softnic.c | 1 - lib/librte_ethdev/rte_ethdev_core.h | 1 - lib/librte_ethdev/rte_ethdev_pci.h | 1 - lib/librte_ethdev/rte_ethdev_vdev.h | 1 - 10 files changed, 3 insertions(+), 11 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -127,9 +127,6 @@ Deprecation Notices * pci: The ``rte_kernel_driver`` enum defined in rte_dev.h will be made private to the PCI subsystem as it is used only by the PCI bus driver and PCI drivers. - The associated field ``kdrv`` in the ethdev ``rte_eth_dev_data`` structure - will be removed as it gave no useful abstracted information to the - applications and had no user (neither internal nor external). * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in
doc/guides/rel_notes/release_20_11.rst +3 -0
@@ -91,6 +91,9 @@ API Changes the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``. The field ``refcnt`` is remaining from the old unions. +* ethdev: Removed the ``kdrv`` field in the ethdev ``rte_eth_dev_data`` + structure as it gave no useful abstracted information to the applications. + * rawdev: Added a structure size parameter to the functions ``rte_rawdev_queue_setup()``, ``rte_rawdev_queue_conf_get()``, ``rte_rawdev_info_get()`` and ``rte_rawdev_configure()``,
drivers/net/mvneta/mvneta_ethdev.c +0 -1
@@ -827,7 +827,6 @@ mvneta_eth_dev_create(struct rte_vdev_device *vdev, const char *name)memcpy (eth_dev->data->mac_addrs[0 ].addr_bytes, req.ifr_addr.sa_data,RTE_ETHER_ADDR_LEN ); - eth_dev->data->kdrv =RTE_KDRV_NONE ; eth_dev->device = &vdev->device; eth_dev->rx_pkt_burst = mvneta_rx_pkt_burst;mvneta_set_tx_function (eth_dev);
drivers/net/mvpp2/mrvl_ethdev.c +0 -1
@@ -2856,7 +2856,6 @@ mrvl_eth_dev_create(struct rte_vdev_device *vdev, const char *name)memcpy (eth_dev->data->mac_addrs[0 ].addr_bytes, req.ifr_addr.sa_data,RTE_ETHER_ADDR_LEN ); - eth_dev->data->kdrv =RTE_KDRV_NONE ; eth_dev->device = &vdev->device; eth_dev->rx_pkt_burst = mrvl_rx_pkt_burst;mrvl_set_tx_function (eth_dev);
drivers/net/octeontx/octeontx_ethdev.c +0 -1
@@ -1363,7 +1363,6 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, eth_dev->device = &dev->device; eth_dev->intr_handle =NULL ; - eth_dev->data->kdrv =RTE_KDRV_NONE ; eth_dev->data->numa_node = dev->device.numa_node; data->port_id = eth_dev->data->port_id;
drivers/net/ring/rte_eth_ring.c +0 -1
@@ -326,7 +326,6 @@ do_eth_dev_ring_create(const char *name, data->all_multicast =1 ; eth_dev->dev_ops = &ops; - data->kdrv =RTE_KDRV_NONE ; data->numa_node = numa_node;/* finally assign rx and tx ops */
drivers/net/softnic/rte_eth_softnic.c +0 -1
@@ -391,7 +391,6 @@ pmd_ethdev_register(struct rte_vdev_device *vdev, dev->data->dev_link.link_status =ETH_LINK_DOWN ; dev->data->mac_addrs = ð_addr; dev->data->promiscuous =1 ; - dev->data->kdrv =RTE_KDRV_NONE ; dev->data->numa_node = params->cpu_id;rte_eth_dev_probing_finish (dev);
lib/librte_ethdev/rte_ethdev_core.h +0 -1
@@ -866,7 +866,6 @@ struct rte_eth_dev_data {uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT ];/**< Queues state: HAIRPIN(2) / STARTED(1) / STOPPED(0). */ uint32_t dev_flags;/**< Capabilities. */ -enum rte_kernel_driver kdrv;/**< Kernel driver passthrough. */ int numa_node;/**< NUMA node connection. */ struct rte_vlan_filter_conf vlan_filter_conf;/**< VLAN filter configuration. */
lib/librte_ethdev/rte_ethdev_pci.h +0 -1
@@ -67,7 +67,6 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,if (pci_dev->driver->drv_flags &RTE_PCI_DRV_INTR_RMV ) eth_dev->data->dev_flags |=RTE_ETH_DEV_INTR_RMV ; - eth_dev->data->kdrv = pci_dev->kdrv; eth_dev->data->numa_node = pci_dev->device.numa_node; } }
lib/librte_ethdev/rte_ethdev_vdev.h +0 -1
@@ -74,7 +74,6 @@ rte_eth_vdev_allocate(struct rte_vdev_device *dev, size_t private_data_size) eth_dev->device = &dev->device; eth_dev->intr_handle =NULL ; - eth_dev->data->kdrv =RTE_KDRV_NONE ; eth_dev->data->numa_node = dev->device.numa_node;return eth_dev; }
Signature · 1 line
2.23.0
PATCH v3 2/6 bus/pci: switch to private kernel driver enum
In reply to David MarchandThe rte_kernel_driver enum actually only pointed at PCI drivers and is only used in the PCI subsystem.
Remove it from the generic device API and use a private enum in the PCI code.
--- doc/guides/rel_notes/deprecation.rst | 4 -- doc/guides/rel_notes/release_20_11.rst | 3 ++ drivers/bus/pci/bsd/pci.c | 17 ++++--- drivers/bus/pci/linux/pci.c | 64 ++++++++++++------------- drivers/bus/pci/linux/pci_uio.c | 2 +- drivers/bus/pci/pci_common.c | 16 +++---- drivers/bus/pci/rte_bus_pci.h | 11 ++++- drivers/bus/pci/windows/pci.c | 6 +-- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hns3/hns3_ethdev_vf.c | 4 +- drivers/net/liquidio/lio_ethdev.c | 4 +- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/virtio/virtio_pci.c | 2 +- lib/librte_eal/include/rte_dev.h | 12 ----- 14 files changed, 72 insertions(+), 77 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -4
@@ -124,10 +124,6 @@ Deprecation Notices With this removal, there won't be a need for the mentioned workaround which will be reverted. -* pci: The ``rte_kernel_driver`` enum defined in rte_dev.h will be made private - to the PCI subsystem as it is used only by the PCI bus driver and PCI - drivers. - * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in `this presentation <https://www.youtube.com/watch?v=Ttl6MlhmzWY>`_.
doc/guides/rel_notes/release_20_11.rst +3 -0
@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and + replaced with a private enum in the PCI subsystem. + * mbuf: Removed the unioned field ``refcnt_atomic`` from the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``. The field ``refcnt`` is remaining from the old unions.
drivers/bus/pci/bsd/pci.c +8 -9
@@ -65,7 +65,7 @@ rte_pci_map_device(struct rte_pci_device *dev)/* try mapping the NIC resources */ switch (dev->kdrv) { -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO :/* map resources for devices that use uio */ ret =pci_uio_map_resource (dev);break ;
@@ -85,7 +85,7 @@ rte_pci_unmap_device(struct rte_pci_device *dev) {/* try unmapping the NIC resources */ switch (dev->kdrv) { -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO :/* unmap resources for devices that use uio */ pci_uio_unmap_resource (dev);break ;
@@ -255,7 +255,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)pci_name_set (dev);/* FreeBSD has only one pass through driver */ - dev->kdrv =RTE_KDRV_NIC_UIO ; + dev->kdrv =RTE_PCI_KDRV_NIC_UIO ;/* parse resources */ switch (conf->pc_hdr &PCIM_HDRTYPE ) {
@@ -395,8 +395,7 @@ enum rte_iova_mode pci_device_iova_mode(const struct rte_pci_driver *pdrv __rte_unused, const struct rte_pci_device *pdev) { -/* Supports only RTE_KDRV_NIC_UIO */ -if (pdev->kdrv !=RTE_KDRV_NIC_UIO ) +if (pdev->kdrv !=RTE_PCI_KDRV_NIC_UIO )RTE_LOG (DEBUG ,EAL ,"Unsupported kernel driver? Defaulting to IOVA as 'PA'\n" );return RTE_IOVA_PA ;
@@ -548,7 +547,7 @@ rte_pci_ioport_map(struct rte_pci_device *dev, int bar,switch (dev->kdrv) {#if defined(RTE_ARCH_X86 ) -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO :if (rte_eal_iopl_init () !=0 ) {RTE_LOG (ERR ,EAL ,"%s(): insufficient ioport permissions for PCI device %s\n" , __func__, dev->name);
@@ -606,7 +605,7 @@ 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: + case RTE_PCI_KDRV_NIC_UIO:pci_uio_ioport_read (p ,data ,len ,offset );break ;default :
@@ -648,7 +647,7 @@ 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: + case RTE_PCI_KDRV_NIC_UIO:pci_uio_ioport_write (p ,data ,len ,offset );break ;default :
@@ -663,7 +662,7 @@ rte_pci_ioport_unmap(struct rte_pci_ioport *p)switch (p->dev->kdrv) {#if defined(RTE_ARCH_X86 ) -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_NIC_UIO : ret =0 ;break ;#endif
drivers/bus/pci/linux/pci.c +32 -32
170 lines not on this page · raw message
drivers/bus/pci/linux/pci_uio.c +1 -1
@@ -248,7 +248,7 @@ pci_uio_alloc_resource(struct rte_pci_device *dev, goto error; } -if (dev->kdrv ==RTE_KDRV_IGB_UIO ) +if (dev->kdrv ==RTE_PCI_KDRV_IGB_UIO ) dev->intr_handle.type =RTE_INTR_HANDLE_UIO ;else { dev->intr_handle.type =RTE_INTR_HANDLE_UIO_INTX ;
drivers/bus/pci/pci_common.c +8 -8
@@ -465,7 +465,7 @@ pci_hot_unplug_handler(struct rte_device *dev)switch (pdev->kdrv) {#ifdef HAVE_VFIO_DEV_REQ_INTERFACE -case RTE_KDRV_VFIO : +case RTE_PCI_KDRV_VFIO :/* * vfio kernel module guaranty the pci device would not be * deleted until the user space release the resource, so no
@@ -476,9 +476,9 @@ pci_hot_unplug_handler(struct rte_device *dev) RTE_DEV_EVENT_REMOVE);break ;#endif -case RTE_KDRV_IGB_UIO : -case RTE_KDRV_UIO_GENERIC : -case RTE_KDRV_NIC_UIO : +case RTE_PCI_KDRV_IGB_UIO : +case RTE_PCI_KDRV_UIO_GENERIC : +case RTE_PCI_KDRV_NIC_UIO :/* BARs resource is invalid, remap it to be safe. */ ret =pci_uio_remap_resource (pdev);break ;
@@ -552,7 +552,7 @@ pci_dma_map(struct rte_device *dev, void *addr, uint64_t iova, size_t len)* In case driver don't provides any specific mapping * try fallback to VFIO. */ -if (pdev->kdrv ==RTE_KDRV_VFIO ) +if (pdev->kdrv ==RTE_PCI_KDRV_VFIO )return rte_vfio_container_dma_map (RTE_VFIO_DEFAULT_CONTAINER_FD , (uintptr_t )addr, iova, len);
@@ -575,7 +575,7 @@ pci_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova, size_t len)* In case driver don't provides any specific mapping * try fallback to VFIO. */ -if (pdev->kdrv ==RTE_KDRV_VFIO ) +if (pdev->kdrv ==RTE_PCI_KDRV_VFIO )return rte_vfio_container_dma_unmap (RTE_VFIO_DEFAULT_CONTAINER_FD , (uintptr_t )addr, iova, len);
@@ -622,8 +622,8 @@ rte_pci_get_iommu_class(void) iommu_no_va =pci_device_iommu_support_va (dev) ?0 :1 ; -if (dev->kdrv ==RTE_KDRV_UNKNOWN || - dev->kdrv ==RTE_KDRV_NONE ) +if (dev->kdrv ==RTE_PCI_KDRV_UNKNOWN || + dev->kdrv ==RTE_PCI_KDRV_NONE )continue ;FOREACH_DRIVER_ON_PCIBUS (drv) {enum rte_iova_mode dev_iova_mode;
drivers/bus/pci/rte_bus_pci.h +10 -1
@@ -51,6 +51,15 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);struct rte_devargs ; +enum rte_pci_kernel_driver { +RTE_PCI_KDRV_UNKNOWN =0 , +RTE_PCI_KDRV_IGB_UIO , +RTE_PCI_KDRV_VFIO , +RTE_PCI_KDRV_UIO_GENERIC , +RTE_PCI_KDRV_NIC_UIO , +RTE_PCI_KDRV_NONE , +}; +/** * A structure describing a PCI device. */
@@ -64,7 +73,7 @@ struct rte_pci_device {struct rte_intr_handle intr_handle;/**< Interrupt handle */ struct rte_pci_driver *driver;/**< PCI driver used in probing */ uint16_t max_vfs;/**< sriov enable if not zero */ -enum rte_kernel_driver kdrv;/**< Kernel driver passthrough */ +enum rte_pci_kernel_driver kdrv;/**< Kernel driver passthrough */ char name[PCI_PRI_STR_SIZE +1 ];/**< PCI location (ASCII) */ struct rte_intr_handle vfio_req_intr_handle;/**< Handler of VFIO request interrupt */
drivers/bus/pci/windows/pci.c +3 -3
@@ -211,7 +211,7 @@ get_device_resource_info(HDEVINFO dev_info,BOOL res;switch (dev->kdrv) { -case RTE_KDRV_NONE : +case RTE_PCI_KDRV_NONE :/* Get NUMA node using DEVPKEY_Device_Numa_Node */ res = SetupDiGetDevicePropertyW(dev_info, dev_info_data, &DEVPKEY_Device_Numa_Node, &property_type,
@@ -223,7 +223,7 @@ get_device_resource_info(HDEVINFO dev_info,return -1 ; } dev->device.numa_node = numa_node; -/* mem_resource - Unneeded for RTE_KDRV_NONE */ +/* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */ dev->mem_resource[0 ].phys_addr =0 ; dev->mem_resource[0 ].len =0 ; dev->mem_resource[0 ].addr =NULL ;
@@ -292,7 +292,7 @@ get_kernel_driver_type(struct rte_pci_device *dev)* If another kernel driver is supported the relevant checking * functions should be here */ - dev->kdrv =RTE_KDRV_NONE ; + dev->kdrv =RTE_PCI_KDRV_NONE ; } static int
drivers/net/hinic/base/hinic_pmd_hwif.c +1 -1
@@ -280,7 +280,7 @@ void hinic_set_msix_state(void *hwdev, u16 msix_idx, enum hinic_msix_state flag)/* vfio-pci does not mmap msi-x vector table to user space, * we can not access the space when kernel driver is vfio-pci */ -if (hw->pcidev_hdl->kdrv ==RTE_KDRV_VFIO ) +if (hw->pcidev_hdl->kdrv ==RTE_PCI_KDRV_VFIO )return ; mask_bits =readl (hwif->intr_regs_base + offset);
drivers/net/hns3/hns3_ethdev_vf.c +2 -2
@@ -2425,8 +2425,8 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)* UIO enables msix by writing the pcie configuration space * vfio_pci enables msix in rte_intr_enable. */ -if (pci_dev->kdrv ==RTE_KDRV_IGB_UIO || - pci_dev->kdrv ==RTE_KDRV_UIO_GENERIC ) { +if (pci_dev->kdrv ==RTE_PCI_KDRV_IGB_UIO || + pci_dev->kdrv ==RTE_PCI_KDRV_UIO_GENERIC ) {if (hns3vf_enable_msix (pci_dev, true))hns3_err (hw,"Failed to enable msix" ); }
drivers/net/liquidio/lio_ethdev.c +2 -2
@@ -1563,7 +1563,7 @@ lio_dev_close(struct rte_eth_dev *eth_dev)/* Reset ioq regs */ lio_dev->fn_list.setup_device_regs (lio_dev); -if (lio_dev->pci_dev->kdrv ==RTE_KDRV_IGB_UIO ) { +if (lio_dev->pci_dev->kdrv ==RTE_PCI_KDRV_IGB_UIO ) {cn23xx_vf_ask_pf_to_do_flr (lio_dev);rte_delay_ms (LIO_PCI_FLR_WAIT ); }
@@ -2012,7 +2012,7 @@ lio_first_time_init(struct lio_device *lio_dev, goto error;/* Request and wait for device reset. */ -if (pdev->kdrv ==RTE_KDRV_IGB_UIO ) { +if (pdev->kdrv ==RTE_PCI_KDRV_IGB_UIO ) {cn23xx_vf_ask_pf_to_do_flr (lio_dev);/* FLR wait time doubled as a precaution. */ rte_delay_ms (LIO_PCI_FLR_WAIT *2 );
drivers/net/nfp/nfp_net.c +1 -1
@@ -3614,7 +3614,7 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,* interface. Here we avoid this telling to the CPP init code to * use a lock file if UIO is being used. */ -if (dev->kdrv ==RTE_KDRV_VFIO ) +if (dev->kdrv ==RTE_PCI_KDRV_VFIO ) cpp =nfp_cpp_from_device_name (dev,0 );else cpp =nfp_cpp_from_device_name (dev,1 );
drivers/net/virtio/virtio_pci.c +1 -1
@@ -704,7 +704,7 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw)PMD_INIT_LOG (INFO ,"trying with legacy virtio pci." );if (rte_pci_ioport_map (dev,0 ,VTPCI_IO (hw)) <0 ) {rte_pci_unmap_device (dev); -if (dev->kdrv ==RTE_KDRV_UNKNOWN && +if (dev->kdrv ==RTE_PCI_KDRV_UNKNOWN && (!dev->device.devargs || dev->device.devargs->bus !=rte_bus_find_by_name ("pci" ))) {
lib/librte_eal/include/rte_dev.h +0 -12
@@ -54,18 +54,6 @@ typedef void (*rte_dev_event_cb_fn)(const char *device_name,return ; \ }while (0 ) -/** -* Device driver. -*/ -enum rte_kernel_driver { -RTE_KDRV_UNKNOWN =0 , -RTE_KDRV_IGB_UIO , -RTE_KDRV_VFIO , -RTE_KDRV_UIO_GENERIC , -RTE_KDRV_NIC_UIO , - RTE_KDRV_NONE, -}; -/** * Device policies. */
Signature · 1 line
2.23.0
PATCH v3 3/6 pci: move resource mapping to the PCI bus
In reply to David MarchandAs reported during 20.08 work for Windows, the pci_map_resource API was built with the assumption that its flags would be passed to mmap().
This introduced a regression when adding the rte_mem_map API as reported in the workaround commit 9d2b24593724 ("pci: keep API compatibility with mmap values").
This API was only used in the PCI bus code, so move it there.
There is no code change happening during the move.
The only change is in the pci_map_resource description where the additional flags are now documented as rte_mem_map API flags:
- * The additional flags for the mapping range.
+ * The additional rte_mem_map() flags for the mapping range.
--- doc/guides/rel_notes/deprecation.rst | 11 ----- doc/guides/rel_notes/release_20_11.rst | 6 +++ drivers/bus/pci/linux/pci_init.h | 2 + drivers/bus/pci/linux/pci_uio.c | 1 + drivers/bus/pci/pci_common.c | 41 ++++++++++++++++ drivers/bus/pci/private.h | 65 +++++++++++++++++++++++++ lib/librte_pci/rte_pci.c | 42 ---------------- lib/librte_pci/rte_pci.h | 66 -------------------------- lib/librte_pci/rte_pci_version.map | 2 - 9 files changed, 115 insertions(+), 121 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -11
@@ -113,17 +113,6 @@ Deprecation Notices us extending existing enum/define. One solution can be using a fixed size array instead of ``.*MAX.*`` value. -* pci: The PCI resources map API (``pci_map_resource`` and - ``pci_unmap_resource``) was not abstracting the Unix mmap flags (see the - workaround for Windows support implemented in the commit - 9d2b24593724 ("pci: keep API compatibility with mmap values")). - This API will be removed from the public API in 20.11 and moved to the PCI - bus driver along with the PCI resources lists and associated structures - (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and - ``mapped_pci_res_list``). - With this removal, there won't be a need for the mentioned workaround which - will be reverted. - * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in `this presentation <https://www.youtube.com/watch?v=Ttl6MlhmzWY>`_.
doc/guides/rel_notes/release_20_11.rst +6 -0
@@ -90,6 +90,12 @@ API Changes * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem. +* pci: Removed the PCI resources map API from the public API + (``pci_map_resource`` and ``pci_unmap_resource``) and moved it to the + PCI bus driver along with the PCI resources lists and associated structures + (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and + ``mapped_pci_res_list``). + * mbuf: Removed the unioned field ``refcnt_atomic`` from the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``. The field ``refcnt`` is remaining from the old unions.
drivers/bus/pci/linux/pci_init.h +2 -0
@@ -7,6 +7,8 @@#include <rte_vfio.h> +#include "private.h" +/** IO resource type: */ #define IORESOURCE_IO 0x00000100#define IORESOURCE_MEM 0x00000200
drivers/bus/pci/linux/pci_uio.c +1 -0
@@ -25,6 +25,7 @@#include "eal_filesystem.h" #include "pci_init.h" +#include "private.h" void *pci_map_addr =NULL ;
drivers/bus/pci/pci_common.c +41 -0
53 lines not on this page · raw message
drivers/bus/pci/private.h +65 -0
71 lines not on this page · raw message
lib/librte_pci/rte_pci.c +0 -42
45 lines not on this page · raw message
lib/librte_pci/rte_pci.h +0 -66
78 lines not on this page · raw message
lib/librte_pci/rte_pci_version.map +0 -2
@@ -1,8 +1,6 @@ DPDK_21 { global: - pci_map_resource; - pci_unmap_resource; rte_pci_addr_cmp; rte_pci_addr_parse; rte_pci_device_name;
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH v3 3/6] pci: move resource mapping to the PCI bus
Quoted 368 lines · David Marchand
As reported during 20.08 work for Windows, the
pci_map_resourceAPI was built with the assumption that its flags would be passed tommap().This introduced a regression when adding the
rte_mem_mapAPI as reported in the workaround commit9d2b24593724("pci: keep API compatibility with mmap values").This API was only used in the PCI bus code, so move it there.
There is no code change happening during the move.
The only change is in thepci_map_resourcedescription where the additional flags are now documented asrte_mem_mapAPI flags:
- * The additional flags for the mapping range.
+ * The additionalrte_mem_map()flags for the mapping range.Signed-off-by David Marchand <[email protected]>Acked-by Andrew Rybchenko <[email protected]>--- doc/guides/rel_notes/deprecation.rst | 11 ----- doc/guides/rel_notes/release_20_11.rst | 6 +++ drivers/bus/pci/linux/pci_init.h | 2 + drivers/bus/pci/linux/pci_uio.c | 1 + drivers/bus/pci/pci_common.c | 41 ++++++++++++++++ drivers/bus/pci/private.h | 65 +++++++++++++++++++++++++ lib/librte_pci/rte_pci.c | 42 ---------------- lib/librte_pci/rte_pci.h | 66 -------------------------- lib/librte_pci/rte_pci_version.map | 2 - 9 files changed, 115 insertions(+), 121 deletions(-)doc/guides/rel_notes/deprecation.rst +0
-11@@ -113,17 +113,6 @@ Deprecation Notices us extending existing enum/define. One solution can be using a fixed size array instead of ``.*MAX.*`` value. -* pci: The PCI resources map API (``pci_map_resource`` and - ``pci_unmap_resource``) was not abstracting the Unix mmap flags (see the - workaround for Windows support implemented in the commit - 9d2b24593724 ("pci: keep API compatibility with mmap values")). - This API will be removed from the public API in 20.11 and moved to the PCI - bus driver along with the PCI resources lists and associated structures - (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and - ``mapped_pci_res_list``). - With this removal, there won't be a need for the mentioned workaround which - will be reverted. - * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in `this presentation <https://www.youtube.com/watch?v=Ttl6MlhmzWY>`_.doc/guides/rel_notes/release_20_11.rst +6
-0@@ -90,6 +90,12 @@ API Changes * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem. +* pci: Removed the PCI resources map API from the public API + (``pci_map_resource`` and ``pci_unmap_resource``) and moved it to the + PCI bus driver along with the PCI resources lists and associated structures + (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and + ``mapped_pci_res_list``). + * mbuf: Removed the unioned field ``refcnt_atomic`` from the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``. The field ``refcnt`` is remaining from the old unions.drivers/bus/pci/linux/pci_init.h +2
-0@@ -7,6 +7,8 @@#include <rte_vfio.h> +#include "private.h" +/** IO resource type: */ #define IORESOURCE_IO 0x00000100#define IORESOURCE_MEM 0x00000200drivers/bus/pci/linux/pci_uio.c +1
-0@@ -25,6 +25,7 @@#include "eal_filesystem.h" #include "pci_init.h" +#include "private.h" void *pci_map_addr =NULL ;drivers/bus/pci/pci_common.c +41
-0@@ -19,6 +19,7 @@#include <rte_per_lcore.h> #include <rte_memory.h> #include <rte_eal.h> +#include <rte_eal_paging.h> #include <rte_string_fns.h> #include <rte_common.h> #include <rte_devargs.h> @@ -79,6 +80,46 @@ pci_name_set(struct rte_pci_device *dev) dev->device.name = dev->name; } +/* map a particular resource from a file */ +void * +pci_map_resource (void *requested_addr,int fd,off_t offset,size_t size, +int additional_flags) +{ +void *mapaddr; + +/* Map the PCI memory resource of device */ + mapaddr =rte_mem_map (requested_addr, size, +RTE_PROT_READ |RTE_PROT_WRITE , +RTE_MAP_SHARED | additional_flags, fd, offset); +if (mapaddr ==NULL ) { +RTE_LOG (ERR ,EAL , +"%s(): cannot map resource(%d, %p, 0x%zx, 0x%llx): %s (%p)\n" , + __func__, fd, requested_addr, size, + (unsigned long long )offset, +rte_strerror (rte_errno), mapaddr); + mapaddr =MAP_FAILED ;/* API uses mmap error code */ + }else +RTE_LOG (DEBUG ,EAL ," PCI memory mapped at %p\n" , mapaddr); + +return mapaddr; +} + +/* unmap a particular resource */ +void +pci_unmap_resource (void *requested_addr,size_t size) +{ +if (requested_addr ==NULL ) +return ; + +/* Unmap the PCI memory resource of device */ +if (rte_mem_unmap (requested_addr, size)) { +RTE_LOG (ERR ,EAL ,"%s(): cannot mem unmap(%p, %#zx): %s\n" , + __func__, requested_addr, size, +rte_strerror (rte_errno)); + }else +RTE_LOG (DEBUG ,EAL ," PCI memory unmapped at %p\n" , + requested_addr); +}/* * Match the PCI Driver and Device using the ID Table */ drivers/bus/pci/private.h +65
-0@@ -81,6 +81,71 @@ void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev,*/ int pci_update_device (const struct rte_pci_addr *addr); +/** +* A structure describing a PCI mapping. +*/ +struct pci_map { +void *addr; +char *path; +uint64_t offset; +uint64_t size; +uint64_t phaddr; +}; + +struct pci_msix_table { +int bar_index; +uint32_t offset; +uint32_t size; +}; + +/** +* A structure describing a mapped PCI resource. +* For multi-process we need to reproduce all PCI mappings in secondary +* processes, so save them in a tailq. +*/ +struct mapped_pci_resource { +TAILQ_ENTRY (mapped_pci_resource) next; + +struct rte_pci_addr pci_addr; +char path[PATH_MAX ]; +int nb_maps; +struct pci_map maps[PCI_MAX_RESOURCE ]; +struct pci_msix_table msix_table; +}; + +/** mapped pci device list */ +TAILQ_HEAD (mapped_pci_res_list, mapped_pci_resource); + +/** +* Map a particular resource from a file. +* +* @param requested_addr +* The starting address for the new mapping range. +* @param fd +* The file descriptor. +* @param offset +* The offset for the mapping range. +* @param size +* The size for the mapping range. +* @param additional_flags +* The additional rte_mem_map() flags for the mapping range. +* @return +* - On success, the function returns a pointer to the mapped area. +* - On error, MAP_FAILED is returned. +*/ +void *pci_map_resource (void *requested_addr,int fd,off_t offset, +size_t size,int additional_flags); + +/** +* Unmap a particular resource. +* +* @param requested_addr +* The address for the unmapping range. +* @param size +* The size for the unmapping range. +*/ +void pci_unmap_resource (void *requested_addr,size_t size); +/** * Map the PCI resource of a PCI device in virtual memory * lib/librte_pci/rte_pci.c +0
-42@@ -144,45 +144,3 @@ rte_pci_addr_parse(const char *str, struct rte_pci_addr *addr)return 0 ;return -1 ; } - - -/* map a particular resource from a file */ -void * -pci_map_resource (void *requested_addr,int fd,off_t offset,size_t size, -int additional_flags) -{ -void *mapaddr; - -/* Map the PCI memory resource of device */ - mapaddr =rte_mem_map (requested_addr, size, -RTE_PROT_READ |RTE_PROT_WRITE , -RTE_MAP_SHARED | additional_flags, fd, offset); -if (mapaddr ==NULL ) { -RTE_LOG (ERR ,EAL , -"%s(): cannot map resource(%d, %p, 0x%zx, 0x%llx): %s (%p)\n" , - __func__, fd, requested_addr, size, - (unsigned long long )offset, -rte_strerror (rte_errno), mapaddr); - mapaddr =MAP_FAILED ;/* API uses mmap error code */ - }else -RTE_LOG (DEBUG ,EAL ," PCI memory mapped at %p\n" , mapaddr); - -return mapaddr; -} - -/* unmap a particular resource */ -void -pci_unmap_resource (void *requested_addr,size_t size) -{ -if (requested_addr ==NULL ) -return ; - -/* Unmap the PCI memory resource of device */ -if (rte_mem_unmap (requested_addr, size)) { -RTE_LOG (ERR ,EAL ,"%s(): cannot mem unmap(%p, %#zx): %s\n" , - __func__, requested_addr, size, -rte_strerror (rte_errno)); - }else -RTE_LOG (DEBUG ,EAL ," PCI memory unmapped at %p\n" , - requested_addr); -}lib/librte_pci/rte_pci.h +0
-66@@ -64,42 +64,6 @@ struct rte_pci_addr {#define PCI_ANY_ID (0xffff)#define RTE_CLASS_ANY_ID (0xffffff) -/** -* A structure describing a PCI mapping. -*/ -struct pci_map { -void *addr; -char *path; -uint64_t offset; -uint64_t size; -uint64_t phaddr; -}; - -struct pci_msix_table { -int bar_index; -uint32_t offset; -uint32_t size; -}; - -/** -* A structure describing a mapped PCI resource. -* For multi-process we need to reproduce all PCI mappings in secondary -* processes, so save them in a tailq. -*/ -struct mapped_pci_resource { -TAILQ_ENTRY (mapped_pci_resource) next; - -struct rte_pci_addr pci_addr; -char path[PATH_MAX ]; -int nb_maps; -struct pci_map maps[PCI_MAX_RESOURCE ]; -struct pci_msix_table msix_table; -}; - - -/** mapped pci device list */ -TAILQ_HEAD (mapped_pci_res_list, mapped_pci_resource); -/** * Utility function to write a pci device name, this device name can later be * used to retrieve the corresponding rte_pci_addr using eal_parse_pci_* @@ -145,36 +109,6 @@ int rte_pci_addr_cmp(const struct rte_pci_addr *addr,*/ int rte_pci_addr_parse (const char *str,struct rte_pci_addr *addr); -/** -* Map a particular resource from a file. -* -* @param requested_addr -* The starting address for the new mapping range. -* @param fd -* The file descriptor. -* @param offset -* The offset for the mapping range. -* @param size -* The size for the mapping range. -* @param additional_flags -* The additional flags for the mapping range. -* @return -* - On success, the function returns a pointer to the mapped area. -* - On error, MAP_FAILED is returned. -*/ -void *pci_map_resource (void *requested_addr,int fd,off_t offset, -size_t size,int additional_flags); - -/** -* Unmap a particular resource. -* -* @param requested_addr -* The address for the unmapping range. -* @param size -* The size for the unmapping range. -*/ -void pci_unmap_resource (void *requested_addr,size_t size); - #ifdef __cplusplus }#endif lib/librte_pci/rte_pci_version.map +0
-0
lib/librte_pci/rte_pci_version.map line 6
Quoted 8 lines
lib/librte_pci/rte_pci_version.map +0
-2@@ -1,8 +1,6 @@ DPDK_21 { global: - pci_map_resource; - pci_unmap_resource; rte_pci_addr_cmp; rte_pci_addr_parse; rte_pci_device_name;
PATCH v3 4/6 mem: drop mapping API workaround
In reply to David MarchandNow that the pci_map_resource API is private to the PCI bus, we can drop the compatibility workaround we had implemented in 20.08.
--- drivers/bus/pci/bsd/pci.c | 2 +- drivers/bus/pci/linux/pci_uio.c | 2 +- drivers/bus/pci/linux/pci_vfio.c | 4 ++-- drivers/bus/pci/pci_common.c | 1 - drivers/bus/pci/pci_common_uio.c | 2 +- drivers/bus/pci/private.h | 2 +- lib/librte_eal/include/rte_eal_paging.h | 10 ---------- lib/librte_eal/windows/include/rte_os.h | 6 ------ 8 files changed, 6 insertions(+), 23 deletions(-)
drivers/bus/pci/bsd/pci.c +1 -1
@@ -192,7 +192,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, mapaddr =pci_map_resource (NULL , fd, (off_t )offset, (size_t )dev->mem_resource[res_idx].len,0 );close (fd); -if (mapaddr ==MAP_FAILED ) +if (mapaddr ==NULL ) goto error; maps[map_idx].phaddr = dev->mem_resource[res_idx].phys_addr;
drivers/bus/pci/linux/pci_uio.c +1 -1
@@ -346,7 +346,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, mapaddr =pci_map_resource (pci_map_addr, fd,0 , (size_t )dev->mem_resource[res_idx].len,0 );close (fd); -if (mapaddr ==MAP_FAILED ) +if (mapaddr ==NULL ) goto error; pci_map_addr = RTE_PTR_ADD(mapaddr,
drivers/bus/pci/linux/pci_vfio.c +2 -2
@@ -565,7 +565,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res, }/* if there's a second part, try to map it */ -if (map_addr !=MAP_FAILED +if (map_addr !=NULL && memreg[1 ].offset && memreg[1 ].size) { void *second_addr = RTE_PTR_ADD(bar_addr, (uintptr_t)(memreg[1].offset -
@@ -577,7 +577,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res, RTE_MAP_FORCE_ADDRESS); } -if (map_addr ==NULL || map_addr ==MAP_FAILED ) { +if (map_addr ==NULL ) {munmap (bar_addr, bar->size); bar_addr =MAP_FAILED ; RTE_LOG(ERR, EAL, "Failed to map pci BAR%d\n",
drivers/bus/pci/pci_common.c +0 -1
@@ -97,7 +97,6 @@ pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size, __func__, fd, requested_addr, size, (unsigned long long )offset, rte_strerror(rte_errno), mapaddr); - mapaddr =MAP_FAILED ;/* API uses mmap error code */ }else RTE_LOG (DEBUG ,EAL ," PCI memory mapped at %p\n" , mapaddr);
drivers/bus/pci/pci_common_uio.c +1 -1
@@ -58,7 +58,7 @@ pci_uio_map_secondary(struct rte_pci_device *dev)"Cannot mmap device resource file %s to address: %p\n" , uio_res->maps[i].path, uio_res->maps[i].addr); -if (mapaddr !=MAP_FAILED ) { +if (mapaddr !=NULL ) {/* unmap addrs correctly mapped */ for (j =0 ; j < i; j++) pci_unmap_resource(
drivers/bus/pci/private.h +1 -1
@@ -131,7 +131,7 @@ TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);* The additional rte_mem_map() flags for the mapping range. * @return * - On success, the function returns a pointer to the mapped area. -* - On error, MAP_FAILED is returned. +* - On error, NULL is returned. */ void *pci_map_resource (void *requested_addr,int fd,off_t offset,size_t size,int additional_flags);
lib/librte_eal/include/rte_eal_paging.h +0 -10
@@ -3,9 +3,6 @@*/ #include <stdint.h> -#ifndef RTE_EXEC_ENV_WINDOWS -#include <sys/mman.h> -#endif #include <rte_compat.h>
@@ -25,7 +22,6 @@ enum rte_mem_prot {/** Additional flags for memory mapping. */ enum rte_map_flags { -#ifdef RTE_EXEC_ENV_WINDOWS /** Changes to the mapped memory are visible to other processes. */ RTE_MAP_SHARED =1 <<0 ,/** Mapping is not backed by a regular file. */
@@ -39,12 +35,6 @@ enum rte_map_flags {* it is not required to do so, thus mapping with this flag may fail. */ RTE_MAP_FORCE_ADDRESS = 1 << 3 -#else /* map mmap flags because they are exposed in pci_map_resource() API */ -RTE_MAP_SHARED =MAP_SHARED , -RTE_MAP_ANONYMOUS =MAP_ANONYMOUS , -RTE_MAP_PRIVATE =MAP_PRIVATE , - RTE_MAP_FORCE_ADDRESS = MAP_FIXED, -#endif };/**
lib/librte_eal/windows/include/rte_os.h +0 -6
@@ -25,12 +25,6 @@ extern "C" {#define PATH_MAX _MAX_PATH#endif -/* sys/mman.h -* The syscall mmap does not exist on Windows, -* but this error code is used in a badly defined DPDK API for PCI mapping. -*/ -#define MAP_FAILED ((void *) -1) -#define sleep (x) Sleep(1000 * (x))#define strerror_r (a, b, c) strerror_s(b, c, a)
Signature · 1 line
2.23.0
PATCH v3 5/6 eal: hide internal device event structure
In reply to David MarchandThis structure is not used in the public API.
--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ lib/librte_eal/include/rte_dev.h | 6 ------ lib/librte_eal/linux/eal_dev.c | 6 ++++++ 4 files changed, 9 insertions(+), 9 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -3
@@ -70,9 +70,6 @@ Deprecation Notices * eal: The function ``rte_eal_remote_launch`` will return new error codes after read or write error on the pipe, instead of calling ``rte_panic``. -* eal: The ``rte_dev_event`` structure will be made private to the EAL as no - public API makes use of it. - * rte_atomicNN_xxx: These APIs do not take memory order parameter. This does not allow for writing optimized code for all the CPU architectures supported in DPDK. DPDK will adopt C11 atomic operations semantics and provide wrappers
doc/guides/rel_notes/release_20_11.rst +3 -0
@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* eal: Made the ``rte_dev_event`` structure private to the EAL as no public API + used it. + * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem.
lib/librte_eal/include/rte_dev.h +0 -6
@@ -33,12 +33,6 @@ enum rte_dev_event_type { RTE_DEV_EVENT_MAX /**< max value of this enum */ }; -struct rte_dev_event { -enum rte_dev_event_type type;/**< device event type */ -int subsystem;/**< subsystem id */ -char *devname;/**< device name */ -}; -typedef void (*rte_dev_event_cb_fn )(const char *device_name,enum rte_dev_event_type event,void *cb_arg);
lib/librte_eal/linux/eal_dev.c +6 -0
@@ -133,6 +133,12 @@ dev_uev_socket_fd_create(void)return ret; } +struct rte_dev_event { +enum rte_dev_event_type type;/**< device event type */ +int subsystem;/**< subsystem id */ +char *devname;/**< device name */ +}; +static int dev_uev_parse (const char *buf,struct rte_dev_event *event,int length) {
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH v3 5/6] eal: hide internal device event structure
Hi, David
Quoted 11 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Thursday, September 17, 2020 7:28 PM
To: [email protected]
Cc: [email protected]; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>; Jianfeng Tan <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v3 5/6] eal: hide internal device event structure
Quoted 5 lines
This structure is not used in the public API.
Fixes a753e53d517b ("eal: add device event monitor framework")Signed-off-by David Marchand <[email protected]>
Agree with the patch that the struct involve os platform specific, it is better no public it.
Quoted 75 lines
--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ lib/librte_eal/include/rte_dev.h | 6 ------ lib/librte_eal/linux/eal_dev.c | 6 ++++++ 4 files changed, 9 insertions(+), 9 deletions(-)doc/guides/rel_notes/deprecation.rst +0
-3@@ -70,9 +70,6 @@ Deprecation Notices * eal: The function ``rte_eal_remote_launch`` will return new error codes after read or write error on the pipe, instead of calling ``rte_panic``. -* eal: The ``rte_dev_event`` structure will be made private to the EAL as no - public API makes use of it. - * rte_atomicNN_xxx: These APIs do not take memory order parameter. Thisdoes
not allow for writing optimized code for all the CPU architectures supported in DPDK. DPDK will adopt C11 atomic operations semantics and provide
wrappers diff --gita/doc/guides/rel_notes/release_20_11.rstb/doc/guides/rel_notes/release_20_11.rst
index185eeae731..e87509dfa7100644doc/guides/rel_notes/release_20_11.rst +4
-0@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* eal: Made the ``rte_dev_event`` structure private to the EAL as no +public API + used it. + * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem.lib/librte_eal/include/rte_dev.h +0
-6@@ -33,12 +33,6 @@ enum rte_dev_event_type { RTE_DEV_EVENT_MAX /**< max value of this enum */ }; -struct rte_dev_event { -enum rte_dev_event_type type;/**< device event type */ -int subsystem;/**< subsystem id */ -char *devname;/**< device name */ -}; -typedef void (*rte_dev_event_cb_fn )(const char *device_name,enum rte_dev_event_type event,void *cb_arg);lib/librte_eal/linux/eal_dev.c +6
-1@@ -133,6 +133,12 @@ dev_uev_socket_fd_create(void)return ret; } +struct rte_dev_event { +enum rte_dev_event_type type;/**< device event type */ +int subsystem;/**< subsystem id */ +char *devname;/**< device name */ +}; +static int dev_uev_parse (const char *buf,struct rte_dev_event *event,int length) { --2.23.0
Kinsella, Ray
Acked-byRe: [dpdk-dev] [PATCH v3 5/6] eal: hide internal device event structure
Quoted 13 lines · Jia
Hi, David
Quoted 11 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Thursday, September 17, 2020 7:28 PM
To: [email protected]
Cc: [email protected]; Ray Kinsella <[email protected]>; Neil Horman <[email protected]>; Mcnamara, John <[email protected]>; Kovacevic, Marko <[email protected]>; Jianfeng Tan <[email protected]>; Guo, Jia <[email protected]>
Subject: [PATCH v3 5/6] eal: hide internal device event structure
Quoted 8 lines
Quoted 5 lines
This structure is not used in the public API.
Fixes a753e53d517b ("eal: add device event monitor framework")Signed-off-by David Marchand <[email protected]>Agree with the patch that the struct involve os platform specific, it is better no public it.
Acked-by Jeff Guo <[email protected]>
Quoted 77 lines
Quoted 76 lines
--- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ lib/librte_eal/include/rte_dev.h | 6 ------ lib/librte_eal/linux/eal_dev.c | 6 ++++++ 4 files changed, 9 insertions(+), 9 deletions(-)doc/guides/rel_notes/deprecation.rst +0
-3@@ -70,9 +70,6 @@ Deprecation Notices * eal: The function ``rte_eal_remote_launch`` will return new error codes after read or write error on the pipe, instead of calling ``rte_panic``. -* eal: The ``rte_dev_event`` structure will be made private to the EAL as no - public API makes use of it. - * rte_atomicNN_xxx: These APIs do not take memory order parameter. Thisdoes
not allow for writing optimized code for all the CPU architectures supported in DPDK. DPDK will adopt C11 atomic operations semantics and provide
wrappers diff --gita/doc/guides/rel_notes/release_20_11.rstb/doc/guides/rel_notes/release_20_11.rst
index185eeae731..e87509dfa7100644doc/guides/rel_notes/release_20_11.rst +4
-0@@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* eal: Made the ``rte_dev_event`` structure private to the EAL as no +public API + used it. + * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem.lib/librte_eal/include/rte_dev.h +0
-6@@ -33,12 +33,6 @@ enum rte_dev_event_type { RTE_DEV_EVENT_MAX /**< max value of this enum */ }; -struct rte_dev_event { -enum rte_dev_event_type type;/**< device event type */ -int subsystem;/**< subsystem id */ -char *devname;/**< device name */ -}; -typedef void (*rte_dev_event_cb_fn )(const char *device_name,enum rte_dev_event_type event,void *cb_arg);lib/librte_eal/linux/eal_dev.c +6
-1@@ -133,6 +133,12 @@ dev_uev_socket_fd_create(void)return ret; } +struct rte_dev_event { +enum rte_dev_event_type type;/**< device event type */ +int subsystem;/**< subsystem id */ +char *devname;/**< device name */ +}; +static int dev_uev_parse (const char *buf,struct rte_dev_event *event,int length) { --2.23.0
PATCH v3 6/6 bus/pci: remove duplicate declaration
In reply to David MarchandThis declaration is the same as the one a few lines before.
--- drivers/bus/pci/private.h | 2 -- 1 file changed, 2 deletions(-)
drivers/bus/pci/private.h +0 -2
@@ -15,8 +15,6 @@ extern struct rte_pci_bus rte_pci_bus;struct rte_pci_driver ;struct rte_pci_device ; -extern struct rte_pci_bus rte_pci_bus; -/** * Scan the content of the PCI bus, and the devices in the devices * list
Signature · 1 line
2.23.0
Quoted 7 lines · David Marchand
David Marchand (6):
ethdev: remove unused kernel driver field
bus/pci: switch to private kernel driver enum
pci: move resource mapping to the PCI bus
mem: drop mapping API workaround
eal: hide internal device event structure
bus/pci: remove duplicate declaration
Thanks for the reviews.
Applied.
Signature · 1 line
David Marchand