src/dpdk/lib/librte_ethdev/rte_ethdev.c
static int
eth_dev_get_mac_addr_index(uint16_t port_id, const struct rte_ether_addr *addr)
{
	struct rte_eth_dev_info dev_info;
	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
	unsigned i;
	int ret;

	ret = rte_eth_dev_info_get(port_id, &dev_info);
	if (ret != 0)
		return -1;

	for (i = 0; i < dev_info.max_mac_addrs; i++)
		if (memcmp(addr, &dev->data->mac_addrs[i],
				RTE_ETHER_ADDR_LEN) == 0)
			return i;

	return -1;
}
/*
 * Returns index into MAC address array of addr. Use 00:00:00:00:00:00 to find
 * an empty spot.
 */
Returns index into MAC address array of addr.
Returns index into MAC address array of addr .
static int
eth_dev_get_mac_addr_index(uint16_t port_id, const struct rte_ether_addr *addr)
{
	struct rte_eth_dev_info dev_info;
	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
	unsigned i;
	int ret;
	ret = rte_eth_dev_info_get(port_id, &dev_info);
	if (ret != 0)
		return -1;
	for (i = 0; i < dev_info.max_mac_addrs; i++)
		if (memcmp(addr, &dev->data->mac_addrs[i],
				RTE_ETHER_ADDR_LEN) == 0)
			return i;
	return -1;
}
static int eth_dev_get_mac_addr_index ( uint16_t port_id , const struct rte_ether_addr * addr ) { struct rte_eth_dev_info dev_info ; struct rte_eth_dev * dev = & rte_eth_devices [ port_id ] ; unsigned i ; int ret ; ret = rte_eth_dev_info_get ( port_id , & dev_info ) ; if ( ret != 0 ) return -1 ; for ( i = 0 ; i < dev_info . max_mac_addrs ; i ++ ) if ( memcmp ( addr , & dev -> data -> mac_addrs [ i ] , RTE_ETHER_ADDR_LEN ) == 0 ) return i ; return -1 ; }
Returns index into MAC address array of addr.
Returns index into MAC address array of addr .