X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_pmd_perf.c;h=3d56cd29a5dbcd7468ebdac580b17d680c2c0a2c;hb=43ea4004944404388c033055b130b53e8ba03806;hp=8f55640dc6a728f6b545641da41a61d7e442cb11;hpb=f72a0fa627ac8c6d907bd0035adcb9999560e4c9;p=dpdk.git diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index 8f55640dc6..3d56cd29a5 100644 --- a/app/test/test_pmd_perf.c +++ b/app/test/test_pmd_perf.c @@ -192,7 +192,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask) 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; } @@ -626,7 +626,10 @@ timeout: rte_free(pkts_burst); - return diff_tsc / total; + if (total > 0) + return diff_tsc / total; + else + return -1; } static int @@ -673,8 +676,10 @@ exec_burst(uint32_t flags, int lcore) /* 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); @@ -704,9 +709,6 @@ test_pmd_perf(void) 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)); @@ -811,7 +813,8 @@ test_pmd_perf(void) 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++) {