src/dpdk/drivers/net/hinic/hinic_pmd_ethdev.c
static int hinic_set_mac_addr(struct rte_eth_dev *dev,
			      struct rte_ether_addr *addr)
{
	struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);
	u16 func_id;
	int err;

	func_id = hinic_global_func_id(nic_dev->hwdev);
	err = hinic_update_mac(nic_dev->hwdev, nic_dev->default_addr.addr_bytes,
			       addr->addr_bytes, 0, func_id);
	if (err)
		return err;

	rte_ether_addr_copy(addr, &nic_dev->default_addr);

	PMD_DRV_LOG(INFO, "Set new mac address %02x:%02x:%02x:%02x:%02x:%02x",
		    addr->addr_bytes[0], addr->addr_bytes[1],
		    addr->addr_bytes[2], addr->addr_bytes[3],
		    addr->addr_bytes[4], addr->addr_bytes[5]);

	return 0;
}
/**
 *  DPDK callback to set mac address
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 * @param addr
 *   Pointer to mac address
 * @return
 *   0 on success, negative error value otherwise.
 */
DPDK callback to set mac address
@param dev
Pointer to Ethernet device structure.
@param addr
Pointer to mac address
@return
0 on success, negative error value otherwise.
DPDK callback to set mac address @param dev Pointer to Ethernet device structure . @param addr Pointer to mac address @return 0 on success negative error value otherwise .
static int hinic_set_mac_addr(struct rte_eth_dev *dev,
			      struct rte_ether_addr *addr)
{
	struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);
	u16 func_id;
	int err;
	func_id = hinic_global_func_id(nic_dev->hwdev);
	err = hinic_update_mac(nic_dev->hwdev, nic_dev->default_addr.addr_bytes,
			       addr->addr_bytes, 0, func_id);
	if (err)
		return err;
	rte_ether_addr_copy(addr, &nic_dev->default_addr);
	PMD_DRV_LOG(INFO, "Set new mac address %02x:%02x:%02x:%02x:%02x:%02x",
		    addr->addr_bytes[0], addr->addr_bytes[1],
		    addr->addr_bytes[2], addr->addr_bytes[3],
		    addr->addr_bytes[4], addr->addr_bytes[5]);
	return 0;
}
static int hinic_set_mac_addr ( struct rte_eth_dev * dev , struct rte_ether_addr * addr ) { struct hinic_nic_dev * nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV ( dev ) ; u16 func_id ; int err ; func_id = hinic_global_func_id ( nic_dev -> hwdev ) ; err = hinic_update_mac ( nic_dev -> hwdev , nic_dev -> default_addr . addr_bytes , addr -> addr_bytes , 0 , func_id ) ; if ( err ) return err ; rte_ether_addr_copy ( addr , & nic_dev -> default_addr ) ; PMD_DRV_LOG ( INFO , " " , addr -> addr_bytes [ 0 ] , addr -> addr_bytes [ 1 ] , addr -> addr_bytes [ 2 ] , addr -> addr_bytes [ 3 ] , addr -> addr_bytes [ 4 ] , addr -> addr_bytes [ 5 ] ) ; return 0 ; }
DPDK callback to set mac address
 @param dev
   Pointer to Ethernet device structure.
DPDK callback to set mac address @param dev Pointer to Ethernet device structure .