| 1656 | } |
| 1657 | |
| 1658 | static int |
| 1659 | eth_dev_config_restore(struct rte_eth_dev *dev, |
| 1660 | struct rte_eth_dev_info *dev_info, uint16_t port_id) |
| 1661 | { |
| 1662 | int ret; |
| 1663 | |
| 1664 | if (!(*dev_info->dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)) |
| 1665 | eth_dev_mac_restore(dev, dev_info); |
| 1666 | |
| 1667 | /* replay promiscuous configuration */ |
| 1668 | /* |
| 1669 | * use callbacks directly since we don't need port_id check and |
| 1670 | * would like to bypass the same value set |
| 1671 | */ |
| 1672 | if (rte_eth_promiscuous_get(port_id) == 1 && |
| 1673 | *dev->dev_ops->promiscuous_enable != NULL) { |
| 1674 | ret = eth_err(port_id, |
| 1675 | (*dev->dev_ops->promiscuous_enable)(dev)); |
| 1676 | if (ret != 0 && ret != -ENOTSUP) { |
| 1677 | RTE_ETHDEV_LOG(ERR, |
| 1678 | "Failed to enable promiscuous mode for device (port %u): %s\n", |
| 1679 | port_id, rte_strerror(-ret)); |
| 1680 | return ret; |
| 1681 | } |
| 1682 | } else if (rte_eth_promiscuous_get(port_id) == 0 && |
| 1683 | *dev->dev_ops->promiscuous_disable != NULL) { |
| 1684 | ret = eth_err(port_id, |
| 1685 | (*dev->dev_ops->promiscuous_disable)(dev)); |
| 1686 | if (ret != 0 && ret != -ENOTSUP) { |
| 1687 | RTE_ETHDEV_LOG(ERR, |
| 1688 | "Failed to disable promiscuous mode for device (port %u): %s\n", |
| 1689 | port_id, rte_strerror(-ret)); |
| 1690 | return ret; |
| 1691 | } |
| 1692 | } |
| 1693 | |
| 1694 | /* replay all multicast configuration */ |
| 1695 | /* |
| 1696 | * use callbacks directly since we don't need port_id check and |
| 1697 | * would like to bypass the same value set |
| 1698 | */ |
| 1699 | if (rte_eth_allmulticast_get(port_id) == 1 && |
| 1700 | *dev->dev_ops->allmulticast_enable != NULL) { |
| 1701 | ret = eth_err(port_id, |
| 1702 | (*dev->dev_ops->allmulticast_enable)(dev)); |
| 1703 | if (ret != 0 && ret != -ENOTSUP) { |
| 1704 | RTE_ETHDEV_LOG(ERR, |
| 1705 | "Failed to enable allmulticast mode for device (port %u): %s\n", |
| 1706 | port_id, rte_strerror(-ret)); |
| 1707 | return ret; |
| 1708 | } |
| 1709 | } else if (rte_eth_allmulticast_get(port_id) == 0 && |
| 1710 | *dev->dev_ops->allmulticast_disable != NULL) { |
| 1711 | ret = eth_err(port_id, |
| 1712 | (*dev->dev_ops->allmulticast_disable)(dev)); |
| 1713 | if (ret != 0 && ret != -ENOTSUP) { |
| 1714 | RTE_ETHDEV_LOG(ERR, |
| 1715 | "Failed to disable allmulticast mode for device (port %u): %s\n", |
no test coverage detected