#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_launch.h>
-#include <rte_tailq.h>
#include <rte_eal.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
int
start_port(portid_t pid)
{
- int diag, need_check_link_status = 0;
+ int diag, need_check_link_status = -1;
portid_t pi;
queueid_t qi;
struct rte_port *port;
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;
if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
continue;
+ need_check_link_status = 0;
port = &ports[pi];
if (rte_atomic16_cmpset(&(port->port_status), RTE_PORT_STOPPED,
RTE_PORT_HANDLING) == 0) {
need_check_link_status = 1;
}
- if (need_check_link_status && !no_link_check)
+ if (need_check_link_status == 1 && !no_link_check)
check_all_ports_link_status(RTE_PORT_ALL);
- else
+ else if (need_check_link_status == 0)
printf("Please stop the ports first\n");
printf("Done\n");
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];
{
portid_t pt_id;
+ if (test_done == 0)
+ stop_packet_forwarding();
+
FOREACH_PORT(pt_id, ports) {
printf("Stopping port %d...", pt_id);
fflush(stdout);