MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ixgbevf_remove_mac_addr

Function ixgbevf_remove_mac_addr

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:6333–6383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6331}
6332
6333static void
6334ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index)
6335{
6336 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
6337 struct rte_ether_addr *perm_addr =
6338 (struct rte_ether_addr *)hw->mac.perm_addr;
6339 struct rte_ether_addr *mac_addr;
6340 uint32_t i;
6341 int diag;
6342
6343 /*
6344 * This function calls into the base driver, which in turn will use
6345 * function pointers, which are not guaranteed to be valid in secondary
6346 * processes, so avoid using this function in secondary processes.
6347 */
6348 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
6349 return;
6350
6351 /*
6352 * The IXGBE_VF_SET_MACVLAN command of the ixgbe-pf driver does
6353 * not support the deletion of a given MAC address.
6354 * Instead, it imposes to delete all MAC addresses, then to add again
6355 * all MAC addresses with the exception of the one to be deleted.
6356 */
6357 (void) ixgbevf_set_uc_addr_vf(hw, 0, NULL);
6358
6359 /*
6360 * Add again all MAC addresses, with the exception of the deleted one
6361 * and of the permanent MAC address.
6362 */
6363 for (i = 0, mac_addr = dev->data->mac_addrs;
6364 i < hw->mac.num_rar_entries; i++, mac_addr++) {
6365 /* Skip the deleted MAC address */
6366 if (i == index)
6367 continue;
6368 /* Skip NULL MAC addresses */
6369 if (rte_is_zero_ether_addr(mac_addr))
6370 continue;
6371 /* Skip the permanent MAC address */
6372 if (memcmp(perm_addr, mac_addr,
6373 sizeof(struct rte_ether_addr)) == 0)
6374 continue;
6375 diag = ixgbevf_set_uc_addr_vf(hw, 2, mac_addr->addr_bytes);
6376 if (diag != 0)
6377 PMD_DRV_LOG(ERR,
6378 "Adding again MAC address "
6379 RTE_ETHER_ADDR_PRT_FMT " failed "
6380 "diag=%d", RTE_ETHER_ADDR_BYTES(mac_addr),
6381 diag);
6382 }
6383}
6384
6385static int
6386ixgbevf_set_default_mac_addr(struct rte_eth_dev *dev,

Callers 1

ixgbevf_dev_closeFunction · 0.85

Calls 3

rte_eal_process_typeFunction · 0.85
ixgbevf_set_uc_addr_vfFunction · 0.85
rte_is_zero_ether_addrFunction · 0.85

Tested by

no test coverage detected