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

Function eth_dev_mac_restore

dpdk/lib/ethdev/rte_ethdev.c:1620–1656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1618}
1619
1620static void
1621eth_dev_mac_restore(struct rte_eth_dev *dev,
1622 struct rte_eth_dev_info *dev_info)
1623{
1624 struct rte_ether_addr *addr;
1625 uint16_t i;
1626 uint32_t pool = 0;
1627 uint64_t pool_mask;
1628
1629 /* replay MAC address configuration including default MAC */
1630 addr = &dev->data->mac_addrs[0];
1631 if (*dev->dev_ops->mac_addr_set != NULL)
1632 (*dev->dev_ops->mac_addr_set)(dev, addr);
1633 else if (*dev->dev_ops->mac_addr_add != NULL)
1634 (*dev->dev_ops->mac_addr_add)(dev, addr, 0, pool);
1635
1636 if (*dev->dev_ops->mac_addr_add != NULL) {
1637 for (i = 1; i < dev_info->max_mac_addrs; i++) {
1638 addr = &dev->data->mac_addrs[i];
1639
1640 /* skip zero address */
1641 if (rte_is_zero_ether_addr(addr))
1642 continue;
1643
1644 pool = 0;
1645 pool_mask = dev->data->mac_pool_sel[i];
1646
1647 do {
1648 if (pool_mask & UINT64_C(1))
1649 (*dev->dev_ops->mac_addr_add)(dev,
1650 addr, i, pool);
1651 pool_mask >>= 1;
1652 pool++;
1653 } while (pool_mask);
1654 }
1655 }
1656}
1657
1658static int
1659eth_dev_config_restore(struct rte_eth_dev *dev,

Callers 2

eth_dev_config_restoreFunction · 0.85
rte_eth_dev_startFunction · 0.85

Calls 1

rte_is_zero_ether_addrFunction · 0.85

Tested by

no test coverage detected