make rte_intr_handle internal
Subsystems (6)
PATCH v8 6/9 drivers: remove direct access to interrupt handle
In reply to David MarchandFrom: Harman Kalra <[email protected]>
Removing direct access to interrupt handle structure fields, rather use respective get set APIs for the same.
Making changes to all the drivers access the interrupt handle fields.
---
Changes since v6:
- fixed interrupt handle allocation for drivers without RTE_PCI_DRV_NEED_MAPPING,
Changes since v5:
- moved instance allocation to probing for auxiliary,
- fixed dev_irq_register() return value sign on error for drivers/common/cnxk/roc_irq.c,
--- drivers/baseband/acc100/rte_acc100_pmd.c | 14 +-- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 24 ++-- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 24 ++-- drivers/bus/auxiliary/auxiliary_common.c | 17 ++- drivers/bus/auxiliary/rte_bus_auxiliary.h | 2 +- drivers/bus/dpaa/dpaa_bus.c | 28 ++++- drivers/bus/dpaa/rte_dpaa_bus.h | 2 +- drivers/bus/fslmc/fslmc_bus.c | 14 ++- drivers/bus/fslmc/fslmc_vfio.c | 30 +++-- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 18 ++- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +- drivers/bus/fslmc/rte_fslmc.h | 2 +- drivers/bus/ifpga/ifpga_bus.c | 13 +- drivers/bus/ifpga/rte_bus_ifpga.h | 2 +- drivers/bus/pci/bsd/pci.c | 20 +-- drivers/bus/pci/linux/pci.c | 4 +- drivers/bus/pci/linux/pci_uio.c | 69 +++++++---- drivers/bus/pci/linux/pci_vfio.c | 102 +++++++++------ drivers/bus/pci/pci_common.c | 47 +++++-- drivers/bus/pci/pci_common_uio.c | 21 ++-- drivers/bus/pci/rte_bus_pci.h | 4 +- drivers/bus/vmbus/linux/vmbus_bus.c | 6 + drivers/bus/vmbus/linux/vmbus_uio.c | 35 ++++-- drivers/bus/vmbus/rte_bus_vmbus.h | 2 +- drivers/bus/vmbus/vmbus_common_uio.c | 23 ++-- drivers/common/cnxk/roc_cpt.c | 8 +- drivers/common/cnxk/roc_dev.c | 14 +-- drivers/common/cnxk/roc_irq.c | 107 +++++++++------- drivers/common/cnxk/roc_nix_inl_dev_irq.c | 8 +- drivers/common/cnxk/roc_nix_irq.c | 36 +++--- drivers/common/cnxk/roc_npa.c | 2 +- drivers/common/cnxk/roc_platform.h | 48 +++++-- drivers/common/cnxk/roc_sso.c | 4 +- drivers/common/cnxk/roc_tim.c | 4 +- drivers/common/octeontx2/otx2_dev.c | 14 +-- drivers/common/octeontx2/otx2_irq.c | 117 ++++++++++-------- .../octeontx2/otx2_cryptodev_hw_access.c | 4 +- drivers/event/octeontx2/otx2_evdev_irq.c | 12 +- drivers/mempool/octeontx2/otx2_mempool.c | 2 +- drivers/net/atlantic/atl_ethdev.c | 20 ++- drivers/net/avp/avp_ethdev.c | 8 +- drivers/net/axgbe/axgbe_ethdev.c | 12 +- drivers/net/axgbe/axgbe_mdio.c | 6 +- drivers/net/bnx2x/bnx2x_ethdev.c | 10 +- drivers/net/bnxt/bnxt_ethdev.c | 33 +++-- drivers/net/bnxt/bnxt_irq.c | 4 +- drivers/net/dpaa/dpaa_ethdev.c | 48 ++++--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +- drivers/net/e1000/em_ethdev.c | 23 ++-- drivers/net/e1000/igb_ethdev.c | 79 ++++++------ drivers/net/ena/ena_ethdev.c | 35 +++--- drivers/net/enic/enic_main.c | 26 ++-- drivers/net/failsafe/failsafe.c | 21 +++- drivers/net/failsafe/failsafe_intr.c | 43 ++++--- drivers/net/failsafe/failsafe_ops.c | 19 ++- drivers/net/failsafe/failsafe_private.h | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 32 ++--- drivers/net/hinic/hinic_pmd_ethdev.c | 10 +- drivers/net/hns3/hns3_ethdev.c | 57 ++++----- drivers/net/hns3/hns3_ethdev_vf.c | 64 +++++----- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 53 ++++---- drivers/net/iavf/iavf_ethdev.c | 42 +++---- drivers/net/iavf/iavf_vchnl.c | 4 +- drivers/net/ice/ice_dcf.c | 10 +- drivers/net/ice/ice_dcf_ethdev.c | 21 ++-- drivers/net/ice/ice_ethdev.c | 49 ++++---- drivers/net/igc/igc_ethdev.c | 45 ++++--- drivers/net/ionic/ionic_ethdev.c | 17 +-- drivers/net/ixgbe/ixgbe_ethdev.c | 66 +++++----- drivers/net/memif/memif_socket.c | 108 +++++++++++----- drivers/net/memif/memif_socket.h | 4 +- drivers/net/memif/rte_eth_memif.c | 56 +++++++-- drivers/net/memif/rte_eth_memif.h | 2 +- drivers/net/mlx4/mlx4.c | 19 ++- drivers/net/mlx4/mlx4.h | 2 +- drivers/net/mlx4/mlx4_intr.c | 47 ++++--- drivers/net/mlx5/linux/mlx5_os.c | 55 +++++--- drivers/net/mlx5/linux/mlx5_socket.c | 25 ++-- drivers/net/mlx5/mlx5.h | 6 +- drivers/net/mlx5/mlx5_rxq.c | 43 ++++--- drivers/net/mlx5/mlx5_trigger.c | 4 +- drivers/net/mlx5/mlx5_txpp.c | 25 ++-- drivers/net/netvsc/hn_ethdev.c | 4 +- drivers/net/nfp/nfp_common.c | 34 ++--- drivers/net/nfp/nfp_ethdev.c | 13 +- drivers/net/nfp/nfp_ethdev_vf.c | 13 +- drivers/net/ngbe/ngbe_ethdev.c | 29 ++--- drivers/net/octeontx2/otx2_ethdev_irq.c | 35 +++--- drivers/net/qede/qede_ethdev.c | 16 +-- drivers/net/sfc/sfc_intr.c | 30 ++--- drivers/net/tap/rte_eth_tap.c | 33 +++-- drivers/net/tap/rte_eth_tap.h | 2 +- drivers/net/tap/tap_intr.c | 33 ++--- drivers/net/thunderx/nicvf_ethdev.c | 10 ++ drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/txgbe/txgbe_ethdev.c | 38 +++--- drivers/net/txgbe/txgbe_ethdev_vf.c | 33 +++-- drivers/net/vhost/rte_eth_vhost.c | 80 ++++++------ drivers/net/virtio/virtio_ethdev.c | 21 ++-- .../net/virtio/virtio_user/virtio_user_dev.c | 56 +++++---- drivers/net/vmxnet3/vmxnet3_ethdev.c | 43 ++++--- drivers/raw/ifpga/ifpga_rawdev.c | 62 +++++++--- drivers/raw/ntb/ntb.c | 9 +- .../regex/octeontx2/otx2_regexdev_hw_access.c | 4 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 5 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 8 ++ drivers/vdpa/mlx5/mlx5_vdpa.h | 4 +- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 21 ++-- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 44 ++++--- lib/ethdev/ethdev_pci.h | 2 +- 111 files changed, 1673 insertions(+), 1183 deletions(-)
drivers/baseband/acc100/rte_acc100_pmd.c +7 -7
@@ -720,8 +720,8 @@ acc100_intr_enable(struct rte_bbdev *dev)struct acc100_device *d = dev->data->dev_private;/* Only MSI are currently supported */ -if (dev->intr_handle->type ==RTE_INTR_HANDLE_VFIO_MSI || - dev->intr_handle->type ==RTE_INTR_HANDLE_UIO ) { +if (rte_intr_type_get (dev->intr_handle) ==RTE_INTR_HANDLE_VFIO_MSI || +rte_intr_type_get (dev->intr_handle) ==RTE_INTR_HANDLE_UIO ) { ret =allocate_info_ring (dev);if (ret <0 ) {
@@ -1098,8 +1098,8 @@ acc100_queue_intr_enable(struct rte_bbdev *dev, uint16_t queue_id) {struct acc100_queue *q = dev->data->queues[queue_id].queue_private; -if (dev->intr_handle->type !=RTE_INTR_HANDLE_VFIO_MSI && - dev->intr_handle->type !=RTE_INTR_HANDLE_UIO ) +if (rte_intr_type_get (dev->intr_handle) !=RTE_INTR_HANDLE_VFIO_MSI && +rte_intr_type_get (dev->intr_handle) !=RTE_INTR_HANDLE_UIO )return -ENOTSUP ; q->irq_enable =1 ;
@@ -1111,8 +1111,8 @@ acc100_queue_intr_disable(struct rte_bbdev *dev, uint16_t queue_id) {struct acc100_queue *q = dev->data->queues[queue_id].queue_private; -if (dev->intr_handle->type !=RTE_INTR_HANDLE_VFIO_MSI && - dev->intr_handle->type !=RTE_INTR_HANDLE_UIO ) +if (rte_intr_type_get (dev->intr_handle) !=RTE_INTR_HANDLE_VFIO_MSI && +rte_intr_type_get (dev->intr_handle) !=RTE_INTR_HANDLE_UIO )return -ENOTSUP ; q->irq_enable =0 ;
@@ -4185,7 +4185,7 @@ static int acc100_pci_probe(struct rte_pci_driver *pci_drv,/* Fill HW specific part of device structure */ bbdev->device = &pci_dev->device; - bbdev->intr_handle = &pci_dev->intr_handle; + bbdev->intr_handle = pci_dev->intr_handle; bbdev->data->socket_id = pci_dev->device.numa_node;/* Invoke ACC100 device initialization function */
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +12 -12
@@ -743,17 +743,17 @@ fpga_intr_enable(struct rte_bbdev *dev)* It ensures that callback function assigned to that descriptor will * invoked when any FPGA queue issues interrupt. */ -for (i =0 ; i <FPGA_NUM_INTR_VEC ; ++i) - dev->intr_handle->efds[i] = dev->intr_handle->fd; - -if (!dev->intr_handle->intr_vec) { - dev->intr_handle->intr_vec =rte_zmalloc ("intr_vec" , - dev->data->num_queues *sizeof (int ),0 ); -if (!dev->intr_handle->intr_vec) { -rte_bbdev_log (ERR ,"Failed to allocate %u vectors" , - dev->data->num_queues); -return -ENOMEM ; - } +for (i =0 ; i <FPGA_NUM_INTR_VEC ; ++i) { +if (rte_intr_efds_index_set (dev->intr_handle, i, +rte_intr_fd_get (dev->intr_handle))) +return -rte_errno; + } + +if (rte_intr_vec_list_alloc (dev->intr_handle,"intr_vec" , + dev->data->num_queues)) { +rte_bbdev_log (ERR ,"Failed to allocate %u vectors" , + dev->data->num_queues); +return -ENOMEM ; } ret =rte_intr_enable (dev->intr_handle);
@@ -1880,7 +1880,7 @@ fpga_5gnr_fec_probe(struct rte_pci_driver *pci_drv,/* Fill HW specific part of device structure */ bbdev->device = &pci_dev->device; - bbdev->intr_handle = &pci_dev->intr_handle; + bbdev->intr_handle = pci_dev->intr_handle; bbdev->data->socket_id = pci_dev->device.numa_node;/* Invoke FEC FPGA device initialization function */
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +12 -12
@@ -1014,17 +1014,17 @@ fpga_intr_enable(struct rte_bbdev *dev)* It ensures that callback function assigned to that descriptor will * invoked when any FPGA queue issues interrupt. */ -for (i =0 ; i <FPGA_NUM_INTR_VEC ; ++i) - dev->intr_handle->efds[i] = dev->intr_handle->fd; - -if (!dev->intr_handle->intr_vec) { - dev->intr_handle->intr_vec =rte_zmalloc ("intr_vec" , - dev->data->num_queues *sizeof (int ),0 ); -if (!dev->intr_handle->intr_vec) { -rte_bbdev_log (ERR ,"Failed to allocate %u vectors" , - dev->data->num_queues); -return -ENOMEM ; - } +for (i =0 ; i <FPGA_NUM_INTR_VEC ; ++i) { +if (rte_intr_efds_index_set (dev->intr_handle, i, +rte_intr_fd_get (dev->intr_handle))) +return -rte_errno; + } + +if (rte_intr_vec_list_alloc (dev->intr_handle,"intr_vec" , + dev->data->num_queues)) { +rte_bbdev_log (ERR ,"Failed to allocate %u vectors" , + dev->data->num_queues); +return -ENOMEM ; } ret =rte_intr_enable (dev->intr_handle);
@@ -2370,7 +2370,7 @@ fpga_lte_fec_probe(struct rte_pci_driver *pci_drv,/* Fill HW specific part of device structure */ bbdev->device = &pci_dev->device; - bbdev->intr_handle = &pci_dev->intr_handle; + bbdev->intr_handle = pci_dev->intr_handle; bbdev->data->socket_id = pci_dev->device.numa_node;/* Invoke FEC FPGA device initialization function */
drivers/bus/auxiliary/auxiliary_common.c +15 -2
@@ -121,15 +121,27 @@ rte_auxiliary_probe_one_driver(struct rte_auxiliary_driver *drv,return -EINVAL ; } +/* Allocate interrupt instance */ + dev->intr_handle = +rte_intr_instance_alloc (RTE_INTR_INSTANCE_F_PRIVATE ); +if (dev->intr_handle ==NULL ) { +AUXILIARY_LOG (ERR ,"Could not allocate interrupt instance for device %s" , + dev->name); +return -ENOMEM ; + } + dev->driver = drv;AUXILIARY_LOG (INFO ,"Probe auxiliary driver: %s device: %s (NUMA node %i)" , drv->driver.name, dev->name, dev->device.numa_node); ret = drv->probe (drv, dev); -if (ret !=0 ) +if (ret !=0 ) { dev->driver =NULL ; -else +rte_intr_instance_free (dev->intr_handle); + dev->intr_handle =NULL ; + }else { dev->device.driver = &drv->driver; + }return ret; }
@@ -320,6 +332,7 @@ auxiliary_unplug(struct rte_device *dev)if (ret ==0 ) {rte_auxiliary_remove_device (adev);rte_devargs_remove (dev->devargs); +rte_intr_instance_free (adev->intr_handle);free (adev); }return ret;
drivers/bus/auxiliary/rte_bus_auxiliary.h +1 -1
@@ -115,7 +115,7 @@ struct rte_auxiliary_device {RTE_TAILQ_ENTRY (rte_auxiliary_device) next;/**< Next probed device. */ struct rte_device device;/**< Inherit core device */ char name[RTE_DEV_NAME_MAX_LEN +1 ];/**< ASCII device name */ -struct rte_intr_handle intr_handle;/**< Interrupt handle */ +struct rte_intr_handle *intr_handle;/**< Interrupt handle */ struct rte_auxiliary_driver *driver;/**< Device driver */ };
drivers/bus/dpaa/dpaa_bus.c +25 -3
@@ -172,6 +172,15 @@ dpaa_create_device_list(void) dev->device.bus = &rte_dpaa_bus.bus; +/* Allocate interrupt handle instance */ + dev->intr_handle = +rte_intr_instance_alloc (RTE_INTR_INSTANCE_F_PRIVATE ); +if (dev->intr_handle ==NULL ) { +DPAA_BUS_LOG (ERR ,"Failed to allocate intr handle" ); + ret = -ENOMEM ; + goto cleanup; + } + cfg = &dpaa_netcfg->port_cfg[i]; fman_intf = cfg->fman_if;
@@ -214,6 +223,15 @@ dpaa_create_device_list(void) goto cleanup; } +/* Allocate interrupt handle instance */ + dev->intr_handle = +rte_intr_instance_alloc (RTE_INTR_INSTANCE_F_PRIVATE ); +if (dev->intr_handle ==NULL ) { +DPAA_BUS_LOG (ERR ,"Failed to allocate intr handle" ); + ret = -ENOMEM ; + goto cleanup; + } + dev->device_type =FSL_DPAA_CRYPTO ; dev->id.dev_id = rte_dpaa_bus.device_count + i;
@@ -247,6 +265,7 @@ dpaa_clean_device_list(void) RTE_TAILQ_FOREACH_SAFE(dev, &rte_dpaa_bus.device_list, next, tdev) {TAILQ_REMOVE (&rte_dpaa_bus.device_list, dev, next); +rte_intr_instance_free (dev->intr_handle);free (dev); dev =NULL ; }
@@ -559,8 +578,11 @@ static int rte_dpaa_setup_intr(struct rte_intr_handle *intr_handle)return errno; } - intr_handle->fd = fd; - intr_handle->type =RTE_INTR_HANDLE_EXT ; +if (rte_intr_fd_set (intr_handle, fd)) +return rte_errno; + +if (rte_intr_type_set (intr_handle,RTE_INTR_HANDLE_EXT )) +return rte_errno;return 0 ; }
@@ -612,7 +634,7 @@ rte_dpaa_bus_probe(void) TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {if (dev->device_type ==FSL_DPAA_ETH ) { - ret =rte_dpaa_setup_intr (&dev->intr_handle); + ret =rte_dpaa_setup_intr (dev->intr_handle);if (ret)DPAA_BUS_ERR ("Error setting up interrupt.\n" ); }
drivers/bus/dpaa/rte_dpaa_bus.h +1 -1
@@ -98,7 +98,7 @@ struct rte_dpaa_device { };struct rte_dpaa_driver *driver;struct dpaa_device_id id; -struct rte_intr_handle intr_handle; +struct rte_intr_handle *intr_handle;enum rte_dpaa_type device_type;/**< Ethernet or crypto type device */ char name[RTE_ETH_NAME_MAX_LEN ]; };
drivers/bus/fslmc/fslmc_bus.c +13 -1
@@ -47,6 +47,7 @@ cleanup_fslmc_device_list(void) RTE_TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, t_dev) {TAILQ_REMOVE (&rte_fslmc_bus.device_list, dev, next); +rte_intr_instance_free (dev->intr_handle);free (dev); dev =NULL ; }
@@ -160,6 +161,15 @@ scan_one_fslmc_device(char *dev_name) dev->device.bus = &rte_fslmc_bus.bus; +/* Allocate interrupt instance */ + dev->intr_handle = +rte_intr_instance_alloc (RTE_INTR_INSTANCE_F_PRIVATE ); +if (dev->intr_handle ==NULL ) { +DPAA2_BUS_ERR ("Failed to allocate intr handle" ); + ret = -ENOMEM ; + goto cleanup; + } +/* Parse the device name and ID */ t_ptr =strtok (dup_dev_name,"." );if (!t_ptr) {
@@ -220,8 +230,10 @@ scan_one_fslmc_device(char *dev_name) cleanup:if (dup_dev_name)free (dup_dev_name); -if (dev) +if (dev) { +rte_intr_instance_free (dev->intr_handle);free (dev); + }return ret; }
drivers/bus/fslmc/fslmc_vfio.c +19 -11
@@ -599,7 +599,7 @@ int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, int index)int len, ret;char irq_set_buf[IRQ_SET_BUF_LEN ];struct vfio_irq_set *irq_set; -int *fd_ptr; +int *fd_ptr, vfio_dev_fd; len =sizeof (irq_set_buf);
@@ -611,12 +611,14 @@ int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, int index) irq_set->index = index; irq_set->start =0 ; fd_ptr = (int *)&irq_set->data; - *fd_ptr = intr_handle->fd; + *fd_ptr =rte_intr_fd_get (intr_handle); - ret =ioctl (intr_handle->vfio_dev_fd,VFIO_DEVICE_SET_IRQS , irq_set); + vfio_dev_fd =rte_intr_dev_fd_get (intr_handle); + ret =ioctl (vfio_dev_fd,VFIO_DEVICE_SET_IRQS , irq_set);if (ret) {DPAA2_BUS_ERR ("Error:dpaa2 SET IRQs fd=%d, err = %d(%s)" , - intr_handle->fd, errno,strerror (errno)); +rte_intr_fd_get (intr_handle), errno, +strerror (errno));return ret; }
@@ -627,7 +629,7 @@ int rte_dpaa2_intr_disable(struct rte_intr_handle *intr_handle, int index) {struct vfio_irq_set *irq_set;char irq_set_buf[IRQ_SET_BUF_LEN ]; -int len, ret; +int len, ret, vfio_dev_fd; len =sizeof (struct vfio_irq_set );
@@ -638,11 +640,12 @@ int rte_dpaa2_intr_disable(struct rte_intr_handle *intr_handle, int index) irq_set->start =0 ; irq_set->count =0 ; - ret =ioctl (intr_handle->vfio_dev_fd,VFIO_DEVICE_SET_IRQS , irq_set); + vfio_dev_fd =rte_intr_dev_fd_get (intr_handle); + ret =ioctl (vfio_dev_fd,VFIO_DEVICE_SET_IRQS , irq_set);if (ret)DPAA2_BUS_ERR ("Error disabling dpaa2 interrupts for fd %d" , - intr_handle->fd); +rte_intr_fd_get (intr_handle));return ret; }
@@ -684,9 +687,14 @@ rte_dpaa2_vfio_setup_intr(struct rte_intr_handle *intr_handle,return -1 ; } - intr_handle->fd = fd; - intr_handle->type =RTE_INTR_HANDLE_VFIO_MSI ; - intr_handle->vfio_dev_fd = vfio_dev_fd; +if (rte_intr_fd_set (intr_handle, fd)) +return -rte_errno; + +if (rte_intr_type_set (intr_handle,RTE_INTR_HANDLE_VFIO_MSI )) +return -rte_errno; + +if (rte_intr_dev_fd_set (intr_handle, vfio_dev_fd)) +return -rte_errno;return 0 ; }
@@ -711,7 +719,7 @@ fslmc_process_iodevices(struct rte_dpaa2_device *dev)switch (dev->dev_type) {case DPAA2_ETH : -rte_dpaa2_vfio_setup_intr (&dev->intr_handle, dev_fd, +rte_dpaa2_vfio_setup_intr (dev->intr_handle, dev_fd, device_info.num_irqs);break ;case DPAA2_CON :
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +14 -4
@@ -176,7 +176,7 @@ static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev)int threshold =0x3 , timeout =0xFF ; dpio_epoll_fd =epoll_create (1 ); - ret =rte_dpaa2_intr_enable (&dpio_dev->intr_handle,0 ); + ret =rte_dpaa2_intr_enable (dpio_dev->intr_handle,0 );if (ret) {DPAA2_BUS_ERR ("Interrupt registeration failed" );return -1 ;
@@ -195,7 +195,7 @@ static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev)qbman_swp_dqrr_thrshld_write (dpio_dev->sw_portal, threshold);qbman_swp_intr_timeout_write (dpio_dev->sw_portal, timeout); - eventfd = dpio_dev->intr_handle.fd; + eventfd =rte_intr_fd_get (dpio_dev->intr_handle); epoll_ev.events =EPOLLIN |EPOLLPRI |EPOLLET ; epoll_ev.data.fd = eventfd;
@@ -213,7 +213,7 @@ static void dpaa2_dpio_intr_deinit(struct dpaa2_dpio_dev *dpio_dev) {int ret; - ret =rte_dpaa2_intr_disable (&dpio_dev->intr_handle,0 ); + ret =rte_dpaa2_intr_disable (dpio_dev->intr_handle,0 );if (ret)DPAA2_BUS_ERR ("DPIO interrupt disable failed" );
@@ -388,6 +388,14 @@ dpaa2_create_dpio_device(int vdev_fd,/* Using single portal for all devices */ dpio_dev->mc_portal =dpaa2_get_mcp_ptr (MC_PORTAL_INDEX ); +/* Allocate interrupt instance */ + dpio_dev->intr_handle = +rte_intr_instance_alloc (RTE_INTR_INSTANCE_F_SHARED ); +if (!dpio_dev->intr_handle) { +DPAA2_BUS_ERR ("Failed to allocate intr handle" ); + goto err; + } + dpio_dev->dpio =rte_zmalloc (NULL ,sizeof (struct fsl_mc_io ),RTE_CACHE_LINE_SIZE );if (!dpio_dev->dpio) {
@@ -490,7 +498,7 @@ dpaa2_create_dpio_device(int vdev_fd, io_space_count++; dpio_dev->index = io_space_count; -if (rte_dpaa2_vfio_setup_intr (&dpio_dev->intr_handle, vdev_fd,1 )) { +if (rte_dpaa2_vfio_setup_intr (dpio_dev->intr_handle, vdev_fd,1 )) {DPAA2_BUS_ERR ("Fail to setup interrupt for %d" , dpio_dev->hw_id); goto err;
@@ -538,6 +546,7 @@ dpaa2_create_dpio_device(int vdev_fd,rte_free (dpio_dev->dpio); } +rte_intr_instance_free (dpio_dev->intr_handle);rte_free (dpio_dev);/* For each element in the list, cleanup */
@@ -549,6 +558,7 @@ dpaa2_create_dpio_device(int vdev_fd, dpio_dev->token);rte_free (dpio_dev->dpio); } +rte_intr_instance_free (dpio_dev->intr_handle);rte_free (dpio_dev); }
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +1 -1
@@ -116,7 +116,7 @@ struct dpaa2_dpio_dev {uintptr_t qbman_portal_ci_paddr;/**< Physical address of Cache Inhibit Area */ uintptr_t ci_size;/**< Size of the CI region */ -struct rte_intr_handle intr_handle;/* Interrupt related info */ +struct rte_intr_handle *intr_handle;/* Interrupt related info */ int32_t epoll_fd;/**< File descriptor created for interrupt polling */ int32_t hw_id;/**< An unique ID of this DPIO device instance */ struct dpaa2_portal_dqrr dpaa2_held_bufs;
drivers/bus/fslmc/rte_fslmc.h +1 -1
@@ -122,7 +122,7 @@ struct rte_dpaa2_device { };enum rte_dpaa2_dev_type dev_type;/**< Device Type */ uint16_t object_id;/**< DPAA2 Object ID */ -struct rte_intr_handle intr_handle;/**< Interrupt handle */ +struct rte_intr_handle *intr_handle;/**< Interrupt handle */ struct rte_dpaa2_driver *driver;/**< Associated driver */ char name[FSLMC_OBJECT_MAX_LEN ];/**< DPAA2 Object name*/ };
drivers/bus/ifpga/ifpga_bus.c +12 -1
@@ -161,6 +161,14 @@ ifpga_scan_one(struct rte_rawdev *rawdev, afu_dev->id.uuid.uuid_high =0 ; afu_dev->id.port = afu_pr_conf.afu_id.port; +/* Allocate interrupt instance */ + afu_dev->intr_handle = +rte_intr_instance_alloc (RTE_INTR_INSTANCE_F_PRIVATE ); +if (afu_dev->intr_handle ==NULL ) { +IFPGA_BUS_ERR ("Failed to allocate intr handle" ); + goto end; + } +if (rawdev->dev_ops && rawdev->dev_ops->dev_info_get) rawdev->dev_ops->dev_info_get (rawdev, afu_dev,sizeof (*afu_dev));
@@ -189,8 +197,10 @@ ifpga_scan_one(struct rte_rawdev *rawdev,rte_kvargs_free (kvlist);if (path)free (path); -if (afu_dev) +if (afu_dev) { +rte_intr_instance_free (afu_dev->intr_handle);free (afu_dev); + }return NULL ; }
@@ -396,6 +406,7 @@ ifpga_unplug(struct rte_device *dev)TAILQ_REMOVE (&ifpga_afu_dev_list, afu_dev, next);rte_devargs_remove (dev->devargs); +rte_intr_instance_free (afu_dev->intr_handle);free (afu_dev);return 0 ;
drivers/bus/ifpga/rte_bus_ifpga.h +1 -1
@@ -79,7 +79,7 @@ struct rte_afu_device {struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE ];/**< AFU Memory Resource */ struct rte_afu_shared shared; -struct rte_intr_handle intr_handle;/**< Interrupt handle */ +struct rte_intr_handle *intr_handle;/**< Interrupt handle */ struct rte_afu_driver *driver;/**< Associated driver */ char path[IFPGA_BUS_BITSTREAM_PATH_MAX_LEN ]; } __rte_packed;
drivers/bus/pci/bsd/pci.c +13 -7
@@ -95,10 +95,10 @@ pci_uio_free_resource(struct rte_pci_device *dev, {rte_free (uio_res); -if (dev->intr_handle.fd) { -close (dev->intr_handle.fd); - dev->intr_handle.fd =-1 ; - dev->intr_handle.type =RTE_INTR_HANDLE_UNKNOWN ; +if (rte_intr_fd_get (dev->intr_handle)) { +close (rte_intr_fd_get (dev->intr_handle)); +rte_intr_fd_set (dev->intr_handle,-1 ); +rte_intr_type_set (dev->intr_handle,RTE_INTR_HANDLE_UNKNOWN ); } }
@@ -121,13 +121,19 @@ pci_uio_alloc_resource(struct rte_pci_device *dev, }/* save fd if in primary process */ - dev->intr_handle.fd =open (devname,O_RDWR ); -if (dev->intr_handle.fd <0 ) { +if (rte_intr_fd_set (dev->intr_handle,open (devname,O_RDWR ))) { +RTE_LOG (WARNING ,EAL ,"Failed to save fd" ); + goto error; + } + +if (rte_intr_fd_get (dev->intr_handle) <0 ) {RTE_LOG (ERR ,EAL ,"Cannot open %s: %s\n" , devname,strerror (errno)); goto error; } - dev->intr_handle.type =RTE_INTR_HANDLE_UIO ; + +if (rte_intr_type_set (dev->intr_handle,RTE_INTR_HANDLE_UIO )) + goto error;/* allocate the mapping details for secondary processes*/ *uio_res =rte_zmalloc ("UIO_RES" ,sizeof (**uio_res),0 );
drivers/bus/pci/linux/pci.c +2 -2
@@ -645,7 +645,7 @@ int rte_pci_read_config(const struct rte_pci_device *device, void *buf, size_t len, off_t offset) { char devname[RTE_DEV_NAME_MAX_LEN] = ""; -const struct rte_intr_handle *intr_handle = &device->intr_handle; +const struct rte_intr_handle *intr_handle = device->intr_handle;switch (device->kdrv) {case RTE_PCI_KDRV_IGB_UIO :
@@ -669,7 +669,7 @@ int rte_pci_write_config(const struct rte_pci_device *device, const void *buf, size_t len, off_t offset) { char devname[RTE_DEV_NAME_MAX_LEN] = ""; -const struct rte_intr_handle *intr_handle = &device->intr_handle; +const struct rte_intr_handle *intr_handle = device->intr_handle;switch (device->kdrv) {case RTE_PCI_KDRV_IGB_UIO :
drivers/bus/pci/linux/pci_uio.c +45 -24
138 lines not on this page · raw message
drivers/bus/pci/linux/pci_vfio.c +64 -38
239 lines not on this page · raw message
drivers/bus/pci/pci_common.c +39 -8
67 lines not on this page · raw message
drivers/bus/pci/pci_common_uio.c +13 -8
@@ -90,8 +90,11 @@ pci_uio_map_resource(struct rte_pci_device *dev)struct mapped_pci_res_list *uio_res_list =RTE_TAILQ_CAST (rte_uio_tailq.head, mapped_pci_res_list); - dev->intr_handle.fd =-1 ; - dev->intr_handle.uio_cfg_fd =-1 ; +if (rte_intr_fd_set (dev->intr_handle,-1 )) +return -1 ; + +if (rte_intr_dev_fd_set (dev->intr_handle,-1 )) +return -1 ;/* secondary processes - use already recorded details */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )
@@ -207,6 +210,7 @@ pci_uio_unmap_resource(struct rte_pci_device *dev)struct mapped_pci_resource *uio_res;struct mapped_pci_res_list *uio_res_list =RTE_TAILQ_CAST (rte_uio_tailq.head, mapped_pci_res_list); +int uio_cfg_fd;if (dev ==NULL )return ;
@@ -229,12 +233,13 @@ pci_uio_unmap_resource(struct rte_pci_device *dev)rte_free (uio_res);/* close fd if in primary process */ -close (dev->intr_handle.fd); -if (dev->intr_handle.uio_cfg_fd >=0 ) { -close (dev->intr_handle.uio_cfg_fd); - dev->intr_handle.uio_cfg_fd =-1 ; +close (rte_intr_fd_get (dev->intr_handle)); + uio_cfg_fd =rte_intr_dev_fd_get (dev->intr_handle); +if (uio_cfg_fd >=0 ) { +close (uio_cfg_fd); +rte_intr_dev_fd_set (dev->intr_handle,-1 ); } - dev->intr_handle.fd =-1 ; - dev->intr_handle.type =RTE_INTR_HANDLE_UNKNOWN ; +rte_intr_fd_set (dev->intr_handle,-1 ); +rte_intr_type_set (dev->intr_handle,RTE_INTR_HANDLE_UNKNOWN ); }
drivers/bus/pci/rte_bus_pci.h +2 -2
@@ -69,12 +69,12 @@ struct rte_pci_device {struct rte_pci_id id;/**< PCI ID. */ struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE ];/**< PCI Memory Resource */ -struct rte_intr_handle intr_handle;/**< Interrupt handle */ +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_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; +struct rte_intr_handle *vfio_req_intr_handle;/**< Handler of VFIO request interrupt */ };
drivers/bus/vmbus/linux/vmbus_bus.c +6 -0
@@ -299,6 +299,12 @@ vmbus_scan_one(const char *name) dev->device.devargs =vmbus_devargs_lookup (dev); +/* Allocate interrupt handle instance */ + dev->intr_handle = +rte_intr_instance_alloc (RTE_INTR_INSTANCE_F_PRIVATE ); +if (dev->intr_handle ==NULL ) + goto error; +/* device is valid, add in list (sorted) */ VMBUS_LOG (DEBUG ,"Adding vmbus device %s" , name);
drivers/bus/vmbus/linux/vmbus_uio.c +22 -13
@@ -30,9 +30,11 @@ static void *vmbus_map_addr;/* Control interrupts */ void vmbus_uio_irq_control (struct rte_vmbus_device *dev,int32_t onoff) { -if (write (dev->intr_handle.fd, &onoff,sizeof (onoff)) <0 ) { +if (write (rte_intr_fd_get (dev->intr_handle), &onoff, +sizeof (onoff)) <0 ) {VMBUS_LOG (ERR ,"cannot write to %d:%s" , - dev->intr_handle.fd,strerror (errno)); +rte_intr_fd_get (dev->intr_handle), +strerror (errno)); } }
@@ -41,7 +43,8 @@ int vmbus_uio_irq_read(struct rte_vmbus_device *dev)int32_t count;int cc; - cc =read (dev->intr_handle.fd, &count,sizeof (count)); + cc =read (rte_intr_fd_get (dev->intr_handle), &count, +sizeof (count));if (cc < (int )sizeof (count)) {if (cc <0 ) { VMBUS_LOG(ERR, "IRQ read failed %s",
@@ -61,15 +64,15 @@ vmbus_uio_free_resource(struct rte_vmbus_device *dev, {rte_free (uio_res); -if (dev->intr_handle.uio_cfg_fd >=0 ) { -close (dev->intr_handle.uio_cfg_fd); - dev->intr_handle.uio_cfg_fd =-1 ; +if (rte_intr_dev_fd_get (dev->intr_handle) >=0 ) { +close (rte_intr_dev_fd_get (dev->intr_handle)); +rte_intr_dev_fd_set (dev->intr_handle,-1 ); } -if (dev->intr_handle.fd >=0 ) { -close (dev->intr_handle.fd); - dev->intr_handle.fd =-1 ; - dev->intr_handle.type =RTE_INTR_HANDLE_UNKNOWN ; +if (rte_intr_fd_get (dev->intr_handle) >=0 ) { +close (rte_intr_fd_get (dev->intr_handle)); +rte_intr_fd_set (dev->intr_handle,-1 ); +rte_intr_type_set (dev->intr_handle,RTE_INTR_HANDLE_UNKNOWN ); } }
@@ -78,16 +81,22 @@ vmbus_uio_alloc_resource(struct rte_vmbus_device *dev, struct mapped_vmbus_resource **uio_res) {char devname[PATH_MAX ];/* contains the /dev/uioX */ +int fd;/* save fd if in primary process */ snprintf (devname,sizeof (devname),"/dev/uio%u" , dev->uio_num); - dev->intr_handle.fd =open (devname,O_RDWR ); -if (dev->intr_handle.fd <0 ) { + fd =open (devname,O_RDWR ); +if (fd <0 ) {VMBUS_LOG (ERR ,"Cannot open %s: %s" , devname,strerror (errno)); goto error; } - dev->intr_handle.type =RTE_INTR_HANDLE_UIO_INTX ; + +if (rte_intr_fd_set (dev->intr_handle, fd)) + goto error; + +if (rte_intr_type_set (dev->intr_handle,RTE_INTR_HANDLE_UIO_INTX )) + goto error;/* allocate the mapping details for secondary processes*/ *uio_res =rte_zmalloc ("UIO_RES" ,sizeof (**uio_res),0 );
drivers/bus/vmbus/rte_bus_vmbus.h +1 -1
@@ -73,7 +73,7 @@ struct rte_vmbus_device {struct vmbus_channel *primary;/**< VMBUS primary channel */ struct vmbus_mon_page *monitor_page;/**< VMBUS monitor page */ -struct rte_intr_handle intr_handle;/**< Interrupt handle */ +struct rte_intr_handle *intr_handle;/**< Interrupt handle */ struct rte_mem_resource resource[VMBUS_MAX_RESOURCE ]; };
drivers/bus/vmbus/vmbus_common_uio.c +14 -9
@@ -171,9 +171,14 @@ vmbus_uio_map_resource(struct rte_vmbus_device *dev)int ret;/* TODO: handle rescind */ - dev->intr_handle.fd =-1 ; - dev->intr_handle.uio_cfg_fd =-1 ; - dev->intr_handle.type =RTE_INTR_HANDLE_UNKNOWN ; +if (rte_intr_fd_set (dev->intr_handle,-1 )) +return -1 ; + +if (rte_intr_dev_fd_set (dev->intr_handle,-1 )) +return -1 ; + +if (rte_intr_type_set (dev->intr_handle,RTE_INTR_HANDLE_UNKNOWN )) +return -1 ;/* secondary processes - use already recorded details */ if (rte_eal_process_type () !=RTE_PROC_PRIMARY )
@@ -253,12 +258,12 @@ vmbus_uio_unmap_resource(struct rte_vmbus_device *dev)rte_free (uio_res);/* close fd if in primary process */ -close (dev->intr_handle.fd); -if (dev->intr_handle.uio_cfg_fd >=0 ) { -close (dev->intr_handle.uio_cfg_fd); - dev->intr_handle.uio_cfg_fd =-1 ; +close (rte_intr_fd_get (dev->intr_handle)); +if (rte_intr_dev_fd_get (dev->intr_handle) >=0 ) { +close (rte_intr_dev_fd_get (dev->intr_handle)); +rte_intr_dev_fd_set (dev->intr_handle,-1 ); } - dev->intr_handle.fd =-1 ; - dev->intr_handle.type =RTE_INTR_HANDLE_UNKNOWN ; +rte_intr_fd_set (dev->intr_handle,-1 ); +rte_intr_type_set (dev->intr_handle,RTE_INTR_HANDLE_UNKNOWN ); }
drivers/common/cnxk/roc_cpt.c +4 -4
@@ -65,7 +65,7 @@ cpt_lf_register_misc_irq(struct roc_cpt_lf *lf)struct plt_intr_handle *handle;int rc, vec; - handle = &pci_dev->intr_handle; + handle = pci_dev->intr_handle; vec = lf->msixoff +CPT_LF_INT_VEC_MISC ;/* Clear err interrupt */
@@ -85,7 +85,7 @@ cpt_lf_unregister_misc_irq(struct roc_cpt_lf *lf)struct plt_intr_handle *handle;int vec; - handle = &pci_dev->intr_handle; + handle = pci_dev->intr_handle; vec = lf->msixoff +CPT_LF_INT_VEC_MISC ;/* Clear err interrupt */
@@ -129,7 +129,7 @@ cpt_lf_register_done_irq(struct roc_cpt_lf *lf)struct plt_intr_handle *handle;int rc, vec; - handle = &pci_dev->intr_handle; + handle = pci_dev->intr_handle; vec = lf->msixoff +CPT_LF_INT_VEC_DONE ;
@@ -152,7 +152,7 @@ cpt_lf_unregister_done_irq(struct roc_cpt_lf *lf)struct plt_intr_handle *handle;int vec; - handle = &pci_dev->intr_handle; + handle = pci_dev->intr_handle; vec = lf->msixoff +CPT_LF_INT_VEC_DONE ;
drivers/common/cnxk/roc_dev.c +7 -7
@@ -641,7 +641,7 @@ roc_af_pf_mbox_irq(void *param)static int mbox_register_pf_irq (struct plt_pci_device *pci_dev,struct dev *dev) { -struct plt_intr_handle *intr_handle = &pci_dev->intr_handle; +struct plt_intr_handle *intr_handle = pci_dev->intr_handle;int i, rc;/* HW clear irq */
@@ -691,7 +691,7 @@ mbox_register_pf_irq(struct plt_pci_device *pci_dev, struct dev *dev)static int mbox_register_vf_irq (struct plt_pci_device *pci_dev,struct dev *dev) { -struct plt_intr_handle *intr_handle = &pci_dev->intr_handle; +struct plt_intr_handle *intr_handle = pci_dev->intr_handle;int rc;/* Clear irq */
@@ -724,7 +724,7 @@ mbox_register_irq(struct plt_pci_device *pci_dev, struct dev *dev)static void mbox_unregister_pf_irq (struct plt_pci_device *pci_dev,struct dev *dev) { -struct plt_intr_handle *intr_handle = &pci_dev->intr_handle; +struct plt_intr_handle *intr_handle = pci_dev->intr_handle;int i;/* HW clear irq */
@@ -755,7 +755,7 @@ mbox_unregister_pf_irq(struct plt_pci_device *pci_dev, struct dev *dev)static void mbox_unregister_vf_irq (struct plt_pci_device *pci_dev,struct dev *dev) { -struct plt_intr_handle *intr_handle = &pci_dev->intr_handle; +struct plt_intr_handle *intr_handle = pci_dev->intr_handle;/* Clear irq */ plt_write64 (~0ull , dev->bar2 +RVU_VF_INT_ENA_W1C );
@@ -839,7 +839,7 @@ roc_pf_vf_flr_irq(void *param)static int vf_flr_unregister_irqs (struct plt_pci_device *pci_dev,struct dev *dev) { -struct plt_intr_handle *intr_handle = &pci_dev->intr_handle; +struct plt_intr_handle *intr_handle = pci_dev->intr_handle;int i;plt_base_dbg ("Unregister VF FLR interrupts for %s" , pci_dev->name);
@@ -860,7 +860,7 @@ vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev)static int vf_flr_register_irqs (struct plt_pci_device *pci_dev,struct dev *dev) { -struct plt_intr_handle *handle = &pci_dev->intr_handle; +struct plt_intr_handle *handle = pci_dev->intr_handle;int i, rc;plt_base_dbg ("Register VF FLR interrupts for %s" , pci_dev->name);
@@ -1211,7 +1211,7 @@ dev_init(struct dev *dev, struct plt_pci_device *pci_dev)int dev_fini (struct dev *dev,struct plt_pci_device *pci_dev) { -struct plt_intr_handle *intr_handle = &pci_dev->intr_handle; +struct plt_intr_handle *intr_handle = pci_dev->intr_handle;struct mbox *mbox;/* Check if this dev hosts npalf and has 1+ refs */
drivers/common/cnxk/roc_irq.c +62 -45
219 lines not on this page · raw message
drivers/common/cnxk/roc_nix_inl_dev_irq.c +4 -4
@@ -99,7 +99,7 @@ nix_inl_sso_hws_irq(void *param)int nix_inl_sso_register_irqs (struct nix_inl_dev *inl_dev) { -struct plt_intr_handle *handle = &inl_dev->pci_dev->intr_handle; +struct plt_intr_handle *handle = inl_dev->pci_dev->intr_handle;uintptr_t ssow_base = inl_dev->ssow_base;uintptr_t sso_base = inl_dev->sso_base;uint16_t sso_msixoff, ssow_msixoff;
@@ -147,7 +147,7 @@ nix_inl_sso_register_irqs(struct nix_inl_dev *inl_dev)void nix_inl_sso_unregister_irqs (struct nix_inl_dev *inl_dev) { -struct plt_intr_handle *handle = &inl_dev->pci_dev->intr_handle; +struct plt_intr_handle *handle = inl_dev->pci_dev->intr_handle;uintptr_t ssow_base = inl_dev->ssow_base;uintptr_t sso_base = inl_dev->sso_base;uint16_t sso_msixoff, ssow_msixoff;
@@ -282,7 +282,7 @@ nix_inl_nix_err_irq(void *param)int nix_inl_nix_register_irqs (struct nix_inl_dev *inl_dev) { -struct plt_intr_handle *handle = &inl_dev->pci_dev->intr_handle; +struct plt_intr_handle *handle = inl_dev->pci_dev->intr_handle;uintptr_t nix_base = inl_dev->nix_base;uint16_t msixoff;int rc;
@@ -331,7 +331,7 @@ nix_inl_nix_register_irqs(struct nix_inl_dev *inl_dev)void nix_inl_nix_unregister_irqs (struct nix_inl_dev *inl_dev) { -struct plt_intr_handle *handle = &inl_dev->pci_dev->intr_handle; +struct plt_intr_handle *handle = inl_dev->pci_dev->intr_handle;uintptr_t nix_base = inl_dev->nix_base;uint16_t msixoff;
drivers/common/cnxk/roc_nix_irq.c +19 -17
@@ -82,7 +82,7 @@ nix_lf_err_irq(void *param)static int nix_lf_register_err_irq (struct nix *nix) { -struct plt_intr_handle *handle = &nix->pci_dev->intr_handle; +struct plt_intr_handle *handle = nix->pci_dev->intr_handle;int rc, vec; vec = nix->msixoff +NIX_LF_INT_VEC_ERR_INT ;
@@ -99,7 +99,7 @@ nix_lf_register_err_irq(struct nix *nix)static void nix_lf_unregister_err_irq (struct nix *nix) { -struct plt_intr_handle *handle = &nix->pci_dev->intr_handle; +struct plt_intr_handle *handle = nix->pci_dev->intr_handle;int vec; vec = nix->msixoff +NIX_LF_INT_VEC_ERR_INT ;
@@ -131,7 +131,7 @@ nix_lf_ras_irq(void *param)static int nix_lf_register_ras_irq (struct nix *nix) { -struct plt_intr_handle *handle = &nix->pci_dev->intr_handle; +struct plt_intr_handle *handle = nix->pci_dev->intr_handle;int rc, vec; vec = nix->msixoff +NIX_LF_INT_VEC_POISON ;
@@ -148,7 +148,7 @@ nix_lf_register_ras_irq(struct nix *nix)static void nix_lf_unregister_ras_irq (struct nix *nix) { -struct plt_intr_handle *handle = &nix->pci_dev->intr_handle; +struct plt_intr_handle *handle = nix->pci_dev->intr_handle;int vec; vec = nix->msixoff +NIX_LF_INT_VEC_POISON ;
@@ -300,7 +300,7 @@ roc_nix_register_queue_irqs(struct roc_nix *roc_nix)struct nix *nix; nix =roc_nix_to_nix_priv (roc_nix); - handle = &nix->pci_dev->intr_handle; + handle = nix->pci_dev->intr_handle;/* Figure out max qintx required */ rqs =PLT_MIN (nix->qints, nix->nb_rx_queues);
@@ -352,7 +352,7 @@ roc_nix_unregister_queue_irqs(struct roc_nix *roc_nix)int vec, q; nix =roc_nix_to_nix_priv (roc_nix); - handle = &nix->pci_dev->intr_handle; + handle = nix->pci_dev->intr_handle;for (q =0 ; q < nix->configured_qints; q++) { vec = nix->msixoff +NIX_LF_INT_VEC_QINT_START + q;
@@ -382,7 +382,7 @@ roc_nix_register_cq_irqs(struct roc_nix *roc_nix)struct nix *nix; nix =roc_nix_to_nix_priv (roc_nix); - handle = &nix->pci_dev->intr_handle; + handle = nix->pci_dev->intr_handle; nix->configured_cints =PLT_MIN (nix->cints, nix->nb_rx_queues);
@@ -414,19 +414,19 @@ roc_nix_register_cq_irqs(struct roc_nix *roc_nix)return rc; } -if (!handle->intr_vec) { - handle->intr_vec =plt_zmalloc ( - nix->configured_cints *sizeof (int ),0 ); -if (!handle->intr_vec) { -plt_err ("Failed to allocate %d rx intr_vec" , - nix->configured_cints); -return -ENOMEM ; - } + rc =plt_intr_vec_list_alloc (handle,"cnxk" , + nix->configured_cints); +if (rc) { +plt_err ("Fail to allocate intr vec list, rc=%d" , + rc); +return rc; }/* VFIO vector zero is resereved for misc interrupt so * doing required adjustment. (b13bfab4cd) */ - handle->intr_vec[q] =PLT_INTR_VEC_RXTX_OFFSET + vec; +if (plt_intr_vec_list_index_set (handle, q, +PLT_INTR_VEC_RXTX_OFFSET + vec)) +return -1 ;/* Configure CQE interrupt coalescing parameters */ plt_write64(((CQ_CQE_THRESH_DEFAULT) |
@@ -450,7 +450,7 @@ roc_nix_unregister_cq_irqs(struct roc_nix *roc_nix)int vec, q; nix =roc_nix_to_nix_priv (roc_nix); - handle = &nix->pci_dev->intr_handle; + handle = nix->pci_dev->intr_handle;for (q =0 ; q < nix->configured_cints; q++) { vec = nix->msixoff +NIX_LF_INT_VEC_CINT_START + q;
@@ -465,6 +465,8 @@ roc_nix_unregister_cq_irqs(struct roc_nix *roc_nix)dev_irq_unregister (handle, nix_lf_cq_irq, &nix->cints_mem[q], vec); } + +plt_intr_vec_list_free (handle);plt_free (nix->cints_mem); }
drivers/common/cnxk/roc_npa.c +1 -1
@@ -710,7 +710,7 @@ npa_lf_init(struct dev *dev, struct plt_pci_device *pci_dev) lf->pf_func = dev->pf_func; lf->npa_msixoff = npa_msixoff; - lf->intr_handle = &pci_dev->intr_handle; + lf->intr_handle = pci_dev->intr_handle; lf->pci_dev = pci_dev; idev->npa_pf_func = dev->pf_func;
drivers/common/cnxk/roc_platform.h +37 -11
68 lines not on this page · raw message
drivers/common/cnxk/roc_sso.c +2 -2
@@ -505,7 +505,7 @@ roc_sso_rsrc_init(struct roc_sso *roc_sso, uint8_t nb_hws, uint16_t nb_hwgrp) goto sso_msix_fail; } - rc =sso_register_irqs_priv (roc_sso, &sso->pci_dev->intr_handle, nb_hws, + rc =sso_register_irqs_priv (roc_sso, sso->pci_dev->intr_handle, nb_hws, nb_hwgrp);if (rc <0 ) {plt_err ("Failed to register SSO LF IRQs" );
@@ -535,7 +535,7 @@ roc_sso_rsrc_fini(struct roc_sso *roc_sso)if (!roc_sso->nb_hws && !roc_sso->nb_hwgrp)return ; -sso_unregister_irqs_priv (roc_sso, &sso->pci_dev->intr_handle, +sso_unregister_irqs_priv (roc_sso, sso->pci_dev->intr_handle, roc_sso->nb_hws, roc_sso->nb_hwgrp);sso_lf_free (&sso->dev,SSO_LF_TYPE_HWS , roc_sso->nb_hws);sso_lf_free (&sso->dev,SSO_LF_TYPE_HWGRP , roc_sso->nb_hwgrp);
drivers/common/cnxk/roc_tim.c +2 -2
@@ -200,7 +200,7 @@ roc_tim_lf_alloc(struct roc_tim *roc_tim, uint8_t ring_id, uint64_t *clk)if (clk) *clk = rsp->tenns_clk; - rc =tim_register_irq_priv (roc_tim, &sso->pci_dev->intr_handle, ring_id, + rc =tim_register_irq_priv (roc_tim, sso->pci_dev->intr_handle, ring_id, tim->tim_msix_offsets[ring_id]);if (rc <0 ) {plt_tim_dbg ("Failed to register Ring[%d] IRQ" , ring_id);
@@ -223,7 +223,7 @@ roc_tim_lf_free(struct roc_tim *roc_tim, uint8_t ring_id)struct tim_ring_req *req;int rc = -ENOSPC ; -tim_unregister_irq_priv (roc_tim, &sso->pci_dev->intr_handle, ring_id, +tim_unregister_irq_priv (roc_tim, sso->pci_dev->intr_handle, ring_id, tim->tim_msix_offsets[ring_id]); req =mbox_alloc_msg_tim_lf_free (dev->mbox);
drivers/common/octeontx2/otx2_dev.c +7 -7
@@ -643,7 +643,7 @@ otx2_af_pf_mbox_irq(void *param)static int mbox_register_pf_irq (struct rte_pci_device *pci_dev,struct otx2_dev *dev) { -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;int i, rc;/* HW clear irq */
@@ -693,7 +693,7 @@ mbox_register_pf_irq(struct rte_pci_device *pci_dev, struct otx2_dev *dev)static int mbox_register_vf_irq (struct rte_pci_device *pci_dev,struct otx2_dev *dev) { -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;int rc;/* Clear irq */
@@ -726,7 +726,7 @@ mbox_register_irq(struct rte_pci_device *pci_dev, struct otx2_dev *dev)static void mbox_unregister_pf_irq (struct rte_pci_device *pci_dev,struct otx2_dev *dev) { -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;int i;/* HW clear irq */
@@ -758,7 +758,7 @@ mbox_unregister_pf_irq(struct rte_pci_device *pci_dev, struct otx2_dev *dev)static void mbox_unregister_vf_irq (struct rte_pci_device *pci_dev,struct otx2_dev *dev) { -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;/* Clear irq */ otx2_write64 (~0ull , dev->bar2 +RVU_VF_INT_ENA_W1C );
@@ -841,7 +841,7 @@ otx2_pf_vf_flr_irq(void *param)static int vf_flr_unregister_irqs (struct rte_pci_device *pci_dev,struct otx2_dev *dev) { -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;int i;otx2_base_dbg ("Unregister VF FLR interrupts for %s" , pci_dev->name);
@@ -862,7 +862,7 @@ vf_flr_unregister_irqs(struct rte_pci_device *pci_dev, struct otx2_dev *dev)static int vf_flr_register_irqs (struct rte_pci_device *pci_dev,struct otx2_dev *dev) { -struct rte_intr_handle *handle = &pci_dev->intr_handle; +struct rte_intr_handle *handle = pci_dev->intr_handle;int i, rc;otx2_base_dbg ("Register VF FLR interrupts for %s" , pci_dev->name);
@@ -1039,7 +1039,7 @@ otx2_dev_priv_init(struct rte_pci_device *pci_dev, void *otx2_dev)void otx2_dev_fini (struct rte_pci_device *pci_dev,void *otx2_dev) { -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;struct otx2_dev *dev = otx2_dev;struct otx2_idev_cfg *idev;struct otx2_mbox *mbox;
drivers/common/octeontx2/otx2_irq.c +68 -49
231 lines not on this page · raw message
drivers/crypto/octeontx2/otx2_cryptodev_hw_access.c +2 -2
@@ -36,7 +36,7 @@ otx2_cpt_lf_err_intr_unregister(const struct rte_cryptodev *dev, uint16_t msix_off, uintptr_t base) {struct rte_pci_device *pci_dev =RTE_DEV_TO_PCI (dev->device); -struct rte_intr_handle *handle = &pci_dev->intr_handle; +struct rte_intr_handle *handle = pci_dev->intr_handle;/* Disable error interrupts */ otx2_write64 (~0ull , base +OTX2_CPT_LF_MISC_INT_ENA_W1C );
@@ -65,7 +65,7 @@ otx2_cpt_lf_err_intr_register(const struct rte_cryptodev *dev, uint16_t msix_off, uintptr_t base) {struct rte_pci_device *pci_dev =RTE_DEV_TO_PCI (dev->device); -struct rte_intr_handle *handle = &pci_dev->intr_handle; +struct rte_intr_handle *handle = pci_dev->intr_handle;int ret;/* Disable error interrupts */
drivers/event/octeontx2/otx2_evdev_irq.c +6 -6
@@ -29,7 +29,7 @@ sso_lf_register_irq(const struct rte_eventdev *event_dev, uint16_t ggrp_msixoff, uintptr_t base) {struct rte_pci_device *pci_dev =RTE_DEV_TO_PCI (event_dev->dev); -struct rte_intr_handle *handle = &pci_dev->intr_handle; +struct rte_intr_handle *handle = pci_dev->intr_handle;int rc, vec; vec = ggrp_msixoff +SSO_LF_INT_VEC_GRP ;
@@ -66,7 +66,7 @@ ssow_lf_register_irq(const struct rte_eventdev *event_dev, uint16_t gws_msixoff, uintptr_t base) {struct rte_pci_device *pci_dev =RTE_DEV_TO_PCI (event_dev->dev); -struct rte_intr_handle *handle = &pci_dev->intr_handle; +struct rte_intr_handle *handle = pci_dev->intr_handle;int rc, vec; vec = gws_msixoff +SSOW_LF_INT_VEC_IOP ;
@@ -86,7 +86,7 @@ sso_lf_unregister_irq(const struct rte_eventdev *event_dev, uint16_t ggrp_msixoff, uintptr_t base) {struct rte_pci_device *pci_dev =RTE_DEV_TO_PCI (event_dev->dev); -struct rte_intr_handle *handle = &pci_dev->intr_handle; +struct rte_intr_handle *handle = pci_dev->intr_handle;int vec; vec = ggrp_msixoff +SSO_LF_INT_VEC_GRP ;
@@ -101,7 +101,7 @@ ssow_lf_unregister_irq(const struct rte_eventdev *event_dev, uint16_t gws_msixoff, uintptr_t base) {struct rte_pci_device *pci_dev =RTE_DEV_TO_PCI (event_dev->dev); -struct rte_intr_handle *handle = &pci_dev->intr_handle; +struct rte_intr_handle *handle = pci_dev->intr_handle;int vec; vec = gws_msixoff +SSOW_LF_INT_VEC_IOP ;
@@ -198,7 +198,7 @@ static int tim_lf_register_irq(struct rte_pci_device *pci_dev, uint16_t tim_msixoff, uintptr_t base) { - struct rte_intr_handle *handle = &pci_dev->intr_handle; + struct rte_intr_handle *handle = pci_dev->intr_handle;int rc, vec; vec = tim_msixoff +TIM_LF_INT_VEC_NRSPERR_INT ;
@@ -226,7 +226,7 @@ static void tim_lf_unregister_irq(struct rte_pci_device *pci_dev, uint16_t tim_msixoff, uintptr_t base) { - struct rte_intr_handle *handle = &pci_dev->intr_handle; + struct rte_intr_handle *handle = pci_dev->intr_handle;int vec; vec = tim_msixoff +TIM_LF_INT_VEC_NRSPERR_INT ;
drivers/mempool/octeontx2/otx2_mempool.c +1 -1
@@ -301,7 +301,7 @@ otx2_npa_lf_init(struct rte_pci_device *pci_dev, void *otx2_dev) lf->pf_func = dev->pf_func; lf->npa_msixoff = npa_msixoff; - lf->intr_handle = &pci_dev->intr_handle; + lf->intr_handle = pci_dev->intr_handle; lf->pci_dev = pci_dev; idev->npa_pf_func = dev->pf_func;
drivers/net/atlantic/atl_ethdev.c +8 -12
@@ -359,7 +359,7 @@ eth_atl_dev_init(struct rte_eth_dev *eth_dev) {struct atl_adapter *adapter = eth_dev->data->dev_private;struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;struct aq_hw_s *hw =ATL_DEV_PRIVATE_TO_HW (eth_dev->data->dev_private);int err =0 ;
@@ -478,7 +478,7 @@ atl_dev_start(struct rte_eth_dev *dev) {struct aq_hw_s *hw =ATL_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;uint32_t intr_vector =0 ;int status;int err;
@@ -524,10 +524,9 @@ atl_dev_start(struct rte_eth_dev *dev) } } -if (rte_intr_dp_is_en (intr_handle) && !intr_handle->intr_vec) { - intr_handle->intr_vec =rte_zmalloc ("intr_vec" , - dev->data->nb_rx_queues *sizeof (int ),0 ); -if (intr_handle->intr_vec ==NULL ) { +if (rte_intr_dp_is_en (intr_handle)) { +if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , + dev->data->nb_rx_queues)) {PMD_INIT_LOG (ERR ,"Failed to allocate %d rx_queues" " intr_vec" , dev->data->nb_rx_queues);return -ENOMEM ;
@@ -607,7 +606,7 @@ atl_dev_stop(struct rte_eth_dev *dev)struct aq_hw_s *hw =ATL_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;PMD_INIT_FUNC_TRACE (); dev->data->dev_started =0 ;
@@ -637,10 +636,7 @@ atl_dev_stop(struct rte_eth_dev *dev)/* Clean datapath event and queue/vec mapping */ rte_intr_efd_disable (intr_handle); -if (intr_handle->intr_vec !=NULL ) { -rte_free (intr_handle->intr_vec); - intr_handle->intr_vec =NULL ; - } +rte_intr_vec_list_free (intr_handle);return 0 ; }
@@ -691,7 +687,7 @@ static int atl_dev_close(struct rte_eth_dev *dev) {struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;struct aq_hw_s *hw;int ret;
drivers/net/avp/avp_ethdev.c +4 -4
@@ -711,7 +711,7 @@ avp_dev_interrupt_handler(void *data) status);/* re-enable UIO interrupt handling */ - ret =rte_intr_ack (&pci_dev->intr_handle); + ret =rte_intr_ack (pci_dev->intr_handle);if (ret <0 ) {PMD_DRV_LOG (ERR ,"Failed to re-enable UIO interrupts, ret=%d\n" , ret);
@@ -730,7 +730,7 @@ avp_dev_enable_interrupts(struct rte_eth_dev *eth_dev)return -EINVAL ;/* enable UIO interrupt handling */ - ret =rte_intr_enable (&pci_dev->intr_handle); + ret =rte_intr_enable (pci_dev->intr_handle);if (ret <0 ) {PMD_DRV_LOG (ERR ,"Failed to enable UIO interrupts, ret=%d\n" , ret);
@@ -759,7 +759,7 @@ avp_dev_disable_interrupts(struct rte_eth_dev *eth_dev) RTE_PTR_ADD(registers, RTE_AVP_INTERRUPT_MASK_OFFSET));/* enable UIO interrupt handling */ - ret =rte_intr_disable (&pci_dev->intr_handle); + ret =rte_intr_disable (pci_dev->intr_handle);if (ret <0 ) {PMD_DRV_LOG (ERR ,"Failed to disable UIO interrupts, ret=%d\n" , ret);
@@ -776,7 +776,7 @@ avp_dev_setup_interrupts(struct rte_eth_dev *eth_dev)int ret;/* register a callback handler with UIO for interrupt notifications */ - ret =rte_intr_callback_register (&pci_dev->intr_handle, + ret =rte_intr_callback_register (pci_dev->intr_handle, avp_dev_interrupt_handler, (void *)eth_dev);if (ret <0 ) {
drivers/net/axgbe/axgbe_ethdev.c +6 -6
@@ -313,7 +313,7 @@ axgbe_dev_interrupt_handler(void *param) } }/* Unmask interrupts since disabled after generation */ -rte_intr_ack (&pdata->pci_dev->intr_handle); +rte_intr_ack (pdata->pci_dev->intr_handle); }/*
@@ -374,7 +374,7 @@ axgbe_dev_start(struct rte_eth_dev *dev) }/* enable uio/vfio intr/eventfd mapping */ -rte_intr_enable (&pdata->pci_dev->intr_handle); +rte_intr_enable (pdata->pci_dev->intr_handle);/* phy start*/ pdata->phy_if.phy_start (pdata);
@@ -406,7 +406,7 @@ axgbe_dev_stop(struct rte_eth_dev *dev)PMD_INIT_FUNC_TRACE (); -rte_intr_disable (&pdata->pci_dev->intr_handle); +rte_intr_disable (pdata->pci_dev->intr_handle);if (rte_bit_relaxed_get32 (AXGBE_STOPPED , &pdata->dev_state))return 0 ;
@@ -2311,7 +2311,7 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)return ret; } -rte_intr_callback_register (&pci_dev->intr_handle, +rte_intr_callback_register (pci_dev->intr_handle, axgbe_dev_interrupt_handler, (void *)eth_dev); PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x",
@@ -2335,8 +2335,8 @@ axgbe_dev_close(struct rte_eth_dev *eth_dev)axgbe_dev_clear_queues (eth_dev);/* disable uio intr before callback unregister */ -rte_intr_disable (&pci_dev->intr_handle); -rte_intr_callback_unregister (&pci_dev->intr_handle, +rte_intr_disable (pci_dev->intr_handle); +rte_intr_callback_unregister (pci_dev->intr_handle, axgbe_dev_interrupt_handler, (void *)eth_dev);
drivers/net/axgbe/axgbe_mdio.c +3 -3
@@ -933,7 +933,7 @@ static int __axgbe_phy_config_aneg(struct axgbe_port *pdata) }/* Disable auto-negotiation interrupt */ -rte_intr_disable (&pdata->pci_dev->intr_handle); +rte_intr_disable (pdata->pci_dev->intr_handle);/* Start auto-negotiation in a supported mode */ if (axgbe_use_mode (pdata,AXGBE_MODE_KR )) {
@@ -951,7 +951,7 @@ static int __axgbe_phy_config_aneg(struct axgbe_port *pdata) }else if (axgbe_use_mode (pdata,AXGBE_MODE_SGMII_100 )) {axgbe_set_mode (pdata,AXGBE_MODE_SGMII_100 ); }else { -rte_intr_enable (&pdata->pci_dev->intr_handle); +rte_intr_enable (pdata->pci_dev->intr_handle);return -EINVAL ; }
@@ -964,7 +964,7 @@ static int __axgbe_phy_config_aneg(struct axgbe_port *pdata) pdata->kx_state =AXGBE_RX_BPA ;/* Re-enable auto-negotiation interrupt */ -rte_intr_enable (&pdata->pci_dev->intr_handle); +rte_intr_enable (pdata->pci_dev->intr_handle);axgbe_an37_enable_interrupts (pdata);axgbe_an_init (pdata);
drivers/net/bnx2x/bnx2x_ethdev.c +5 -5
@@ -134,7 +134,7 @@ bnx2x_interrupt_handler(void *param)PMD_DEBUG_PERIODIC_LOG (INFO , sc,"Interrupt handled" );bnx2x_interrupt_action (dev,1 ); -rte_intr_ack (&sc->pci_dev->intr_handle); +rte_intr_ack (sc->pci_dev->intr_handle); }static void bnx2x_periodic_start (void *param)
@@ -230,10 +230,10 @@ bnx2x_dev_start(struct rte_eth_dev *dev) }if (IS_PF (sc)) { -rte_intr_callback_register (&sc->pci_dev->intr_handle, +rte_intr_callback_register (sc->pci_dev->intr_handle, bnx2x_interrupt_handler, (void *)dev); -if (rte_intr_enable (&sc->pci_dev->intr_handle)) +if (rte_intr_enable (sc->pci_dev->intr_handle))PMD_DRV_LOG (ERR , sc,"rte_intr_enable failed" ); }
@@ -258,8 +258,8 @@ bnx2x_dev_stop(struct rte_eth_dev *dev)bnx2x_dev_rxtx_init_dummy (dev);if (IS_PF (sc)) { -rte_intr_disable (&sc->pci_dev->intr_handle); -rte_intr_callback_unregister (&sc->pci_dev->intr_handle, +rte_intr_disable (sc->pci_dev->intr_handle); +rte_intr_callback_unregister (sc->pci_dev->intr_handle, bnx2x_interrupt_handler, (void *)dev);/* stop the periodic callout */
drivers/net/bnxt/bnxt_ethdev.c +14 -19
@@ -729,7 +729,7 @@ static int bnxt_alloc_prev_ring_stats(struct bnxt *bp)static int bnxt_start_nic (struct bnxt *bp) {struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (bp->eth_dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;uint32_t intr_vector =0 ;uint32_t queue_id, base =BNXT_MISC_VEC_ID ;uint32_t vec =BNXT_MISC_VEC_ID ;
@@ -846,26 +846,24 @@ static int bnxt_start_nic(struct bnxt *bp)return rc; } -if (rte_intr_dp_is_en (intr_handle) && !intr_handle->intr_vec) { - intr_handle->intr_vec = -rte_zmalloc ("intr_vec" , - bp->eth_dev->data->nb_rx_queues * -sizeof (int ),0 ); -if (intr_handle->intr_vec ==NULL ) { +if (rte_intr_dp_is_en (intr_handle)) { +if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , + bp->eth_dev->data->nb_rx_queues)) {PMD_DRV_LOG (ERR ,"Failed to allocate %d rx_queues" " intr_vec" , bp->eth_dev->data->nb_rx_queues); rc = -ENOMEM ; goto err_out; } -PMD_DRV_LOG (DEBUG ,"intr_handle->intr_vec = %p " -"intr_handle->nb_efd = %d intr_handle->max_intr = %d\n" , - intr_handle->intr_vec, intr_handle->nb_efd, - intr_handle->max_intr); +PMD_DRV_LOG (DEBUG ,"intr_handle->nb_efd = %d " +"intr_handle->max_intr = %d\n" , +rte_intr_nb_efd_get (intr_handle), +rte_intr_max_intr_get (intr_handle));for (queue_id =0 ; queue_id < bp->eth_dev->data->nb_rx_queues; queue_id++) { - intr_handle->intr_vec[queue_id] = - vec +BNXT_RX_VEC_START ; -if (vec < base + intr_handle->nb_efd -1 ) +rte_intr_vec_list_index_set (intr_handle, + queue_id, vec +BNXT_RX_VEC_START ); +if (vec < base +rte_intr_nb_efd_get (intr_handle) + -1 ) vec++; } }
@@ -1473,7 +1471,7 @@ static int bnxt_dev_stop(struct rte_eth_dev *eth_dev) {struct bnxt *bp = eth_dev->data->dev_private;struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;struct rte_eth_link link;int ret;
@@ -1515,10 +1513,7 @@ static int bnxt_dev_stop(struct rte_eth_dev *eth_dev)/* Clean queue intr-vector mapping */ rte_intr_efd_disable (intr_handle); -if (intr_handle->intr_vec !=NULL ) { -rte_free (intr_handle->intr_vec); - intr_handle->intr_vec =NULL ; - } +rte_intr_vec_list_free (intr_handle);bnxt_hwrm_port_clr_stats (bp);bnxt_free_tx_mbufs (bp);
drivers/net/bnxt/bnxt_irq.c +2 -2
@@ -67,7 +67,7 @@ void bnxt_int_handler(void *param)int bnxt_free_int (struct bnxt *bp) { -struct rte_intr_handle *intr_handle = &bp->pdev->intr_handle; +struct rte_intr_handle *intr_handle = bp->pdev->intr_handle;struct bnxt_irq *irq = bp->irq_tbl;int rc =0 ;
@@ -170,7 +170,7 @@ int bnxt_setup_int(struct bnxt *bp)int bnxt_request_int (struct bnxt *bp) { -struct rte_intr_handle *intr_handle = &bp->pdev->intr_handle; +struct rte_intr_handle *intr_handle = bp->pdev->intr_handle;struct bnxt_irq *irq = bp->irq_tbl;int rc =0 ;
drivers/net/dpaa/dpaa_ethdev.c +31 -17
100 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -1145,7 +1145,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev)struct rte_intr_handle *intr_handle; dpaa2_dev = container_of(rdev, struct rte_dpaa2_device, device); - intr_handle = &dpaa2_dev->intr_handle; + intr_handle = dpaa2_dev->intr_handle;PMD_INIT_FUNC_TRACE ();
@@ -1216,8 +1216,8 @@ dpaa2_dev_start(struct rte_eth_dev *dev) }/* if the interrupts were configured on this devices*/ -if (intr_handle && (intr_handle->fd) && - (dev->data->dev_conf.intr_conf.lsc !=0 )) { +if (intr_handle &&rte_intr_fd_get (intr_handle) && + dev->data->dev_conf.intr_conf.lsc !=0 ) {/* Registering LSC interrupt handler */ rte_intr_callback_register(intr_handle, dpaa2_interrupt_handler,
@@ -1256,8 +1256,8 @@ dpaa2_dev_stop(struct rte_eth_dev *dev)PMD_INIT_FUNC_TRACE ();/* reset interrupt callback */ -if (intr_handle && (intr_handle->fd) && - (dev->data->dev_conf.intr_conf.lsc !=0 )) { +if (intr_handle &&rte_intr_fd_get (intr_handle) && + dev->data->dev_conf.intr_conf.lsc !=0 ) {/*disable dpni irqs */ dpaa2_eth_setup_irqs (dev,0 );
drivers/net/e1000/em_ethdev.c +9 -14
@@ -237,7 +237,7 @@ static int eth_em_dev_init(struct rte_eth_dev *eth_dev) {struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;struct e1000_adapter *adapter =E1000_DEV_PRIVATE (eth_dev->data->dev_private); struct e1000_hw *hw =
@@ -523,7 +523,7 @@ eth_em_start(struct rte_eth_dev *dev)struct e1000_hw *hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;int ret, mask;uint32_t intr_vector =0 ;uint32_t *speeds;
@@ -573,12 +573,10 @@ eth_em_start(struct rte_eth_dev *dev) }if (rte_intr_dp_is_en (intr_handle)) { - intr_handle->intr_vec = -rte_zmalloc ("intr_vec" , - dev->data->nb_rx_queues *sizeof (int ),0 ); -if (intr_handle->intr_vec ==NULL ) { +if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , + dev->data->nb_rx_queues)) {PMD_INIT_LOG (ERR ,"Failed to allocate %d rx_queues" -" intr_vec" , dev->data->nb_rx_queues); +" intr_vec" , dev->data->nb_rx_queues);return -ENOMEM ; }
@@ -716,7 +714,7 @@ eth_em_stop(struct rte_eth_dev *dev)struct rte_eth_link link;struct e1000_hw *hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle; dev->data->dev_started =0 ;
@@ -750,10 +748,7 @@ eth_em_stop(struct rte_eth_dev *dev)/* Clean datapath event and queue/vec mapping */ rte_intr_efd_disable (intr_handle); -if (intr_handle->intr_vec !=NULL ) { -rte_free (intr_handle->intr_vec); - intr_handle->intr_vec =NULL ; - } +rte_intr_vec_list_free (intr_handle);return 0 ; }
@@ -765,7 +760,7 @@ eth_em_close(struct rte_eth_dev *dev)struct e1000_adapter *adapter =E1000_DEV_PRIVATE (dev->data->dev_private);struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;int ret;if (rte_eal_process_type () !=RTE_PROC_PRIMARY )
@@ -1006,7 +1001,7 @@ eth_em_rx_queue_intr_enable(struct rte_eth_dev *dev, __rte_unused uint16_t queue {struct e1000_hw *hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;em_rxq_intr_enable (hw);rte_intr_ack (intr_handle);
drivers/net/e1000/igb_ethdev.c +36 -43
215 lines not on this page · raw message
drivers/net/ena/ena_ethdev.c +19 -16
@@ -494,7 +494,7 @@ static void ena_config_debug_area(struct ena_adapter *adapter)static int ena_close (struct rte_eth_dev *dev) {struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;struct ena_adapter *adapter = dev->data->dev_private;int ret =0 ;
@@ -954,7 +954,7 @@ static int ena_stop(struct rte_eth_dev *dev)struct ena_adapter *adapter = dev->data->dev_private;struct ena_com_dev *ena_dev = &adapter->ena_dev;struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;int rc;/* Cannot free memory in secondary process */
@@ -976,10 +976,9 @@ static int ena_stop(struct rte_eth_dev *dev)rte_intr_disable (intr_handle);rte_intr_efd_disable (intr_handle); -if (intr_handle->intr_vec !=NULL ) { -rte_free (intr_handle->intr_vec); - intr_handle->intr_vec =NULL ; - } + +/* Cleanup vector list */ +rte_intr_vec_list_free (intr_handle);rte_intr_enable (intr_handle);
@@ -995,7 +994,7 @@ static int ena_create_io_queue(struct rte_eth_dev *dev, struct ena_ring *ring)struct ena_adapter *adapter = ring->adapter;struct ena_com_dev *ena_dev = &adapter->ena_dev;struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;struct ena_com_create_io_ctx ctx =/* policy set to _HOST just to satisfy icc compiler */ {ENA_ADMIN_PLACEMENT_POLICY_HOST ,
@@ -1015,7 +1014,10 @@ static int ena_create_io_queue(struct rte_eth_dev *dev, struct ena_ring *ring) ena_qid =ENA_IO_RXQ_IDX (ring->id); ctx.direction =ENA_COM_IO_QUEUE_DIRECTION_RX ;if (rte_intr_dp_is_en (intr_handle)) - ctx.msix_vector = intr_handle->intr_vec[ring->id]; + ctx.msix_vector = +rte_intr_vec_list_index_get (intr_handle, + ring->id); +for (i =0 ; i < ring->ring_size; i++) ring->empty_rx_reqs[i] = i; }
@@ -1824,7 +1826,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev) pci_dev->addr.devid, pci_dev->addr.function); - intr_handle = &pci_dev->intr_handle; + intr_handle = pci_dev->intr_handle; adapter->regs = pci_dev->mem_resource[ENA_REGS_BAR ].addr; adapter->dev_mem_base = pci_dev->mem_resource[ENA_MEM_BAR ].addr;
@@ -3112,7 +3114,7 @@ static int ena_parse_devargs(struct ena_adapter *adapter,static int ena_setup_rx_intr (struct rte_eth_dev *dev) {struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (dev); -struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; +struct rte_intr_handle *intr_handle = pci_dev->intr_handle;int rc;uint16_t vectors_nb, i;bool rx_intr_requested = dev->data->dev_conf.intr_conf.rxq;
@@ -3139,9 +3141,9 @@ static int ena_setup_rx_intr(struct rte_eth_dev *dev) goto enable_intr; } - intr_handle->intr_vec =rte_zmalloc ("intr_vec" , - dev->data->nb_rx_queues *sizeof (*intr_handle->intr_vec),0 ); -if (intr_handle->intr_vec ==NULL ) { +/* Allocate the vector list */ +if (rte_intr_vec_list_alloc (intr_handle,"intr_vec" , + dev->data->nb_rx_queues)) {PMD_DRV_LOG (ERR ,"Failed to allocate interrupt vector for %d queues\n" , dev->data->nb_rx_queues);
@@ -3160,7 +3162,9 @@ static int ena_setup_rx_intr(struct rte_eth_dev *dev) }for (i =0 ; i < vectors_nb; ++i) - intr_handle->intr_vec[i] =RTE_INTR_VEC_RXTX_OFFSET + i; +if (rte_intr_vec_list_index_set (intr_handle, i, +RTE_INTR_VEC_RXTX_OFFSET + i)) + goto disable_intr_efd;rte_intr_enable (intr_handle);return 0 ;
@@ -3168,8 +3172,7 @@ static int ena_setup_rx_intr(struct rte_eth_dev *dev) disable_intr_efd:rte_intr_efd_disable (intr_handle); free_intr_vec: -rte_free (intr_handle->intr_vec); - intr_handle->intr_vec =NULL ; +rte_intr_vec_list_free (intr_handle); enable_intr:rte_intr_enable (intr_handle);return rc;
drivers/net/enic/enic_main.c +13 -13
@@ -448,7 +448,7 @@ enic_intr_handler(void *arg)rte_eth_dev_callback_process (dev,RTE_ETH_EVENT_INTR_LSC ,NULL );enic_log_q_error (enic);/* Re-enable irq in case of INTx */ -rte_intr_ack (&enic->pdev->intr_handle); +rte_intr_ack (enic->pdev->intr_handle); }static int enic_rxq_intr_init (struct enic *enic)
@@ -477,14 +477,16 @@ static int enic_rxq_intr_init(struct enic *enic) " interrupts\n");return err; } - intr_handle->intr_vec =rte_zmalloc ("enic_intr_vec" , - rxq_intr_count *sizeof (int ),0 ); -if (intr_handle->intr_vec ==NULL ) { + +if (rte_intr_vec_list_alloc (intr_handle,"enic_intr_vec" , + rxq_intr_count)) {dev_err (enic,"Failed to allocate intr_vec\n" );return -ENOMEM ; }for (i =0 ; i < rxq_intr_count; i++) - intr_handle->intr_vec[i] = i +ENICPMD_RXQ_INTR_OFFSET ; +if (rte_intr_vec_list_index_set (intr_handle, i, + i +ENICPMD_RXQ_INTR_OFFSET )) +return -rte_errno;return 0 ; }
@@ -494,10 +496,8 @@ static void enic_rxq_intr_deinit(struct enic *enic) intr_handle = enic->rte_dev->intr_handle;rte_intr_efd_disable (intr_handle); -if (intr_handle->intr_vec !=NULL ) { -rte_free (intr_handle->intr_vec); - intr_handle->intr_vec =NULL ; - } + +rte_intr_vec_list_free (intr_handle); }static void enic_prep_wq_for_simple_tx (struct enic *enic,uint16_t queue_idx)
@@ -667,10 +667,10 @@ int enic_enable(struct enic *enic)vnic_dev_enable_wait (enic->vdev);/* Register and enable error interrupt */ -rte_intr_callback_register (&(enic->pdev->intr_handle), +rte_intr_callback_register (enic->pdev->intr_handle, enic_intr_handler, (void *)enic->rte_dev); -rte_intr_enable (&(enic->pdev->intr_handle)); +rte_intr_enable (enic->pdev->intr_handle);/* Unmask LSC interrupt */ vnic_intr_unmask (&enic->intr[ENICPMD_LSC_INTR_OFFSET ]);
@@ -1111,8 +1111,8 @@ int enic_disable(struct enic *enic) (void )vnic_intr_masked (&enic->intr[i]);/* flush write */ }enic_rxq_intr_deinit (enic); -rte_intr_disable (&enic->pdev->intr_handle); -rte_intr_callback_unregister (&enic->pdev->intr_handle, +rte_intr_disable (enic->pdev->intr_handle); +rte_intr_callback_unregister (enic->pdev->intr_handle, enic_intr_handler, (void *)enic->rte_dev);
drivers/net/failsafe/failsafe.c +17 -4
@@ -264,11 +264,23 @@ fs_eth_dev_create(struct rte_vdev_device *vdev) RTE_ETHER_ADDR_BYTES(mac)); dev->data->dev_flags |=RTE_ETH_DEV_INTR_LSC |RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS ; -PRIV (dev)->intr_handle = (struct rte_intr_handle ){ - .fd =-1 , - .type =RTE_INTR_HANDLE_EXT , - }; + +/* Allocate interrupt instance */ +PRIV (dev)->intr_handle = +rte_intr_instance_alloc (RTE_INTR_INSTANCE_F_SHARED ); +if (PRIV (dev)->intr_handle ==NULL ) { +ERROR ("Failed to allocate intr handle" ); + goto cancel_alarm; + } + +if (rte_intr_fd_set (PRIV (dev)->intr_handle,-1 )) + goto cancel_alarm; + +if (rte_intr_type_set (PRIV (dev)->intr_handle,RTE_INTR_HANDLE_EXT )) + goto cancel_alarm; +rte_eth_dev_probing_finish (dev); +return 0 ; cancel_alarm:failsafe_hotplug_alarm_cancel (dev);
@@ -297,6 +309,7 @@ fs_rte_eth_free(const char *name)return 0 ;/* port already released */ ret =failsafe_eth_dev_close (dev);rte_eth_dev_release_port (dev); +rte_intr_instance_free (PRIV (dev)->intr_handle);return ret; }
drivers/net/failsafe/failsafe_intr.c +24 -19
84 lines not on this page · raw message
drivers/net/failsafe/failsafe_ops.c +13 -6
@@ -393,15 +393,22 @@ fs_rx_queue_setup(struct rte_eth_dev *dev,* For the time being, fake as if we are using MSIX interrupts, * this will cause rte_intr_efd_enable to allocate an eventfd for us. */ -struct rte_intr_handle intr_handle = { - .type =RTE_INTR_HANDLE_VFIO_MSIX , - .efds = {-1 , }, - }; +struct rte_intr_handle *intr_handle;struct sub_device *sdev;struct rxq *rxq;uint8_t i;int ret; + intr_handle =rte_intr_instance_alloc (RTE_INTR_INSTANCE_F_PRIVATE ); +if (intr_handle ==NULL ) +return -ENOMEM ; + +if (rte_intr_type_set (intr_handle,RTE_INTR_HANDLE_VFIO_MSIX )) +return -rte_errno; + +if (rte_intr_efds_index_set (intr_handle,0 ,-1 )) +return -rte_errno; +fs_lock (dev,0 );if (rx_conf->rx_deferred_start) { FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
@@ -435,12 +442,12 @@ fs_rx_queue_setup(struct rte_eth_dev *dev, rxq->info.nb_desc = nb_rx_desc; rxq->priv =PRIV (dev); rxq->sdev =PRIV (dev)->subs; - ret =rte_intr_efd_enable (&intr_handle,1 ); + ret =rte_intr_efd_enable (intr_handle,1 );if (ret <0 ) {
Lines of this file are not shown. View the raw message.
drivers/net/failsafe/failsafe_private.h +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/hns3/hns3_ethdev.c +27 -30
57 lines not on this page · raw message
drivers/net/hns3/hns3_ethdev_vf.c +32 -32
64 lines not on this page · raw message
drivers/net/i40e/i40e_ethdev.c +26 -27
53 lines not on this page · raw message
drivers/net/iavf/iavf_ethdev.c +21 -21
42 lines not on this page · raw message
drivers/net/ice/ice_ethdev.c +24 -25
49 lines not on this page · raw message
drivers/net/igc/igc_ethdev.c +21 -24
45 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ethdev.c +30 -36
66 lines not on this page · raw message
drivers/net/memif/memif_socket.c +79 -29
108 lines not on this page · raw message
drivers/net/memif/rte_eth_memif.c +44 -12
56 lines not on this page · raw message
drivers/net/mlx4/mlx4_intr.c +28 -19
47 lines not on this page · raw message
drivers/net/mlx5/linux/mlx5_os.c +35 -20
55 lines not on this page · raw message
drivers/net/mlx5/mlx5_rxq.c +24 -19
43 lines not on this page · raw message
drivers/net/octeontx2/otx2_ethdev_irq.c +17 -18
Lines of this file are not shown. View the raw message.
drivers/net/vhost/rte_eth_vhost.c +45 -35
80 lines not on this page · raw message
drivers/net/virtio/virtio_user/virtio_user_dev.c +35 -21
56 lines not on this page · raw message
drivers/net/vmxnet3/vmxnet3_ethdev.c +23 -20
43 lines not on this page · raw message
drivers/raw/ifpga/ifpga_rawdev.c +46 -16
62 lines not on this page · raw message
drivers/regex/octeontx2/otx2_regexdev_hw_access.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +30 -14
44 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.23.0
Part of the diff is not shown here. View the raw message.
PATCH v8 7/9 interrupts: make interrupt handle structure opaque
In reply to David MarchandFrom: Harman Kalra <[email protected]>
Moving interrupt handle structure definition inside a EAL private header to make its fields totally opaque to the outside world.
---
Changes since v5:
- let rte_intr_handle fields untouched:
- split vfio / uio fd renames in a separate commit,
- split event list update in a separate commit,
- moved rte_intr_handle definition to a EAL private header,
- preserved dumping all info in interrupt tracepoints,
--- lib/eal/common/eal_common_interrupts.c | 2 + lib/eal/common/eal_interrupts.h | 37 +++++++++++++ lib/eal/include/meson.build | 1 - lib/eal/include/rte_eal_interrupts.h | 72 -------------------------- lib/eal/include/rte_eal_trace.h | 2 + lib/eal/include/rte_interrupts.h | 24 ++++++++- 6 files changed, 63 insertions(+), 75 deletions(-) create mode 100644 lib/eal/common/eal_interrupts.h delete mode 100644 lib/eal/include/rte_eal_interrupts.h
lib/eal/common/eal_common_interrupts.c +2 -0
@@ -10,6 +10,8 @@#include <rte_log.h> #include <rte_malloc.h> +#include "eal_interrupts.h" +/* Macros to check for valid interrupt handle */ #define CHECK_VALID_INTR_HANDLE (intr_handle) do { \ if (intr_handle == NULL) { \
lib/eal/common/eal_interrupts.h new file +37 -0
@@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2010-2014 Intel Corporation +*/ + +#ifndef EAL_INTERRUPTS_H +#define EAL_INTERRUPTS_H + +struct rte_intr_handle { + RTE_STD_C11 + union { +struct { + RTE_STD_C11 + union { +/** VFIO device file descriptor */ +int vfio_dev_fd; +/** UIO cfg file desc for uio_pci_generic */ +int uio_cfg_fd; + }; +int fd;/**< interrupt event file descriptor */ + }; +void *windows_handle;/**< device driver handle */ + }; +uint32_t alloc_flags;/**< flags passed at allocation */ +enum rte_intr_handle_type type;/**< handle type */ +uint32_t max_intr;/**< max interrupt requested */ +uint32_t nb_efd;/**< number of available efd(event fd) */ +uint8_t efd_counter_size;/**< size of efd counter, used for vdev */ +uint16_t nb_intr; +/**< Max vector count, default RTE_MAX_RXTX_INTR_VEC_ID */ +int efds[RTE_MAX_RXTX_INTR_VEC_ID ];/**< intr vectors/efds mapping */ +struct rte_epoll_event elist[RTE_MAX_RXTX_INTR_VEC_ID ]; +/**< intr vector epoll event */ +uint16_t vec_list_size; +int *intr_vec;/**< intr vector number array */ +}; + +#endif /* EAL_INTERRUPTS_H */
lib/eal/include/meson.build +0 -1
@@ -49,7 +49,6 @@ headers += files( 'rte_version.h', 'rte_vfio.h', ) -indirect_headers += files('rte_eal_interrupts.h') # special case install the generic headers, since they go in a subdir generic_headers = files(
lib/eal/include/rte_eal_interrupts.h deleted +0 -72
72 lines not on this page · raw message
lib/eal/include/rte_eal_trace.h +2 -0
@@ -19,6 +19,8 @@ extern "C" {#include <rte_interrupts.h> #include <rte_trace_point.h> +#include "eal_interrupts.h" +/* Alarm */ RTE_TRACE_POINT( rte_eal_trace_alarm_set,
lib/eal/include/rte_interrupts.h +22 -2
@@ -35,6 +35,28 @@ struct rte_intr_handle;/** Interrupt instance will be shared between primary and secondary processes. */ #define RTE_INTR_INSTANCE_F_SHARED RTE_BIT32(0) +#define RTE_MAX_RXTX_INTR_VEC_ID 512 +#define RTE_INTR_VEC_ZERO_OFFSET 0 +#define RTE_INTR_VEC_RXTX_OFFSET 1 + +/** +* The interrupt source type, e.g. UIO, VFIO, ALARM etc. +*/ +enum rte_intr_handle_type { +RTE_INTR_HANDLE_UNKNOWN =0 ,/**< generic unknown handle */ +RTE_INTR_HANDLE_UIO ,/**< uio device handle */ +RTE_INTR_HANDLE_UIO_INTX ,/**< uio generic handle */ +RTE_INTR_HANDLE_VFIO_LEGACY ,/**< vfio device handle (legacy) */ +RTE_INTR_HANDLE_VFIO_MSI ,/**< vfio device handle (MSI) */ +RTE_INTR_HANDLE_VFIO_MSIX ,/**< vfio device handle (MSIX) */ +RTE_INTR_HANDLE_ALARM ,/**< alarm handle */ +RTE_INTR_HANDLE_EXT ,/**< external handler */ +RTE_INTR_HANDLE_VDEV ,/**< virtual device */ +RTE_INTR_HANDLE_DEV_EVENT ,/**< device event handle */ +RTE_INTR_HANDLE_VFIO_REQ ,/**< VFIO request handle */ +RTE_INTR_HANDLE_MAX /**< count of elements */ +}; +/** Function to be registered for the specific interrupt */ typedef void (*rte_intr_callback_fn )(void *cb_arg);
@@ -45,8 +67,6 @@ typedef void (*rte_intr_callback_fn)(void *cb_arg);typedef void (*rte_intr_unregister_callback_fn )(struct rte_intr_handle *intr_handle,void *cb_arg); -#include "rte_eal_interrupts.h" -/** * It registers the callback for the specific interrupt. Multiple * callbacks can be registered at the same time.
Signature · 1 line
2.23.0
PATCH v8 8/9 interrupts: rename device specific file descriptor
In reply to David MarchandFrom: Harman Kalra <[email protected]>
VFIO/UIO are mutually exclusive, storing file descriptor in a single field is enough.
---
Changes since v5:
- split from patch5,
--- lib/eal/common/eal_common_interrupts.c | 6 +++--- lib/eal/common/eal_interrupts.h | 8 +------- lib/eal/include/rte_eal_trace.h | 8 ++++---- 3 files changed, 8 insertions(+), 14 deletions(-)
lib/eal/common/eal_common_interrupts.c +3 -3
@@ -72,7 +72,7 @@ struct rte_intr_handle *rte_intr_instance_dup(const struct rte_intr_handle *src) intr_handle =rte_intr_instance_alloc (src->alloc_flags); intr_handle->fd = src->fd; - intr_handle->vfio_dev_fd = src->vfio_dev_fd; + intr_handle->dev_fd = src->dev_fd; intr_handle->type = src->type; intr_handle->max_intr = src->max_intr; intr_handle->nb_efd = src->nb_efd;
@@ -139,7 +139,7 @@ int rte_intr_dev_fd_set(struct rte_intr_handle *intr_handle, int fd) {CHECK_VALID_INTR_HANDLE (intr_handle); - intr_handle->vfio_dev_fd = fd; + intr_handle->dev_fd = fd;return 0 ; fail:
@@ -150,7 +150,7 @@ int rte_intr_dev_fd_get(const struct rte_intr_handle *intr_handle) {CHECK_VALID_INTR_HANDLE (intr_handle); -return intr_handle->vfio_dev_fd; +return intr_handle->dev_fd; fail:return -1 ; }
lib/eal/common/eal_interrupts.h +1 -7
@@ -9,13 +9,7 @@ struct rte_intr_handle {RTE_STD_C11 union {struct { - RTE_STD_C11 - union { -/** VFIO device file descriptor */ -int vfio_dev_fd; -/** UIO cfg file desc for uio_pci_generic */ -int uio_cfg_fd; - }; +int dev_fd;/**< VFIO/UIO cfg device file descriptor */ int fd;/**< interrupt event file descriptor */ };void *windows_handle;/**< device driver handle */
lib/eal/include/rte_eal_trace.h +4 -4
@@ -151,7 +151,7 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_ARGS(const struct rte_intr_handle *handle, rte_intr_callback_fn cb, void *cb_arg, int rc),rte_trace_point_emit_int (rc); -rte_trace_point_emit_int (handle->vfio_dev_fd); +rte_trace_point_emit_int (handle->dev_fd);rte_trace_point_emit_int (handle->fd);rte_trace_point_emit_int (handle->type);rte_trace_point_emit_u32 (handle->max_intr);
@@ -164,7 +164,7 @@ RTE_TRACE_POINT( RTE_TRACE_POINT_ARGS(const struct rte_intr_handle *handle, rte_intr_callback_fn cb, void *cb_arg, int rc),rte_trace_point_emit_int (rc); -rte_trace_point_emit_int (handle->vfio_dev_fd); +rte_trace_point_emit_int (handle->dev_fd);rte_trace_point_emit_int (handle->fd);rte_trace_point_emit_int (handle->type);rte_trace_point_emit_u32 (handle->max_intr);
@@ -176,7 +176,7 @@ RTE_TRACE_POINT( rte_eal_trace_intr_enable, RTE_TRACE_POINT_ARGS(const struct rte_intr_handle *handle, int rc),rte_trace_point_emit_int (rc); -rte_trace_point_emit_int (handle->vfio_dev_fd); +rte_trace_point_emit_int (handle->dev_fd);rte_trace_point_emit_int (handle->fd);rte_trace_point_emit_int (handle->type);rte_trace_point_emit_u32 (handle->max_intr);
@@ -186,7 +186,7 @@ RTE_TRACE_POINT( rte_eal_trace_intr_disable, RTE_TRACE_POINT_ARGS(const struct rte_intr_handle *handle, int rc),rte_trace_point_emit_int (rc); -rte_trace_point_emit_int (handle->vfio_dev_fd); +rte_trace_point_emit_int (handle->dev_fd);rte_trace_point_emit_int (handle->fd);rte_trace_point_emit_int (handle->type);rte_trace_point_emit_u32 (handle->max_intr);
Signature · 1 line
2.23.0
PATCH v8 9/9 interrupts: extend event list
In reply to David MarchandFrom: Harman Kalra <[email protected]>
Dynamically allocating the efds and elist array of intr_handle structure, based on size provided by user. Eg size can be MSIX interrupts supported by a PCI device.
---
Changes since v6:
- removed unneeded checks on elist/efds array initialisation,
Changes since v5:
- split from patch5,
--- drivers/bus/pci/linux/pci_vfio.c | 6 ++ drivers/common/cnxk/roc_platform.h | 1 + lib/eal/common/eal_common_interrupts.c | 95 +++++++++++++++++++++++++- lib/eal/common/eal_interrupts.h | 5 +- 4 files changed, 102 insertions(+), 5 deletions(-)
drivers/bus/pci/linux/pci_vfio.c +6 -0
@@ -266,6 +266,12 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd)return -1 ; } +/* Reallocate the efds and elist fields of intr_handle based +* on PCI device MSIX size. +*/ +if (rte_intr_event_list_update (dev->intr_handle, irq.count)) +return -1 ; +/* if this vector cannot be used with eventfd, fail if we explicitly * specified interrupt type, otherwise continue */ if ((irq.flags &VFIO_IRQ_INFO_EVENTFD ) ==0 ) {
drivers/common/cnxk/roc_platform.h +1 -0
@@ -121,6 +121,7 @@#define plt_intr_instance_alloc rte_intr_instance_alloc#define plt_intr_instance_dup rte_intr_instance_dup#define plt_intr_instance_free rte_intr_instance_free +#define plt_intr_event_list_update rte_intr_event_list_update#define plt_intr_max_intr_get rte_intr_max_intr_get#define plt_intr_max_intr_set rte_intr_max_intr_set#define plt_intr_nb_efd_get rte_intr_nb_efd_get
lib/eal/common/eal_common_interrupts.c +93 -2
117 lines not on this page · raw message
lib/eal/common/eal_interrupts.h +2 -3
@@ -21,9 +21,8 @@ struct rte_intr_handle {uint8_t efd_counter_size;/**< size of efd counter, used for vdev */ uint16_t nb_intr;/**< Max vector count, default RTE_MAX_RXTX_INTR_VEC_ID */ -int efds[RTE_MAX_RXTX_INTR_VEC_ID ];/**< intr vectors/efds mapping */ -struct rte_epoll_event elist[RTE_MAX_RXTX_INTR_VEC_ID ]; -/**< intr vector epoll event */ +int *efds;/**< intr vectors/efds mapping */ +struct rte_epoll_event *elist;/**< intr vector epoll event */ uint16_t vec_list_size;int *intr_vec;/**< intr vector number array */ };
Signature · 1 line
2.23.0
Re: [dpdk-dev] [PATCH v8 9/9] interrupts: extend event list
Hi Harman,
This patch is causing QAT failed during interrupt init, the event list does not support interrupt count size zero in QAT case.
There is also Bugzilla relate to this issue: https://bugs.dpdk.org/show_bug.cgi?id=843
Regards
Kai
Quoted 28 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of David Marchand
Sent: Monday, October 25, 2021 3:27 PM
To: [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Burakov, Anatoly <[email protected]>; Nithin Dabilpuram <[email protected]>; Kiran Kumar K <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Rao <[email protected]>
Subject: [dpdk-dev] [PATCH v8 9/9] interrupts: extend event listFrom: Harman Kalra <[email protected]> https://bugs.dpdk.org/show_bug.cgi?id=843
Dynamically allocating the efds and elist array of
intr_handlestructure, based on size provided by user. Eg size can be MSIX interrupts supported by a PCI device.Signed-off-by Harman Kalra <[email protected]>Signed-off-by David Marchand <[email protected]>Acked-by Dmitry Kozlyuk <[email protected]>---
Changes since v6:
- removed unneeded checks on elist/efds array initialisation,Changes since v5:
- split from patch5,---
Re: [dpdk-dev] [PATCH v8 9/9] interrupts: extend event list
Quoted 3 lines · Kai
This patch is causing QAT failed during interrupt init, the event list does not support interrupt count size zero in QAT case.
There is also Bugzilla relate to this issue: https://bugs.dpdk.org/show_bug.cgi?id=843
(We could avoid updating event list if it is large enough but) your problem must be that QAT does not have MSIX.
Can you try this quick fix?
drivers/bus/pci/linux/pci_vfio.c +0 -0
@@ -269,7 +269,8 @@ pci_vfio_setup_interrupts(struct rte_pci_device
*dev, int vfio_dev_fd)
/* Reallocate the efds and elist fields of intr_handle based
* on PCI device MSIX size.
*/- if (rte_intr_event_list_update(dev->intr_handle, irq.count))
+ if (i == VFIO_PCI_MSIX_IRQ_INDEX &&
+rte_intr_event_list_update(dev->intr_handle, irq.count))
return -1;
/* if this vector cannot be used with eventfd, fail ifwe explicitly
Signature · 1 line
David Marchand
Hi,
Quoted 254 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Monday, October 25, 2021 5:27 PM
To: [email protected]; [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>; NBU-Contact-Thomas Monjalon <[email protected]>
Subject: [PATCH v8 0/9] makerte_intr_handleinternalMoving struct
rte_intr_handleas an internal structure to avoid any ABI breakages in future. Since this structure defines some static arrays and changing respective macros breaks the ABI.
Eg:
CurrentlyRTE_MAX_RXTX_INTR_VEC_IDimposes a limit of maximum 512 MSI-X interrupts that can be defined for a PCI device, while PCI specification allows maximum 2048 MSI-X interrupts that can be used.
If some PCI device requires more than 512 vectors, either change theRTE_MAX_RXTX_INTR_VEC_IDlimit or dynamically allocate based on PCI device MSI-X size on probe time. Either way its an ABI breakage.Change already included in 21.11 ABI improvement spreadsheet (item 42):
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Furld
efense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps- 3A__docs.google.com_s&data=04%7C01%7Crasland%40nvidia.com%7C c626e0d058714bc3075a08d997c39557%7C43083d15727340c1b7db39efd9ccc17 a%7C0%7C0%7C637707688554493769%7CUnknown%7CTWFpbGZsb3d8eyJWI joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1 000&sdata=y7vFUXbUzh6ise1zn8bzbfuUGv6L24gCNcUsuWKqRBk%3D& amp;reserved=0 preadsheets_d_1betlC000ua5SsSiJIcC54mCCCJnW6voH5Dqv9UxeyfE_edit- 23gid-
3D0&d=DwICaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=5ESHPj7V- 7JdkxT_Z_SU6RrS37ys4U XudBQ_rrS5LRo&m=7dl3OmXU7QHMmWYB6V1hYJtq1cUkjfhXUwze2Si_48c &s=lh6DEGhR
Bg1shODpAy3RQk-H-0uQx5icRfUBf9dtCp4&e=This series makes struct
rte_intr_handletotally opaque to the outside world by wrapping it inside a .c file and providing get set wrapper APIs to read or manipulate its fields.. Any changes to be made to any of the fields should be done via these get set APIs.
Introduced a neweal_common_interrupts.cwhere all these APIs are defined and also hides structrte_intr_handledefinition.v1:
* Fixed freebsd compilation failure
* Fixed seg fault in case of memifv2:
* Merged the prototype and implementation patch to 1.
* Restricting allocation of single interrupt instance.
* Removed base APIs, as they were exposing internally allocated memory information.
* Fixed some memory leak issues.
* Marked some library specific APIs as internal.v3:
* Removed flag from instance alloc API, rather auto detect if memory should be allocated using glibc malloc APIs or
rte_malloc*
* Added APIs for get/set windows handle.
* Defined macros for repeated checks.v4:
* Rectified some typo in the APIs documentation.
* Better names for some internal variables.v5:
* Reverted back to passing flag to instance alloc API, as with auto detect some multiprocess issues existing in the library were causing tests failure.
* Rebased to top of tree.v6:
* renamedRTE_INTR_INSTANCE_F_UNSHAREDasRTE_INTR_INSTANCE_F_PRIVATE,
* changed API and removed need foralloc_flagcontent exposure (seerte_intr_instance_dup()in patch 1 and 2),
* exported all symbols for Windows,
* fixed leak in unit tests in case of alloc failure,
* split (previously) patch 4 into three patches
* (now) patch 4 only concerns alarm and (previously) patch 6 cleanup bits are squashed in it,
* (now) patch 5 concerns other libraries updates,
* (now) patch 6 concerns drivers updates:
* instance allocation is moved to probing for auxiliary,
* there might be a bug for PCI drivers non requestingRTE_PCI_DRV_NEED_MAPPING, but code is left as v5,
* split (previously) patch 5 into three patches
* (now) patch 7 only hides structure, but keep it in a EAL private header, this makes it possible to keep info in tracepoints,
* (now) patch 8 deals with VFIO/UIO internal fds merge,
* (now) patch 9 extends event list,v7:
* fixed compilation on FreeBSD,
* removed unused interrupt handle in FreeBSD alarm code,
* fixed interrupt handle allocation for PCI drivers withoutRTE_PCI_DRV_NEED_MAPPING,v8:
* lowered logs level to DEBUG in sanity checks,
* fixed corner case with vector list access,--
David MarchandHarman Kalra (9):
interrupts: add allocator and accessors
interrupts: remove direct access to interrupt handle test/interrupts: remove direct access to interrupt handle
alarm: remove direct access to interrupt handle
lib: remove direct access to interrupt handle
drivers: remove direct access to interrupt handle
interrupts: make interrupt handle structure opaque
interrupts: rename device specific file descriptor
interrupts: extend event listMAINTAINERS | 1 + app/test/test_interrupts.c | 164 +++-- drivers/baseband/acc100/rte_acc100_pmd.c | 14 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 24 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 24 +- drivers/bus/auxiliary/auxiliary_common.c | 17 +- drivers/bus/auxiliary/rte_bus_auxiliary.h | 2 +- drivers/bus/dpaa/dpaa_bus.c | 28 +- drivers/bus/dpaa/rte_dpaa_bus.h | 2 +- drivers/bus/fslmc/fslmc_bus.c | 14 +- drivers/bus/fslmc/fslmc_vfio.c | 30 +- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 18 +- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +- drivers/bus/fslmc/rte_fslmc.h | 2 +- drivers/bus/ifpga/ifpga_bus.c | 13 +- drivers/bus/ifpga/rte_bus_ifpga.h | 2 +- drivers/bus/pci/bsd/pci.c | 20 +- drivers/bus/pci/linux/pci.c | 4 +- drivers/bus/pci/linux/pci_uio.c | 69 +- drivers/bus/pci/linux/pci_vfio.c | 108 ++- drivers/bus/pci/pci_common.c | 47 +- drivers/bus/pci/pci_common_uio.c | 21 +- drivers/bus/pci/rte_bus_pci.h | 4 +- drivers/bus/vmbus/linux/vmbus_bus.c | 6 + drivers/bus/vmbus/linux/vmbus_uio.c | 35 +- drivers/bus/vmbus/rte_bus_vmbus.h | 2 +- drivers/bus/vmbus/vmbus_common_uio.c | 23 +- drivers/common/cnxk/roc_cpt.c | 8 +- drivers/common/cnxk/roc_dev.c | 14 +- drivers/common/cnxk/roc_irq.c | 107 +-- drivers/common/cnxk/roc_nix_inl_dev_irq.c | 8 +- drivers/common/cnxk/roc_nix_irq.c | 36 +- drivers/common/cnxk/roc_npa.c | 2 +- drivers/common/cnxk/roc_platform.h | 49 +- drivers/common/cnxk/roc_sso.c | 4 +- drivers/common/cnxk/roc_tim.c | 4 +- drivers/common/octeontx2/otx2_dev.c | 14 +- drivers/common/octeontx2/otx2_irq.c | 117 ++-- .../octeontx2/otx2_cryptodev_hw_access.c | 4 +- drivers/event/octeontx2/otx2_evdev_irq.c | 12 +- drivers/mempool/octeontx2/otx2_mempool.c | 2 +- drivers/net/atlantic/atl_ethdev.c | 20 +- drivers/net/avp/avp_ethdev.c | 8 +- drivers/net/axgbe/axgbe_ethdev.c | 12 +- drivers/net/axgbe/axgbe_mdio.c | 6 +- drivers/net/bnx2x/bnx2x_ethdev.c | 10 +- drivers/net/bnxt/bnxt_ethdev.c | 33 +- drivers/net/bnxt/bnxt_irq.c | 4 +- drivers/net/dpaa/dpaa_ethdev.c | 48 +- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +- drivers/net/e1000/em_ethdev.c | 23 +- drivers/net/e1000/igb_ethdev.c | 79 +-- drivers/net/ena/ena_ethdev.c | 35 +- drivers/net/enic/enic_main.c | 26 +- drivers/net/failsafe/failsafe.c | 21 +- drivers/net/failsafe/failsafe_intr.c | 43 +- drivers/net/failsafe/failsafe_ops.c | 19 +- drivers/net/failsafe/failsafe_private.h | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 32 +- drivers/net/hinic/hinic_pmd_ethdev.c | 10 +- drivers/net/hns3/hns3_ethdev.c | 57 +- drivers/net/hns3/hns3_ethdev_vf.c | 64 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 53 +- drivers/net/iavf/iavf_ethdev.c | 42 +- drivers/net/iavf/iavf_vchnl.c | 4 +- drivers/net/ice/ice_dcf.c | 10 +- drivers/net/ice/ice_dcf_ethdev.c | 21 +- drivers/net/ice/ice_ethdev.c | 49 +- drivers/net/igc/igc_ethdev.c | 45 +- drivers/net/ionic/ionic_ethdev.c | 17 +- drivers/net/ixgbe/ixgbe_ethdev.c | 66 +- drivers/net/memif/memif_socket.c | 108 ++- drivers/net/memif/memif_socket.h | 4 +- drivers/net/memif/rte_eth_memif.c | 56 +- drivers/net/memif/rte_eth_memif.h | 2 +- drivers/net/mlx4/mlx4.c | 19 +- drivers/net/mlx4/mlx4.h | 2 +- drivers/net/mlx4/mlx4_intr.c | 47 +- drivers/net/mlx5/linux/mlx5_os.c | 55 +- drivers/net/mlx5/linux/mlx5_socket.c | 25 +- drivers/net/mlx5/mlx5.h | 6 +- drivers/net/mlx5/mlx5_rxq.c | 43 +- drivers/net/mlx5/mlx5_trigger.c | 4 +- drivers/net/mlx5/mlx5_txpp.c | 25 +- drivers/net/netvsc/hn_ethdev.c | 4 +- drivers/net/nfp/nfp_common.c | 34 +- drivers/net/nfp/nfp_ethdev.c | 13 +- drivers/net/nfp/nfp_ethdev_vf.c | 13 +- drivers/net/ngbe/ngbe_ethdev.c | 29 +- drivers/net/octeontx2/otx2_ethdev_irq.c | 35 +- drivers/net/qede/qede_ethdev.c | 16 +- drivers/net/sfc/sfc_intr.c | 30 +- drivers/net/tap/rte_eth_tap.c | 33 +- drivers/net/tap/rte_eth_tap.h | 2 +- drivers/net/tap/tap_intr.c | 33 +- drivers/net/thunderx/nicvf_ethdev.c | 10 + drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/txgbe/txgbe_ethdev.c | 38 +- drivers/net/txgbe/txgbe_ethdev_vf.c | 33 +- drivers/net/vhost/rte_eth_vhost.c | 80 ++- drivers/net/virtio/virtio_ethdev.c | 21 +- .../net/virtio/virtio_user/virtio_user_dev.c | 56 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 43 +- drivers/raw/ifpga/ifpga_rawdev.c | 62 +- drivers/raw/ntb/ntb.c | 9 +- .../regex/octeontx2/otx2_regexdev_hw_access.c | 4 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 5 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 8 + drivers/vdpa/mlx5/mlx5_vdpa.h | 4 +- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 21 +- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 44 +- lib/bbdev/rte_bbdev.c | 4 +- lib/eal/common/eal_common_interrupts.c | 500 ++++++++++++++ lib/eal/common/eal_interrupts.h | 30 + lib/eal/common/eal_private.h | 10 + lib/eal/common/meson.build | 1 + lib/eal/freebsd/eal.c | 1 + lib/eal/freebsd/eal_alarm.c | 35 +- lib/eal/freebsd/eal_interrupts.c | 85 ++- lib/eal/include/meson.build | 2 +- lib/eal/include/rte_eal_interrupts.h | 269 -------- lib/eal/include/rte_eal_trace.h | 10 +- lib/eal/include/rte_epoll.h | 118 ++++ lib/eal/include/rte_interrupts.h | 651 +++++++++++++++++- lib/eal/linux/eal.c | 1 + lib/eal/linux/eal_alarm.c | 32 +- lib/eal/linux/eal_dev.c | 57 +- lib/eal/linux/eal_interrupts.c | 304 ++++---- lib/eal/version.map | 45 +- lib/ethdev/ethdev_pci.h | 2 +- lib/ethdev/rte_ethdev.c | 14 +- 132 files changed, 3449 insertions(+), 1748 deletions(-) create mode 100644 lib/eal/common/eal_common_interrupts.c create mode 100644 lib/eal/common/eal_interrupts.h delete mode 100644 lib/eal/include/rte_eal_interrupts.h create mode 100644 lib/eal/include/rte_epoll.h
Quoted 2 lines
--
2.23.0
Kindest regards,
Raslan Darawsheh
Quoted 88 lines · David Marchand
Moving struct
rte_intr_handleas an internal structure to avoid any ABI breakages in future. Since this structure defines some static arrays and changing respective macros breaks the ABI. Eg:
CurrentlyRTE_MAX_RXTX_INTR_VEC_IDimposes a limit of maximum 512 MSI-X interrupts that can be defined for a PCI device, while PCI specification allows maximum 2048 MSI-X interrupts that can be used. If some PCI device requires more than 512 vectors, either change theRTE_MAX_RXTX_INTR_VEC_IDlimit or dynamically allocate based on PCI device MSI-X size on probe time. Either way its an ABI breakage.Change already included in 21.11 ABI improvement spreadsheet (item 42):
https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.google.com_s
preadsheets_d_1betlC000ua5SsSiJIcC54mCCCJnW6voH5Dqv9UxeyfE_edit-23gid- 3D0&d=DwICaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=5ESHPj7V-7JdkxT_Z_SU6RrS37ys4U XudBQ_rrS5LRo&m=7dl3OmXU7QHMmWYB6V1hYJtq1cUkjfhXUwze2Si_48c&s=lh6DEGhR Bg1shODpAy3RQk-H-0uQx5icRfUBf9dtCp4&e=This series makes struct
rte_intr_handletotally opaque to the outside world by wrapping it inside a .c file and providing get set wrapper APIs to read or manipulate its fields.. Any changes to be made to any of the fields should be done via these get set APIs.
Introduced a neweal_common_interrupts.cwhere all these APIs are defined and also hides structrte_intr_handledefinition.v1:
* Fixed freebsd compilation failure
* Fixed seg fault in case of memifv2:
* Merged the prototype and implementation patch to 1.
* Restricting allocation of single interrupt instance.
* Removed base APIs, as they were exposing internally allocated memory information.
* Fixed some memory leak issues.
* Marked some library specific APIs as internal.v3:
* Removed flag from instance alloc API, rather auto detect if memory should be allocated using glibc malloc APIs or rte_malloc*
* Added APIs for get/set windows handle.
* Defined macros for repeated checks.v4:
* Rectified some typo in the APIs documentation.
* Better names for some internal variables.v5:
* Reverted back to passing flag to instance alloc API, as with auto detect some multiprocess issues existing in the library were causing tests failure.
* Rebased to top of tree.v6:
* renamedRTE_INTR_INSTANCE_F_UNSHAREDasRTE_INTR_INSTANCE_F_PRIVATE,
* changed API and removed need foralloc_flagcontent exposure (seerte_intr_instance_dup()in patch 1 and 2),
* exported all symbols for Windows,
* fixed leak in unit tests in case of alloc failure,
* split (previously) patch 4 into three patches
* (now) patch 4 only concerns alarm and (previously) patch 6 cleanup bits are squashed in it,
* (now) patch 5 concerns other libraries updates,
* (now) patch 6 concerns drivers updates:
* instance allocation is moved to probing for auxiliary,
* there might be a bug for PCI drivers non requestingRTE_PCI_DRV_NEED_MAPPING, but code is left as v5,
* split (previously) patch 5 into three patches
* (now) patch 7 only hides structure, but keep it in a EAL private header, this makes it possible to keep info in tracepoints,
* (now) patch 8 deals with VFIO/UIO internal fds merge,
* (now) patch 9 extends event list,v7:
* fixed compilation on FreeBSD,
* removed unused interrupt handle in FreeBSD alarm code,
* fixed interrupt handle allocation for PCI drivers withoutRTE_PCI_DRV_NEED_MAPPING,v8:
* lowered logs level to DEBUG in sanity checks,
* fixed corner case with vector list access,--
David Marchand
Quoted 10 lines
Harman Kalra (9):
interrupts: add allocator and accessors
interrupts: remove direct access to interrupt handle test/interrupts: remove direct access to interrupt handle
alarm: remove direct access to interrupt handle
lib: remove direct access to interrupt handle
drivers: remove direct access to interrupt handle
interrupts: make interrupt handle structure opaque
interrupts: rename device specific file descriptor
interrupts: extend event list
Series applied, thanks.
Signature · 1 line
David Marchand