Skip to content

Commit c502338

Browse files
fengchengwenshemminger
authored andcommitted
app/testpmd: fix invalid txp when setup DCB forward
The txp maybe invalid (e.g. start with only one port but set with 1), this commit fix it by get txp from fwd_topology_tx_port_get() function. An added benefit is that the DCB test also supports '--port-topology' parameter. Fixes: 1a57249 ("app/testpmd: setup DCB forwarding based on traffic class") Cc: [email protected] Signed-off-by: Chengwen Feng <[email protected]>
1 parent f219e55 commit c502338

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

app/test-pmd/config.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5187,7 +5187,7 @@ dcb_fwd_config_setup(void)
51875187
/* reinitialize forwarding streams */
51885188
init_fwd_streams();
51895189
sm_id = 0;
5190-
txp = 1;
5190+
txp = fwd_topology_tx_port_get(rxp);
51915191
/* get the dcb info on the first RX and TX ports */
51925192
(void)rte_eth_dev_get_dcb_info(fwd_ports_ids[rxp], &rxp_dcb_info);
51935193
(void)rte_eth_dev_get_dcb_info(fwd_ports_ids[txp], &txp_dcb_info);
@@ -5235,11 +5235,8 @@ dcb_fwd_config_setup(void)
52355235
rxp++;
52365236
if (rxp >= nb_fwd_ports)
52375237
return;
5238+
txp = fwd_topology_tx_port_get(rxp);
52385239
/* get the dcb information on next RX and TX ports */
5239-
if ((rxp & 0x1) == 0)
5240-
txp = (portid_t) (rxp + 1);
5241-
else
5242-
txp = (portid_t) (rxp - 1);
52435240
rte_eth_dev_get_dcb_info(fwd_ports_ids[rxp], &rxp_dcb_info);
52445241
rte_eth_dev_get_dcb_info(fwd_ports_ids[txp], &txp_dcb_info);
52455242
}

0 commit comments

Comments
 (0)