summaryrefslogtreecommitdiff
path: root/examples/load_balancer
diff options
context:
space:
mode:
authorAndriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>2017-04-27 11:27:54 +0200
committerThomas Monjalon <thomas@monjalon.net>2017-05-01 18:18:29 +0200
commit509f35d4c48434ec5a4a8b60342bf633eea69062 (patch)
tree3fa1138cd8be5325e9974ae14b9e02a1bc8ccc15 /examples/load_balancer
parent4175729d012914e1c10e5f54e5a59169be020124 (diff)
downloaddpdk-draft-windows-509f35d4c48434ec5a4a8b60342bf633eea69062.zip
dpdk-draft-windows-509f35d4c48434ec5a4a8b60342bf633eea69062.tar.gz
dpdk-draft-windows-509f35d4c48434ec5a4a8b60342bf633eea69062.tar.xz
examples/load_balancer: fix Tx flush
Port ID is not an index from 0 to n_nic_ports, but rather a value of nic_ports array. Fixes: af75078fece3 ("first public release") Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Diffstat (limited to 'examples/load_balancer')
-rw-r--r--examples/load_balancer/runtime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c
index 8192c08..7f918aa 100644
--- a/examples/load_balancer/runtime.c
+++ b/examples/load_balancer/runtime.c
@@ -420,10 +420,12 @@ static inline void
app_lcore_io_tx_flush(struct app_lcore_params_io *lp)
{
uint8_t port;
+ uint32_t i;
- for (port = 0; port < lp->tx.n_nic_ports; port ++) {
+ for (i = 0; i < lp->tx.n_nic_ports; i++) {
uint32_t n_pkts;
+ port = lp->tx.nic_ports[i];
if (likely((lp->tx.mbuf_out_flush[port] == 0) ||
(lp->tx.mbuf_out[port].n_mbufs == 0))) {
lp->tx.mbuf_out_flush[port] = 1;