summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTomasz Kulasek <tomaszx.kulasek@intel.com>2016-04-07 18:38:31 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-04-07 23:05:47 +0200
commitdd1c68fab28e74d6795155666694bdb0a2510a7c (patch)
tree550006ba6df92063c01e799eab47391f846a0a58 /examples
parent99218e76fec87681053ea207ae2ae2253827c56a (diff)
downloaddpdk-dd1c68fab28e74d6795155666694bdb0a2510a7c.zip
dpdk-dd1c68fab28e74d6795155666694bdb0a2510a7c.tar.gz
dpdk-dd1c68fab28e74d6795155666694bdb0a2510a7c.tar.xz
examples: fix draining all queues in l3fwd derivatives
In l3fwd-acl and l3fwd-power not all tx ports was included in tx_port_id array, used to periodically drain only available ports. This caused that some packets can remain in buffer when application stops to receiving packets or when size of burst is small. Fixes: e2366e74e029 ("examples: use buffered Tx") Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/l3fwd-acl/main.c6
-rw-r--r--examples/l3fwd-power/main.c6
2 files changed, 2 insertions, 10 deletions
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 621872f..26d9f5e 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1893,7 +1893,6 @@ main(int argc, char **argv)
unsigned lcore_id;
uint32_t n_tx_queue, nb_lcores;
uint8_t portid, nb_rx_queue, queue, socketid;
- uint8_t nb_tx_port;
/* init EAL */
ret = rte_eal_init(argc, argv);
@@ -1926,7 +1925,6 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "app_acl_init failed\n");
nb_lcores = rte_lcore_count();
- nb_tx_port = 0;
/* initialize all ports */
for (portid = 0; portid < nb_ports; portid++) {
@@ -2008,12 +2006,10 @@ main(int argc, char **argv)
qconf->tx_queue_id[portid] = queueid;
queueid++;
- qconf->n_tx_port = nb_tx_port;
qconf->tx_port_id[qconf->n_tx_port] = portid;
+ qconf->n_tx_port++;
}
printf("\n");
-
- nb_tx_port++;
}
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 5934efe..cb42bfb 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1546,7 +1546,6 @@ main(int argc, char **argv)
uint32_t n_tx_queue, nb_lcores;
uint32_t dev_rxq_num, dev_txq_num;
uint8_t portid, nb_rx_queue, queue, socketid;
- uint8_t nb_tx_port;
/* catch SIGINT and restore cpufreq governor to ondemand */
signal(SIGINT, signal_exit_now);
@@ -1582,7 +1581,6 @@ main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "check_port_config failed\n");
nb_lcores = rte_lcore_count();
- nb_tx_port = 0;
/* initialize all ports */
for (portid = 0; portid < nb_ports; portid++) {
@@ -1675,12 +1673,10 @@ main(int argc, char **argv)
qconf->tx_queue_id[portid] = queueid;
queueid++;
- qconf->n_tx_port = nb_tx_port;
qconf->tx_port_id[qconf->n_tx_port] = portid;
+ qconf->n_tx_port++;
}
printf("\n");
-
- nb_tx_port++;
}
for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {