| 1792 | } |
| 1793 | |
| 1794 | int |
| 1795 | rte_eth_dev_stop(uint16_t port_id) |
| 1796 | { |
| 1797 | struct rte_eth_dev *dev; |
| 1798 | int ret; |
| 1799 | |
| 1800 | RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); |
| 1801 | dev = &rte_eth_devices[port_id]; |
| 1802 | |
| 1803 | if (*dev->dev_ops->dev_stop == NULL) |
| 1804 | return -ENOTSUP; |
| 1805 | |
| 1806 | if (dev->data->dev_started == 0) { |
| 1807 | RTE_ETHDEV_LOG(INFO, |
| 1808 | "Device with port_id=%"PRIu16" already stopped\n", |
| 1809 | port_id); |
| 1810 | return 0; |
| 1811 | } |
| 1812 | |
| 1813 | /* point fast-path functions to dummy ones */ |
| 1814 | eth_dev_fp_ops_reset(rte_eth_fp_ops + port_id); |
| 1815 | |
| 1816 | ret = (*dev->dev_ops->dev_stop)(dev); |
| 1817 | if (ret == 0) |
| 1818 | dev->data->dev_started = 0; |
| 1819 | rte_ethdev_trace_stop(port_id, ret); |
| 1820 | |
| 1821 | return ret; |
| 1822 | } |
| 1823 | |
| 1824 | int |
| 1825 | rte_eth_dev_set_link_up(uint16_t port_id) |