src/dpdk/drivers/net/i40e/i40e_ethdev.c
static void
i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
{
	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
	struct i40e_vsi *vsi;
	struct rte_eth_dev_data *data = dev->data;
	struct rte_ether_addr *macaddr;
	int ret;
	uint32_t i;
	uint64_t pool_sel;

	macaddr = &(data->mac_addrs[index]);

	pool_sel = dev->data->mac_pool_sel[index];

	for (i = 0; i < sizeof(pool_sel) * CHAR_BIT; i++) {
		if (pool_sel & (1ULL << i)) {
			if (i == 0)
				vsi = pf->main_vsi;
			else {
				/* No VMDQ pool enabled or configured */
				if (!(pf->flags & I40E_FLAG_VMDQ) ||
					(i > pf->nb_cfg_vmdq_vsi)) {
					PMD_DRV_LOG(ERR,
						"No VMDQ pool enabled/configured");
					return;
				}
				vsi = pf->vmdq[i - 1].vsi;
			}
			ret = i40e_vsi_delete_mac(vsi, macaddr);

			if (ret) {
				PMD_DRV_LOG(ERR, "Failed to remove MACVLAN filter");
				return;
			}
		}
	}
}
/* Remove a MAC address, and update filters */
Remove a MAC address, and update filters
Remove a MAC address and update filters
static void
i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
{
	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
	struct i40e_vsi *vsi;
	struct rte_eth_dev_data *data = dev->data;
	struct rte_ether_addr *macaddr;
	int ret;
	uint32_t i;
	uint64_t pool_sel;
	macaddr = &(data->mac_addrs[index]);
	pool_sel = dev->data->mac_pool_sel[index];
	for (i = 0; i < sizeof(pool_sel) * CHAR_BIT; i++) {
		if (pool_sel & (1ULL << i)) {
			if (i == 0)
				vsi = pf->main_vsi;
			else {
				if (!(pf->flags & I40E_FLAG_VMDQ) ||
					(i > pf->nb_cfg_vmdq_vsi)) {
					PMD_DRV_LOG(ERR,
						"No VMDQ pool enabled/configured");
					return;
				}
				vsi = pf->vmdq[i - 1].vsi;
			}
			ret = i40e_vsi_delete_mac(vsi, macaddr);
			if (ret) {
				PMD_DRV_LOG(ERR, "Failed to remove MACVLAN filter");
				return;
			}
		}
	}
}
static void i40e_macaddr_remove ( struct rte_eth_dev * dev , uint32_t index ) { struct i40e_pf * pf = I40E_DEV_PRIVATE_TO_PF ( dev -> data -> dev_private ) ; struct i40e_vsi * vsi ; struct rte_eth_dev_data * data = dev -> data ; struct rte_ether_addr * macaddr ; int ret ; uint32_t i ; uint64_t pool_sel ; macaddr = & ( data -> mac_addrs [ index ] ) ; pool_sel = dev -> data -> mac_pool_sel [ index ] ; for ( i = 0 ; i < sizeof ( pool_sel ) * CHAR_BIT ; i ++ ) { if ( pool_sel & ( 1ULL << i ) ) { if ( i == 0 ) vsi = pf -> main_vsi ; else { if ( ! ( pf -> flags & I40E_FLAG_VMDQ ) || ( i > pf -> nb_cfg_vmdq_vsi ) ) { PMD_DRV_LOG ( ERR , " " ) ; return ; } vsi = pf -> vmdq [ i - 1 ] . vsi ; } ret = i40e_vsi_delete_mac ( vsi , macaddr ) ; if ( ret ) { PMD_DRV_LOG ( ERR , " " ) ; return ; } } } }
Remove a MAC address, and update filters
Remove a MAC address and update filters
/* No VMDQ pool enabled or configured */