Code Review
/
deb_dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
New upstream version 16.11.4
[deb_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
1ffd65a
..
afab180
100644
(file)
--- a/
app/test/test_pmd_perf.c
+++ b/
app/test/test_pmd_perf.c
@@
-572,6
+572,7
@@
poll_burst(void *args)
unsigned i, portid, nb_rx = 0;
uint64_t total;
uint64_t timeout = MAX_IDLE;
unsigned i, portid, nb_rx = 0;
uint64_t total;
uint64_t timeout = MAX_IDLE;
+ int num[RTE_MAX_ETHPORTS];
lcore_id = rte_lcore_id();
conf = &lcore_conf[lcore_id];
lcore_id = rte_lcore_id();
conf = &lcore_conf[lcore_id];
@@
-591,6
+592,7
@@
poll_burst(void *args)
for (i = 0; i < conf->nb_ports; i++) {
portid = conf->portlist[i];
next[portid] = i * pkt_per_port;
for (i = 0; i < conf->nb_ports; i++) {
portid = conf->portlist[i];
next[portid] = i * pkt_per_port;
+ num[portid] = pkt_per_port;
}
while (!rte_atomic64_read(&start))
}
while (!rte_atomic64_read(&start))
@@
-601,8
+603,8
@@
poll_burst(void *args)
for (i = 0; i < conf->nb_ports; i++) {
portid = conf->portlist[i];
nb_rx = rte_eth_rx_burst((uint8_t) portid, 0,
for (i = 0; i < conf->nb_ports; i++) {
portid = conf->portlist[i];
nb_rx = rte_eth_rx_burst((uint8_t) portid, 0,
-
&pkts_burst[next[portid]],
-
MAX_PKT_BURST
);
+ &pkts_burst[next[portid]],
+
RTE_MIN(MAX_PKT_BURST, num[portid])
);
if (unlikely(nb_rx == 0)) {
timeout--;
if (unlikely(timeout == 0))
if (unlikely(nb_rx == 0)) {
timeout--;
if (unlikely(timeout == 0))
@@
-610,6
+612,7
@@
poll_burst(void *args)
continue;
}
next[portid] += nb_rx;
continue;
}
next[portid] += nb_rx;
+ num[portid] -= nb_rx;
total -= nb_rx;
}
}
total -= nb_rx;
}
}
@@
-618,7
+621,6
@@
timeout:
printf("%"PRIu64" packets lost, IDLE %"PRIu64" times\n",
total, MAX_IDLE - timeout);
printf("%"PRIu64" packets lost, IDLE %"PRIu64" times\n",
total, MAX_IDLE - timeout);
-
/* clean up */
total = pkt_per_port * conf->nb_ports - total;
for (i = 0; i < total; i++)
/* clean up */
total = pkt_per_port * conf->nb_ports - total;
for (i = 0; i < total; i++)
@@
-644,7
+646,7
@@
exec_burst(uint32_t flags, int lcore)
conf = &lcore_conf[lcore];
pkt_per_port = MAX_TRAFFIC_BURST;
conf = &lcore_conf[lcore];
pkt_per_port = MAX_TRAFFIC_BURST;
- num = pkt_per_port;
+ num = pkt_per_port
* conf->nb_ports
;
rte_atomic64_init(&start);
rte_atomic64_init(&start);
@@
-661,11
+663,12
@@
exec_burst(uint32_t flags, int lcore)
nb_tx = RTE_MIN(MAX_PKT_BURST, num);
for (i = 0; i < conf->nb_ports; i++) {
portid = conf->portlist[i];
nb_tx = RTE_MIN(MAX_PKT_BURST, num);
for (i = 0; i < conf->nb_ports; i++) {
portid = conf->portlist[i];
- rte_eth_tx_burst(portid, 0,
+
nb_tx =
rte_eth_tx_burst(portid, 0,
&tx_burst[idx], nb_tx);
idx += nb_tx;
&tx_burst[idx], nb_tx);
idx += nb_tx;
+ num -= nb_tx;
}
}
- num -= nb_tx;
+
}
sleep(5);
}
sleep(5);