Skip to content

Commit

Permalink
app/testpmd: fix forwarding between non consecutive ports
Browse files Browse the repository at this point in the history
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 emmericp#2 device
Port 4 - PCI emmericp#2 device
Port 5 - TAP emmericp#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: af75078 ("first public release")
Cc: [email protected]

Signed-off-by: Ophir Munk <[email protected]>
Signed-off-by: Raslan Darawsheh <[email protected]>
Acked-by: Pablo de Lara <[email protected]>
  • Loading branch information
OphirMunk authored and tmonjalo committed Nov 7, 2017
1 parent 7da0187 commit fafee5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/test-pmd/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1905,15 +1905,15 @@ simple_fwd_config_setup(void)
fwd_streams[i]->rx_queue = 0;
fwd_streams[i]->tx_port = fwd_ports_ids[j];
fwd_streams[i]->tx_queue = 0;
fwd_streams[i]->peer_addr = j;
fwd_streams[i]->peer_addr = fwd_streams[i]->tx_port;
fwd_streams[i]->retry_enabled = retry_enabled;

if (port_topology == PORT_TOPOLOGY_PAIRED) {
fwd_streams[j]->rx_port = fwd_ports_ids[j];
fwd_streams[j]->rx_queue = 0;
fwd_streams[j]->tx_port = fwd_ports_ids[i];
fwd_streams[j]->tx_queue = 0;
fwd_streams[j]->peer_addr = i;
fwd_streams[j]->peer_addr = fwd_streams[j]->tx_port;
fwd_streams[j]->retry_enabled = retry_enabled;
}
}
Expand Down

0 comments on commit fafee5e

Please sign in to comment.