git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mempool: adjust name size in related data types
[dpdk.git]
/
app
/
test
/
test_pmd_perf.c
diff --git
a/app/test/test_pmd_perf.c
b/app/test/test_pmd_perf.c
index
49a494d
..
e055aa0
100644
(file)
--- a/
app/test/test_pmd_perf.c
+++ b/
app/test/test_pmd_perf.c
@@
-47,7
+47,6
@@
#define NB_ETHPORTS_USED (1)
#define NB_SOCKETS (2)
#define MEMPOOL_CACHE_SIZE 250
#define NB_ETHPORTS_USED (1)
#define NB_SOCKETS (2)
#define MEMPOOL_CACHE_SIZE 250
-#define MBUF_DATA_SIZE (2048 + RTE_PKTMBUF_HEADROOM)
#define MAX_PKT_BURST (32)
#define RTE_TEST_RX_DESC_DEFAULT (128)
#define RTE_TEST_TX_DESC_DEFAULT (512)
#define MAX_PKT_BURST (32)
#define RTE_TEST_RX_DESC_DEFAULT (128)
#define RTE_TEST_TX_DESC_DEFAULT (512)
@@
-193,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 */
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;
}
all_ports_up = 0;
break;
}
@@
-290,8
+289,8
@@
init_mbufpool(unsigned nb_mbuf)
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
mbufpool[socketid] =
rte_pktmbuf_pool_create(s, nb_mbuf,
snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
mbufpool[socketid] =
rte_pktmbuf_pool_create(s, nb_mbuf,
- MEMPOOL_CACHE_SIZE, 0,
MBUF_DATA_SIZE,
- socketid);
+ MEMPOOL_CACHE_SIZE, 0,
+
RTE_MBUF_DEFAULT_BUF_SIZE,
socketid);
if (mbufpool[socketid] == NULL)
rte_exit(EXIT_FAILURE,
"Cannot init mbuf pool on socket %d\n",
if (mbufpool[socketid] == NULL)
rte_exit(EXIT_FAILURE,
"Cannot init mbuf pool on socket %d\n",
@@
-344,11
+343,8
@@
stats_display(uint8_t port_id)
printf(" RX-packets: %-10"PRIu64" RX-missed: %-10"PRIu64" RX-bytes: "
"%-"PRIu64"\n",
stats.ipackets, stats.imissed, stats.ibytes);
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);
printf(" TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes: "
"%-"PRIu64"\n",
stats.opackets, stats.oerrors, stats.obytes);
@@
-630,7
+626,10
@@
timeout:
rte_free(pkts_burst);
rte_free(pkts_burst);
- return diff_tsc / total;
+ if (total > 0)
+ return diff_tsc / total;
+ else
+ return -1;
}
static int
}
static int
@@
-677,8
+676,10
@@
exec_burst(uint32_t flags, int lcore)
/* wait for polling finished */
diff_tsc = rte_eal_wait_lcore(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;
return -1;
+ }
printf("Result: %d cycles per packet\n", diff_tsc);
printf("Result: %d cycles per packet\n", diff_tsc);
@@
-708,9
+709,6
@@
test_pmd_perf(void)
return -1;
}
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));
nb_lcores = rte_lcore_count();
memset(lcore_conf, 0, sizeof(lcore_conf));
@@
-815,7
+813,8
@@
test_pmd_perf(void)
return -1;
} else if (sc_flag == SC_BURST_POLL_FIRST ||
sc_flag == SC_BURST_XMIT_FIRST)
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++) {
/* port tear down */
for (portid = 0; portid < nb_ports; portid++) {
@@
-842,10
+841,10
@@
test_set_rxtx_conf(cmdline_fixed_string_t mode)
port_conf.rxmode.enable_scatter = 0;
return 0;
} else if (!strcmp(mode, "scalar")) {
port_conf.rxmode.enable_scatter = 0;
return 0;
} else if (!strcmp(mode, "scalar")) {
- /* bulk alloc rx,
simple
tx */
- tx_conf.txq_flags = 0
xf01
;
- tx_conf.tx_rs_thresh =
128
;
- tx_conf.tx_free_thresh =
128
;
+ /* bulk alloc rx,
full-featured
tx */
+ tx_conf.txq_flags = 0;
+ tx_conf.tx_rs_thresh =
32
;
+ tx_conf.tx_free_thresh =
32
;
port_conf.rxmode.hw_ip_checksum = 1;
port_conf.rxmode.enable_scatter = 0;
return 0;
port_conf.rxmode.hw_ip_checksum = 1;
port_conf.rxmode.enable_scatter = 0;
return 0;
@@
-911,8
+910,4
@@
test_set_rxtx_sc(cmdline_fixed_string_t type)
return -1;
}
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);