src/dpdk/drivers/bus/pci/pci_common_uio.c
void
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);

	if (dev == NULL)
		return;

	/* find an entry for the device */
	uio_res = pci_uio_find_resource(dev);
	if (uio_res == NULL)
		return;

	/* secondary processes - just free maps */
	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
		return pci_uio_unmap(uio_res);

	TAILQ_REMOVE(uio_res_list, uio_res, next);

	/* unmap all resources */
	pci_uio_unmap(uio_res);

	/* free uio resource */
	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;
	}

	dev->intr_handle.fd = -1;
	dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
}
/* unmap the PCI resource of a PCI device in virtual memory */
unmap the PCI resource of a PCI device in virtual memory
unmap the PCI resource of a PCI device in virtual memory
void
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);
	if (dev == NULL)
		return;
	uio_res = pci_uio_find_resource(dev);
	if (uio_res == NULL)
		return;
	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
		return pci_uio_unmap(uio_res);
	TAILQ_REMOVE(uio_res_list, uio_res, next);
	pci_uio_unmap(uio_res);
	rte_free(uio_res);
	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;
	}
	dev->intr_handle.fd = -1;
	dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
}
void 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 ) ; if ( dev == NULL ) return ; uio_res = pci_uio_find_resource ( dev ) ; if ( uio_res == NULL ) return ; if ( rte_eal_process_type ( ) != RTE_PROC_PRIMARY ) return pci_uio_unmap ( uio_res ) ; TAILQ_REMOVE ( uio_res_list , uio_res , next ) ; pci_uio_unmap ( uio_res ) ; rte_free ( uio_res ) ; 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 ; } dev -> intr_handle . fd = -1 ; dev -> intr_handle . type = RTE_INTR_HANDLE_UNKNOWN ; }
unmap the PCI resource of a PCI device in virtual memory
unmap the PCI resource of a PCI device in virtual memory
/* find an entry for the device */ /* secondary processes - just free maps */ /* unmap all resources */ /* free uio resource */ /* close fd if in primary process */