MCPcopy Create free account
hub / github.com/F-Stack/f-stack / detach_port_device

Function detach_port_device

dpdk/app/test-pmd/testpmd.c:3709–3734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3707}
3708
3709void
3710detach_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
3736void
3737detach_devargs(char *identifier)

Callers 1

Calls 3

port_id_is_invalidFunction · 0.85
detach_deviceFunction · 0.85

Tested by

no test coverage detected