int
port_id_is_invalid(portid_t port_id, enum print_warning warning)
{
+ if (port_id == (portid_t)RTE_PORT_ALL)
+ return 0;
+
if (ports[port_id].enabled)
return 0;
return -1;
}
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
if (init_fwd_streams() < 0) {
printf("Fail from init_fwd_streams()\n");
return -1;
dcb_test = 0;
dcb_config = 0;
}
+
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return;
+
printf("Stopping ports...\n");
FOREACH_PORT(pi, ports) {
- if (!port_id_is_invalid(pid, DISABLED_WARN) && pid != pi)
+ if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
continue;
port = &ports[pi];
return;
}
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return;
+
printf("Closing ports...\n");
FOREACH_PORT(pi, ports) {
- if (!port_id_is_invalid(pid, DISABLED_WARN) && pid != pi)
+ if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
continue;
port = &ports[pi];