DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] examples/load_balancer: fix Tx flush
Date: Thu, 27 Apr 2017 11:27:54 +0200	[thread overview]
Message-ID: <f370cd13bd8a4d4e0ee82c05c2a67420044cdbb6.1493285259.git.Andriy.Berestovskyy@caviumnetworks.com> (raw)

Port ID is not an index from 0 to n_nic_ports, but rather a value
of nic_ports array.

Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
---
 examples/load_balancer/runtime.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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;
-- 
2.7.4

             reply	other threads:[~2017-04-27  9:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27  9:27 Andriy Berestovskyy [this message]
2017-05-01 16:16 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f370cd13bd8a4d4e0ee82c05c2a67420044cdbb6.1493285259.git.Andriy.Berestovskyy@caviumnetworks.com \
    --to=andriy.berestovskyy@caviumnetworks.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).