DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/load_balancer: fix Tx flush
@ 2017-04-27  9:27 Andriy Berestovskyy
  2017-05-01 16:16 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Andriy Berestovskyy @ 2017-04-27  9:27 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/load_balancer: fix Tx flush
  2017-04-27  9:27 [dpdk-dev] [PATCH] examples/load_balancer: fix Tx flush Andriy Berestovskyy
@ 2017-05-01 16:16 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2017-05-01 16:16 UTC (permalink / raw)
  To: Andriy Berestovskyy; +Cc: dev

27/04/2017 11:27, Andriy Berestovskyy:
> 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>

Fixes: af75078fece3 ("first public release")

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-01 16:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27  9:27 [dpdk-dev] [PATCH] examples/load_balancer: fix Tx flush Andriy Berestovskyy
2017-05-01 16:16 ` Thomas Monjalon

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).