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

Function ixgbevf_add_mac_addr

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

Source from the content-addressed store, hash-verified

6299}
6300
6301static int
6302ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
6303 __rte_unused uint32_t index,
6304 __rte_unused uint32_t pool)
6305{
6306 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
6307 int diag;
6308
6309 /*
6310 * This function calls into the base driver, which in turn will use
6311 * function pointers, which are not guaranteed to be valid in secondary
6312 * processes, so avoid using this function in secondary processes.
6313 */
6314 if (rte_eal_process_type() != RTE_PROC_PRIMARY)
6315 return -E_RTE_SECONDARY;
6316
6317 /*
6318 * On a 82599 VF, adding again the same MAC addr is not an idempotent
6319 * operation. Trap this case to avoid exhausting the [very limited]
6320 * set of PF resources used to store VF MAC addresses.
6321 */
6322 if (memcmp(hw->mac.perm_addr, mac_addr,
6323 sizeof(struct rte_ether_addr)) == 0)
6324 return -1;
6325 diag = ixgbevf_set_uc_addr_vf(hw, 2, mac_addr->addr_bytes);
6326 if (diag != 0)
6327 PMD_DRV_LOG(ERR, "Unable to add MAC address "
6328 RTE_ETHER_ADDR_PRT_FMT " - diag=%d",
6329 RTE_ETHER_ADDR_BYTES(mac_addr), diag);
6330 return diag;
6331}
6332
6333static void
6334ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index)

Callers

nothing calls this directly

Calls 2

rte_eal_process_typeFunction · 0.85
ixgbevf_set_uc_addr_vfFunction · 0.85

Tested by

no test coverage detected