| 1618 | } |
| 1619 | |
| 1620 | static void |
| 1621 | eth_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 | |
| 1658 | static int |
| 1659 | eth_dev_config_restore(struct rte_eth_dev *dev, |
no test coverage detected