src/dpdk/lib/librte_eventdev/eventdev_pmd_pci.h
static inline int
rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev,
			     eventdev_pmd_pci_callback_t devuninit)
{
	struct rte_eventdev *eventdev;
	char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN];
	int ret = 0;

	if (pci_dev == NULL)
		return -EINVAL;

	rte_pci_device_name(&pci_dev->addr, eventdev_name,
			sizeof(eventdev_name));

	eventdev = rte_event_pmd_get_named_dev(eventdev_name);
	if (eventdev == NULL)
		return -ENODEV;

	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
		ret = rte_event_dev_close(eventdev->data->dev_id);
		if (ret < 0)
			return ret;
	}

	/* Invoke PMD device un-init function */
	if (devuninit)
		ret = devuninit(eventdev);
	if (ret)
		return ret;

	/* Free event device */
	rte_event_pmd_release(eventdev);

	eventdev->dev = NULL;

	return 0;
}
/**
 * @internal
 * Wrapper for use by pci drivers as a .remove function to detach a event
 * interface.
 */
@internal
Wrapper for use by pci drivers as a .remove function to detach a event
interface.
@internal Wrapper for use by pci drivers as a . remove function to detach a event interface .
static inline int
rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev,
			     eventdev_pmd_pci_callback_t devuninit)
{
	struct rte_eventdev *eventdev;
	char eventdev_name[RTE_EVENTDEV_NAME_MAX_LEN];
	int ret = 0;
	if (pci_dev == NULL)
		return -EINVAL;
	rte_pci_device_name(&pci_dev->addr, eventdev_name,
			sizeof(eventdev_name));
	eventdev = rte_event_pmd_get_named_dev(eventdev_name);
	if (eventdev == NULL)
		return -ENODEV;
	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
		ret = rte_event_dev_close(eventdev->data->dev_id);
		if (ret < 0)
			return ret;
	}
	if (devuninit)
		ret = devuninit(eventdev);
	if (ret)
		return ret;
	rte_event_pmd_release(eventdev);
	eventdev->dev = NULL;
	return 0;
}
static inline int rte_event_pmd_pci_remove ( struct rte_pci_device * pci_dev , eventdev_pmd_pci_callback_t devuninit ) { struct rte_eventdev * eventdev ; char eventdev_name [ RTE_EVENTDEV_NAME_MAX_LEN ] ; int ret = 0 ; if ( pci_dev == NULL ) return - EINVAL ; rte_pci_device_name ( & pci_dev -> addr , eventdev_name , sizeof ( eventdev_name ) ) ; eventdev = rte_event_pmd_get_named_dev ( eventdev_name ) ; if ( eventdev == NULL ) return - ENODEV ; if ( rte_eal_process_type ( ) == RTE_PROC_PRIMARY ) { ret = rte_event_dev_close ( eventdev -> data -> dev_id ) ; if ( ret < 0 ) return ret ; } if ( devuninit ) ret = devuninit ( eventdev ) ; if ( ret ) return ret ; rte_event_pmd_release ( eventdev ) ; eventdev -> dev = NULL ; return 0 ; }
@internal
 Wrapper for use by pci drivers as a .remove function to detach a event
 interface.
@internal Wrapper for use by pci drivers as a . remove function to detach a event interface .
/* Invoke PMD device un-init function */ /* Free event device */