continue;
}
/* clear all_ports_up flag if any link down */
- if (link.link_status == 0) {
+ if (link.link_status == ETH_LINK_DOWN) {
all_ports_up = 0;
break;
}
printf(" RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64" RX-bytes: "
"%-"PRIu64"\n",
stats.ipackets, stats.imissed, stats.ibytes);
- printf(" RX-badcrc: %-10"PRIu64" RX-badlen: %-10"PRIu64" RX-errors: "
- "%-"PRIu64"\n",
- stats.ibadcrc, stats.ibadlen, stats.ierrors);
- printf(" RX-nombuf: %-10"PRIu64"\n",
- stats.rx_nombuf);
+ printf(" RX-errors: %-10"PRIu64" RX-nombuf: %-10"PRIu64"\n",
+ stats.ierrors, stats.rx_nombuf);
printf(" TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes: "
"%-"PRIu64"\n",
stats.opackets, stats.oerrors, stats.obytes);
rte_free(pkts_burst);
- return diff_tsc / total;
+ if (total > 0)
+ return diff_tsc / total;
+ else
+ return -1;
}
static int
/* wait for polling finished */
diff_tsc = rte_eal_wait_lcore(lcore);
- if (diff_tsc < 0)
+ if (diff_tsc < 0) {
+ printf("exec_burst: Failed to measure cycles per packet\n");
return -1;
+ }
printf("Result: %d cycles per packet\n", diff_tsc);
return -1;
}
- if (nb_ports > RTE_MAX_ETHPORTS)
- nb_ports = RTE_MAX_ETHPORTS;
-
nb_lcores = rte_lcore_count();
memset(lcore_conf, 0, sizeof(lcore_conf));
return -1;
} else if (sc_flag == SC_BURST_POLL_FIRST ||
sc_flag == SC_BURST_XMIT_FIRST)
- exec_burst(sc_flag, slave_id);
+ if (exec_burst(sc_flag, slave_id) < 0)
+ return -1;
/* port tear down */
for (portid = 0; portid < nb_ports; portid++) {
return -1;
}
-static struct test_command pmd_perf_cmd = {
- .command = "pmd_perf_autotest",
- .callback = test_pmd_perf,
-};
-REGISTER_TEST_COMMAND(pmd_perf_cmd);
+REGISTER_TEST_COMMAND(pmd_perf_autotest, test_pmd_perf);