src/dpdk/drivers/net/i40e/i40e_ethdev.c
int
i40e_find_all_vlan_for_mac(struct i40e_vsi *vsi,
			   struct i40e_macvlan_filter *mv_f,
			   int num, struct rte_ether_addr *addr)
{
	int i;
	uint32_t j, k;

	/**
	 * Not to use i40e_find_vlan_filter to decrease the loop time,
	 * although the code looks complex.
	  */
	if (num < vsi->vlan_num)
		return I40E_ERR_PARAM;

	i = 0;
	for (j = 0; j < I40E_VFTA_SIZE; j++) {
		if (vsi->vfta[j]) {
			for (k = 0; k < I40E_UINT32_BIT_SIZE; k++) {
				if (vsi->vfta[j] & (1 << k)) {
					if (i > num - 1) {
						PMD_DRV_LOG(ERR,
							"vlan number doesn't match");
						return I40E_ERR_PARAM;
					}
					rte_memcpy(&mv_f[i].macaddr,
							addr, ETH_ADDR_LEN);
					mv_f[i].vlan_id =
						j * I40E_UINT32_BIT_SIZE + k;
					i++;
				}
			}
		}
	}
	return I40E_SUCCESS;
}
/**
 * Find all vlan options for specific mac addr,
 * return with actual vlan found.
 */
Find all vlan options for specific mac addr,
return with actual vlan found.
Find all vlan options for specific mac addr return with actual vlan found .
int
i40e_find_all_vlan_for_mac(struct i40e_vsi *vsi,
			   struct i40e_macvlan_filter *mv_f,
			   int num, struct rte_ether_addr *addr)
{
	int i;
	uint32_t j, k;
	if (num < vsi->vlan_num)
		return I40E_ERR_PARAM;
	i = 0;
	for (j = 0; j < I40E_VFTA_SIZE; j++) {
		if (vsi->vfta[j]) {
			for (k = 0; k < I40E_UINT32_BIT_SIZE; k++) {
				if (vsi->vfta[j] & (1 << k)) {
					if (i > num - 1) {
						PMD_DRV_LOG(ERR,
							"vlan number doesn't match");
						return I40E_ERR_PARAM;
					}
					rte_memcpy(&mv_f[i].macaddr,
							addr, ETH_ADDR_LEN);
					mv_f[i].vlan_id =
						j * I40E_UINT32_BIT_SIZE + k;
					i++;
				}
			}
		}
	}
	return I40E_SUCCESS;
}
int i40e_find_all_vlan_for_mac ( struct i40e_vsi * vsi , struct i40e_macvlan_filter * mv_f , int num , struct rte_ether_addr * addr ) { int i ; uint32_t j , k ; if ( num < vsi -> vlan_num ) return I40E_ERR_PARAM ; i = 0 ; for ( j = 0 ; j < I40E_VFTA_SIZE ; j ++ ) { if ( vsi -> vfta [ j ] ) { for ( k = 0 ; k < I40E_UINT32_BIT_SIZE ; k ++ ) { if ( vsi -> vfta [ j ] & ( 1 << k ) ) { if ( i > num - 1 ) { PMD_DRV_LOG ( ERR , " " ) ; return I40E_ERR_PARAM ; } rte_memcpy ( & mv_f [ i ] . macaddr , addr , ETH_ADDR_LEN ) ; mv_f [ i ] . vlan_id = j * I40E_UINT32_BIT_SIZE + k ; i ++ ; } } } } return I40E_SUCCESS ; }
Find all vlan options for specific mac addr,
 return with actual vlan found.
Find all vlan options for specific mac addr return with actual vlan found .
/**
	 * Not to use i40e_find_vlan_filter to decrease the loop time,
	 * although the code looks complex.
	  */