| 3707 | } |
| 3708 | |
| 3709 | void |
| 3710 | detach_port_device(portid_t port_id) |
| 3711 | { |
| 3712 | int ret; |
| 3713 | struct rte_eth_dev_info dev_info; |
| 3714 | |
| 3715 | if (port_id_is_invalid(port_id, ENABLED_WARN)) |
| 3716 | return; |
| 3717 | |
| 3718 | if (ports[port_id].port_status != RTE_PORT_CLOSED) { |
| 3719 | if (ports[port_id].port_status != RTE_PORT_STOPPED) { |
| 3720 | fprintf(stderr, "Port not stopped\n"); |
| 3721 | return; |
| 3722 | } |
| 3723 | fprintf(stderr, "Port was not closed\n"); |
| 3724 | } |
| 3725 | |
| 3726 | ret = eth_dev_info_get_print_err(port_id, &dev_info); |
| 3727 | if (ret != 0) { |
| 3728 | TESTPMD_LOG(ERR, |
| 3729 | "Failed to get device info for port %d, not detaching\n", |
| 3730 | port_id); |
| 3731 | return; |
| 3732 | } |
| 3733 | detach_device(dev_info.device); |
| 3734 | } |
| 3735 | |
| 3736 | void |
| 3737 | detach_devargs(char *identifier) |
no test coverage detected