| 2697 | } |
| 2698 | |
| 2699 | int |
| 2700 | rte_eth_hairpin_unbind(uint16_t tx_port, uint16_t rx_port) |
| 2701 | { |
| 2702 | struct rte_eth_dev *dev; |
| 2703 | int ret; |
| 2704 | |
| 2705 | RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port, -ENODEV); |
| 2706 | dev = &rte_eth_devices[tx_port]; |
| 2707 | |
| 2708 | if (dev->data->dev_started == 0) { |
| 2709 | RTE_ETHDEV_LOG(ERR, "Tx port %d is already stopped\n", tx_port); |
| 2710 | return -EBUSY; |
| 2711 | } |
| 2712 | |
| 2713 | if (*dev->dev_ops->hairpin_unbind == NULL) |
| 2714 | return -ENOTSUP; |
| 2715 | ret = (*dev->dev_ops->hairpin_unbind)(dev, rx_port); |
| 2716 | if (ret != 0) |
| 2717 | RTE_ETHDEV_LOG(ERR, "Failed to unbind hairpin Tx %d" |
| 2718 | " from Rx %d (%d - all ports)\n", |
| 2719 | tx_port, rx_port, RTE_MAX_ETHPORTS); |
| 2720 | |
| 2721 | rte_eth_trace_hairpin_unbind(tx_port, rx_port, ret); |
| 2722 | |
| 2723 | return ret; |
| 2724 | } |
| 2725 | |
| 2726 | int |
| 2727 | rte_eth_hairpin_get_peer_ports(uint16_t port_id, uint16_t *peer_ports, |