MCPcopy Index your code
hub / github.com/F-Stack/f-stack / rte_eth_dev_start

Function rte_eth_dev_start

dpdk/lib/ethdev/rte_ethdev.c:1724–1792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1722}
1723
1724int
1725rte_eth_dev_start(uint16_t port_id)
1726{
1727 struct rte_eth_dev *dev;
1728 struct rte_eth_dev_info dev_info;
1729 int diag;
1730 int ret, ret_stop;
1731
1732 RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
1733 dev = &rte_eth_devices[port_id];
1734
1735 if (*dev->dev_ops->dev_start == NULL)
1736 return -ENOTSUP;
1737
1738 if (dev->data->dev_configured == 0) {
1739 RTE_ETHDEV_LOG(INFO,
1740 "Device with port_id=%"PRIu16" is not configured.\n",
1741 port_id);
1742 return -EINVAL;
1743 }
1744
1745 if (dev->data->dev_started != 0) {
1746 RTE_ETHDEV_LOG(INFO,
1747 "Device with port_id=%"PRIu16" already started\n",
1748 port_id);
1749 return 0;
1750 }
1751
1752 ret = rte_eth_dev_info_get(port_id, &dev_info);
1753 if (ret != 0)
1754 return ret;
1755
1756 /* Lets restore MAC now if device does not support live change */
1757 if (*dev_info.dev_flags & RTE_ETH_DEV_NOLIVE_MAC_ADDR)
1758 eth_dev_mac_restore(dev, &dev_info);
1759
1760 diag = (*dev->dev_ops->dev_start)(dev);
1761 if (diag == 0)
1762 dev->data->dev_started = 1;
1763 else
1764 return eth_err(port_id, diag);
1765
1766 ret = eth_dev_config_restore(dev, &dev_info, port_id);
1767 if (ret != 0) {
1768 RTE_ETHDEV_LOG(ERR,
1769 "Error during restoring configuration for device (port %u): %s\n",
1770 port_id, rte_strerror(-ret));
1771 ret_stop = rte_eth_dev_stop(port_id);
1772 if (ret_stop != 0) {
1773 RTE_ETHDEV_LOG(ERR,
1774 "Failed to stop device (port %u): %s\n",
1775 port_id, rte_strerror(-ret_stop));
1776 }
1777
1778 return ret;
1779 }
1780
1781 if (dev->data->dev_conf.intr_conf.lsc == 0) {

Callers 15

init_port_startFunction · 0.85
member_startFunction · 0.85
fs_dev_startFunction · 0.85
hn_vf_addFunction · 0.85
hn_vf_startFunction · 0.85
init_portFunction · 0.85
configure_vdevFunction · 0.85
ut_setup_inline_ipsecFunction · 0.85
ut_setup_inline_macsecFunction · 0.85

Calls 7

rte_eth_dev_info_getFunction · 0.85
eth_dev_mac_restoreFunction · 0.85
eth_errFunction · 0.85
eth_dev_config_restoreFunction · 0.85
rte_strerrorFunction · 0.85
rte_eth_dev_stopFunction · 0.85
eth_dev_fp_ops_setupFunction · 0.85