src/dpdk/drivers/net/hinic/hinic_pmd_ethdev.c
static int hinic_set_mc_addr_list(struct rte_eth_dev *dev,
				  struct rte_ether_addr *mc_addr_set,
				  uint32_t nb_mc_addr)
{
	struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);
	u16 func_id;
	int ret;
	u32 i;

	func_id = hinic_global_func_id(nic_dev->hwdev);

	/* delete old multi_cast addrs firstly */
	hinic_delete_mc_addr_list(nic_dev);

	if (nb_mc_addr > HINIC_MAX_MC_MAC_ADDRS)
		goto allmulti;

	for (i = 0; i < nb_mc_addr; i++) {
		ret = hinic_set_mac(nic_dev->hwdev, mc_addr_set[i].addr_bytes,
				    0, func_id);
		/* if add mc addr failed, set all multi_cast */
		if (ret) {
			hinic_delete_mc_addr_list(nic_dev);
			goto allmulti;
		}

		rte_ether_addr_copy(&mc_addr_set[i], &nic_dev->mc_list[i]);
	}

	return 0;

allmulti:
	hinic_dev_allmulticast_enable(dev);

	return 0;
}
/**
 *  DPDK callback to set multicast mac address
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 * @param mc_addr_set
 *   Pointer to multicast mac address
 * @param nb_mc_addr
 *   mc addr count
 * @return
 *   0 on success, negative error value otherwise.
 */
DPDK callback to set multicast mac address
@param dev
Pointer to Ethernet device structure.
@param mc_addr_set
Pointer to multicast mac address
@param nb_mc_addr
mc addr count
@return
0 on success, negative error value otherwise.
DPDK callback to set multicast mac address @param dev Pointer to Ethernet device structure . @param mc_addr_set Pointer to multicast mac address @param nb_mc_addr mc addr count @return 0 on success negative error value otherwise .
static int hinic_set_mc_addr_list(struct rte_eth_dev *dev,
				  struct rte_ether_addr *mc_addr_set,
				  uint32_t nb_mc_addr)
{
	struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);
	u16 func_id;
	int ret;
	u32 i;
	func_id = hinic_global_func_id(nic_dev->hwdev);
	hinic_delete_mc_addr_list(nic_dev);
	if (nb_mc_addr > HINIC_MAX_MC_MAC_ADDRS)
		goto allmulti;
	for (i = 0; i < nb_mc_addr; i++) {
		ret = hinic_set_mac(nic_dev->hwdev, mc_addr_set[i].addr_bytes,
				    0, func_id);
		if (ret) {
			hinic_delete_mc_addr_list(nic_dev);
			goto allmulti;
		}
		rte_ether_addr_copy(&mc_addr_set[i], &nic_dev->mc_list[i]);
	}
	return 0;
allmulti:
	hinic_dev_allmulticast_enable(dev);
	return 0;
}
static int hinic_set_mc_addr_list ( struct rte_eth_dev * dev , struct rte_ether_addr * mc_addr_set , uint32_t nb_mc_addr ) { struct hinic_nic_dev * nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV ( dev ) ; u16 func_id ; int ret ; u32 i ; func_id = hinic_global_func_id ( nic_dev -> hwdev ) ; hinic_delete_mc_addr_list ( nic_dev ) ; if ( nb_mc_addr > HINIC_MAX_MC_MAC_ADDRS ) goto allmulti ; for ( i = 0 ; i < nb_mc_addr ; i ++ ) { ret = hinic_set_mac ( nic_dev -> hwdev , mc_addr_set [ i ] . addr_bytes , 0 , func_id ) ; if ( ret ) { hinic_delete_mc_addr_list ( nic_dev ) ; goto allmulti ; } rte_ether_addr_copy ( & mc_addr_set [ i ] , & nic_dev -> mc_list [ i ] ) ; } return 0 ; allmulti : hinic_dev_allmulticast_enable ( dev ) ; return 0 ; }
DPDK callback to set multicast mac address
 @param dev
   Pointer to Ethernet device structure.
DPDK callback to set multicast mac address @param dev Pointer to Ethernet device structure .
/* delete old multi_cast addrs firstly */ /* if add mc addr failed, set all multi_cast */