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>`_.
the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``.
The field ``refcnt`` is remaining from the old unions.
+* 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.
/* 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;
{
/* 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;
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) {
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;
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);
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:
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:
switch (p->dev->kdrv) {
#if defined(RTE_ARCH_X86)
- case RTE_KDRV_NIC_UIO:
+ case RTE_PCI_KDRV_NIC_UIO:
ret = 0;
break;
#endif
/* try mapping the NIC resources using VFIO if it exists */
switch (dev->kdrv) {
- case RTE_KDRV_VFIO:
+ case RTE_PCI_KDRV_VFIO:
#ifdef VFIO_PRESENT
if (pci_vfio_is_enabled())
ret = pci_vfio_map_resource(dev);
#endif
break;
- case RTE_KDRV_IGB_UIO:
- case RTE_KDRV_UIO_GENERIC:
+ case RTE_PCI_KDRV_IGB_UIO:
+ case RTE_PCI_KDRV_UIO_GENERIC:
if (rte_eal_using_phys_addrs()) {
/* map resources for devices that use uio */
ret = pci_uio_map_resource(dev);
{
/* try unmapping the NIC resources using VFIO if it exists */
switch (dev->kdrv) {
- case RTE_KDRV_VFIO:
+ case RTE_PCI_KDRV_VFIO:
#ifdef VFIO_PRESENT
if (pci_vfio_is_enabled())
pci_vfio_unmap_resource(dev);
#endif
break;
- case RTE_KDRV_IGB_UIO:
- case RTE_KDRV_UIO_GENERIC:
+ case RTE_PCI_KDRV_IGB_UIO:
+ case RTE_PCI_KDRV_UIO_GENERIC:
/* unmap resources for devices that use uio */
pci_uio_unmap_resource(dev);
break;
if (!ret) {
if (!strcmp(driver, "vfio-pci"))
- dev->kdrv = RTE_KDRV_VFIO;
+ dev->kdrv = RTE_PCI_KDRV_VFIO;
else if (!strcmp(driver, "igb_uio"))
- dev->kdrv = RTE_KDRV_IGB_UIO;
+ dev->kdrv = RTE_PCI_KDRV_IGB_UIO;
else if (!strcmp(driver, "uio_pci_generic"))
- dev->kdrv = RTE_KDRV_UIO_GENERIC;
+ dev->kdrv = RTE_PCI_KDRV_UIO_GENERIC;
else
- dev->kdrv = RTE_KDRV_UNKNOWN;
+ dev->kdrv = RTE_PCI_KDRV_UNKNOWN;
} else {
- dev->kdrv = RTE_KDRV_NONE;
+ dev->kdrv = RTE_PCI_KDRV_NONE;
return 0;
}
/* device is valid, add in list (sorted) */
enum rte_iova_mode iova_mode = RTE_IOVA_DC;
switch (pdev->kdrv) {
- case RTE_KDRV_VFIO: {
+ case RTE_PCI_KDRV_VFIO: {
#ifdef VFIO_PRESENT
static int is_vfio_noiommu_enabled = -1;
break;
}
- case RTE_KDRV_IGB_UIO:
- case RTE_KDRV_UIO_GENERIC:
+ case RTE_PCI_KDRV_IGB_UIO:
+ case RTE_PCI_KDRV_UIO_GENERIC:
iova_mode = RTE_IOVA_PA;
break;
const struct rte_intr_handle *intr_handle = &device->intr_handle;
switch (device->kdrv) {
- case RTE_KDRV_IGB_UIO:
- case RTE_KDRV_UIO_GENERIC:
+ case RTE_PCI_KDRV_IGB_UIO:
+ case RTE_PCI_KDRV_UIO_GENERIC:
return pci_uio_read_config(intr_handle, buf, len, offset);
#ifdef VFIO_PRESENT
- case RTE_KDRV_VFIO:
+ case RTE_PCI_KDRV_VFIO:
return pci_vfio_read_config(intr_handle, buf, len, offset);
#endif
default:
const struct rte_intr_handle *intr_handle = &device->intr_handle;
switch (device->kdrv) {
- case RTE_KDRV_IGB_UIO:
- case RTE_KDRV_UIO_GENERIC:
+ case RTE_PCI_KDRV_IGB_UIO:
+ case RTE_PCI_KDRV_UIO_GENERIC:
return pci_uio_write_config(intr_handle, buf, len, offset);
#ifdef VFIO_PRESENT
- case RTE_KDRV_VFIO:
+ case RTE_PCI_KDRV_VFIO:
return pci_vfio_write_config(intr_handle, buf, len, offset);
#endif
default:
switch (dev->kdrv) {
#ifdef VFIO_PRESENT
- case RTE_KDRV_VFIO:
+ case RTE_PCI_KDRV_VFIO:
if (pci_vfio_is_enabled())
ret = pci_vfio_ioport_map(dev, bar, p);
break;
#endif
- case RTE_KDRV_IGB_UIO:
+ case RTE_PCI_KDRV_IGB_UIO:
ret = pci_uio_ioport_map(dev, bar, p);
break;
- case RTE_KDRV_UIO_GENERIC:
+ case RTE_PCI_KDRV_UIO_GENERIC:
#if defined(RTE_ARCH_X86)
ret = pci_ioport_map(dev, bar, p);
#else
{
switch (p->dev->kdrv) {
#ifdef VFIO_PRESENT
- case RTE_KDRV_VFIO:
+ case RTE_PCI_KDRV_VFIO:
pci_vfio_ioport_read(p, data, len, offset);
break;
#endif
- case RTE_KDRV_IGB_UIO:
+ case RTE_PCI_KDRV_IGB_UIO:
pci_uio_ioport_read(p, data, len, offset);
break;
- case RTE_KDRV_UIO_GENERIC:
+ case RTE_PCI_KDRV_UIO_GENERIC:
pci_uio_ioport_read(p, data, len, offset);
break;
default:
{
switch (p->dev->kdrv) {
#ifdef VFIO_PRESENT
- case RTE_KDRV_VFIO:
+ case RTE_PCI_KDRV_VFIO:
pci_vfio_ioport_write(p, data, len, offset);
break;
#endif
- case RTE_KDRV_IGB_UIO:
+ case RTE_PCI_KDRV_IGB_UIO:
pci_uio_ioport_write(p, data, len, offset);
break;
- case RTE_KDRV_UIO_GENERIC:
+ case RTE_PCI_KDRV_UIO_GENERIC:
pci_uio_ioport_write(p, data, len, offset);
break;
default:
switch (p->dev->kdrv) {
#ifdef VFIO_PRESENT
- case RTE_KDRV_VFIO:
+ case RTE_PCI_KDRV_VFIO:
if (pci_vfio_is_enabled())
ret = pci_vfio_ioport_unmap(p);
break;
#endif
- case RTE_KDRV_IGB_UIO:
+ case RTE_PCI_KDRV_IGB_UIO:
ret = pci_uio_ioport_unmap(p);
break;
- case RTE_KDRV_UIO_GENERIC:
+ case RTE_PCI_KDRV_UIO_GENERIC:
#if defined(RTE_ARCH_X86)
ret = 0;
#else
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;
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
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;
* 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);
* 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);
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;
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.
*/
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 */
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,
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;
* 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
/* 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);
* 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");
}
/* 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);
}
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);
* 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);
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"))) {
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.
*/