app/testpmd: fix forwarding between non consecutive ports
authorOphir Munk <ophirmu@mellanox.com>
Tue, 7 Nov 2017 13:52:30 +0000 (13:52 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 7 Nov 2017 20:41:35 +0000 (21:41 +0100)
commitfafee5e9caaf439b29a6e10600e91b8de81eff66
treee954e66dd1ad3352baf147ee1277f24cec1db407
parent7da018731c565e11215e0924985e39ae24179916
app/testpmd: fix forwarding between non consecutive ports

When defining two failsafe devices in testpmd the port numbers of the
failsafe devices may not be consecutive.
For example: if failsafe device includes a PCI device and a TAP device
then failsafe port numbers would be 0 and 3.
Port 0 - failsafe #1 device
Port 1 - PCI #1 device
Port 2 - TAP #1 device
Port 3 - failsafe #2 device
Port 4 - PCI #2 device
Port 5 - TAP #2 device

If forwarding is defined between the failsafe devices including a peer
address the forwarding should be between peer addresses of ports 0
and 3. Instead testpmd establishes forwarding between peer addresses
of consecutive ports 0 and 1. This commit fixes this bug.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
app/test-pmd/config.c