src/dpdk/drivers/net/mlx5/mlx5_mr.c
static struct rte_eth_dev *
pci_dev_to_eth_dev(struct rte_pci_device *pdev)
{
	uint16_t port_id;

	port_id = rte_eth_find_next_of(0, &pdev->device);
	if (port_id == RTE_MAX_ETHPORTS)
		return NULL;
	return &rte_eth_devices[port_id];
}
/**
 * Finds the first ethdev that match the pci device.
 * The existence of multiple ethdev per pci device is only with representors.
 * On such case, it is enough to get only one of the ports as they all share
 * the same ibv context.
 *
 * @param pdev
 *   Pointer to the PCI device.
 *
 * @return
 *   Pointer to the ethdev if found, NULL otherwise.
 */
Finds the first ethdev that match the pci device.
The existence of multiple ethdev per pci device is only with representors.
On such case, it is enough to get only one of the ports as they all share
the same ibv context.

@param pdev
Pointer to the PCI device.

@return
Pointer to the ethdev if found, NULL otherwise.
Finds the first ethdev that match the pci device . The existence of multiple ethdev per pci device is only with representors . On such case it is enough to get only one of the ports as they all share the same ibv context . @param pdev Pointer to the PCI device . @return Pointer to the ethdev if found NULL otherwise .
static struct rte_eth_dev *
pci_dev_to_eth_dev(struct rte_pci_device *pdev)
{
	uint16_t port_id;
	port_id = rte_eth_find_next_of(0, &pdev->device);
	if (port_id == RTE_MAX_ETHPORTS)
		return NULL;
	return &rte_eth_devices[port_id];
}
static struct rte_eth_dev * pci_dev_to_eth_dev ( struct rte_pci_device * pdev ) { uint16_t port_id ; port_id = rte_eth_find_next_of ( 0 , & pdev -> device ) ; if ( port_id == RTE_MAX_ETHPORTS ) return NULL ; return & rte_eth_devices [ port_id ] ; }
Finds the first ethdev that match the pci device.
Finds the first ethdev that match the pci device .