src/dpdk/drivers/net/nfb/nfb_ethdev.c
static int
nfb_eth_mac_addr_set(struct rte_eth_dev *dev,
	struct rte_ether_addr *mac_addr)
{
	unsigned int i;
	uint64_t mac = 0;
	struct rte_eth_dev_data *data = dev->data;
	struct pmd_internals *internals = (struct pmd_internals *)
		data->dev_private;

	if (!rte_is_valid_assigned_ether_addr(mac_addr))
		return -EINVAL;

	for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) {
		mac <<= 8;
		mac |= mac_addr->addr_bytes[i] & 0xFF;
	}

	for (i = 0; i < internals->max_rxmac; ++i)
		nc_rxmac_set_mac(internals->rxmac[i], 0, mac, 1);

	rte_ether_addr_copy(mac_addr, data->mac_addrs);
	return 0;
}
/**
 * DPDK callback to set primary MAC address.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 * @param mac_addr
 *   MAC address to register.
 *
 * @return
 *   0 on success, a negative errno value otherwise.
 */
DPDK callback to set primary MAC address.
@param dev
Pointer to Ethernet device structure.
@param mac_addr
MAC address to register.

@return
0 on success, a negative errno value otherwise.
DPDK callback to set primary MAC address . @param dev Pointer to Ethernet device structure . @param mac_addr MAC address to register . @return 0 on success a negative errno value otherwise .
static int
nfb_eth_mac_addr_set(struct rte_eth_dev *dev,
	struct rte_ether_addr *mac_addr)
{
	unsigned int i;
	uint64_t mac = 0;
	struct rte_eth_dev_data *data = dev->data;
	struct pmd_internals *internals = (struct pmd_internals *)
		data->dev_private;
	if (!rte_is_valid_assigned_ether_addr(mac_addr))
		return -EINVAL;
	for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) {
		mac <<= 8;
		mac |= mac_addr->addr_bytes[i] & 0xFF;
	}
	for (i = 0; i < internals->max_rxmac; ++i)
		nc_rxmac_set_mac(internals->rxmac[i], 0, mac, 1);
	rte_ether_addr_copy(mac_addr, data->mac_addrs);
	return 0;
}
static int nfb_eth_mac_addr_set ( struct rte_eth_dev * dev , struct rte_ether_addr * mac_addr ) { unsigned int i ; uint64_t mac = 0 ; struct rte_eth_dev_data * data = dev -> data ; struct pmd_internals * internals = ( struct pmd_internals * ) data -> dev_private ; if ( ! rte_is_valid_assigned_ether_addr ( mac_addr ) ) return - EINVAL ; for ( i = 0 ; i < RTE_ETHER_ADDR_LEN ; i ++ ) { mac <<= 8 ; mac |= mac_addr -> addr_bytes [ i ] & 0xFF ; } for ( i = 0 ; i < internals -> max_rxmac ; ++ i ) nc_rxmac_set_mac ( internals -> rxmac [ i ] , 0 , mac , 1 ) ; rte_ether_addr_copy ( mac_addr , data -> mac_addrs ) ; return 0 ; }
DPDK callback to set primary MAC address.
DPDK callback to set primary MAC address .