app/testpmd: fix port configuration print
authorShahaf Shuler <shahafs@mellanox.com>
Wed, 10 Jan 2018 09:09:09 +0000 (11:09 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 15 Jan 2018 09:50:34 +0000 (10:50 +0100)
The print of the port configuration was only according to configuration
of the first port.

Fixes: f2c5125a686a ("app/testpmd: use default Rx/Tx port configuration")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
app/test-pmd/config.c

index b2dbd56..ae8e795 100644 (file)
@@ -1666,33 +1666,45 @@ fwd_lcores_config_display(void)
 void
 rxtx_config_display(void)
 {
-       printf("  %s packet forwarding%s - CRC stripping %s - "
-              "packets/burst=%d\n", cur_fwd_eng->fwd_mode_name,
+       portid_t pid;
+
+       printf("  %s packet forwarding%s packets/burst=%d\n",
+              cur_fwd_eng->fwd_mode_name,
               retry_enabled == 0 ? "" : " with retry",
-              rx_mode.hw_strip_crc ? "enabled" : "disabled",
               nb_pkt_per_burst);
 
        if (cur_fwd_eng == &tx_only_engine || cur_fwd_eng == &flow_gen_engine)
                printf("  packet len=%u - nb packet segments=%d\n",
                                (unsigned)tx_pkt_length, (int) tx_pkt_nb_segs);
 
-       struct rte_eth_rxconf *rx_conf = &ports[0].rx_conf;
-       struct rte_eth_txconf *tx_conf = &ports[0].tx_conf;
-
        printf("  nb forwarding cores=%d - nb forwarding ports=%d\n",
               nb_fwd_lcores, nb_fwd_ports);
-       printf("  RX queues=%d - RX desc=%d - RX free threshold=%d\n",
-              nb_rxq, nb_rxd, rx_conf->rx_free_thresh);
-       printf("  RX threshold registers: pthresh=%d hthresh=%d wthresh=%d\n",
-              rx_conf->rx_thresh.pthresh, rx_conf->rx_thresh.hthresh,
-              rx_conf->rx_thresh.wthresh);
-       printf("  TX queues=%d - TX desc=%d - TX free threshold=%d\n",
-              nb_txq, nb_txd, tx_conf->tx_free_thresh);
-       printf("  TX threshold registers: pthresh=%d hthresh=%d wthresh=%d\n",
-              tx_conf->tx_thresh.pthresh, tx_conf->tx_thresh.hthresh,
-              tx_conf->tx_thresh.wthresh);
-       printf("  TX RS bit threshold=%d - TXQ flags=0x%"PRIx32"\n",
-              tx_conf->tx_rs_thresh, tx_conf->txq_flags);
+
+       RTE_ETH_FOREACH_DEV(pid) {
+               struct rte_eth_rxconf *rx_conf = &ports[pid].rx_conf;
+               struct rte_eth_txconf *tx_conf = &ports[pid].tx_conf;
+
+               printf("  port %d:\n", (unsigned int)pid);
+               printf("  CRC stripping %s\n",
+                               ports[pid].dev_conf.rxmode.hw_strip_crc ?
+                               "enabled" : "disabled");
+               printf("  RX queues=%d - RX desc=%d - RX free threshold=%d\n",
+                               nb_rxq, nb_rxd, rx_conf->rx_free_thresh);
+               printf("  RX threshold registers: pthresh=%d hthresh=%d "
+                      " wthresh=%d\n",
+                               rx_conf->rx_thresh.pthresh,
+                               rx_conf->rx_thresh.hthresh,
+                               rx_conf->rx_thresh.wthresh);
+               printf("  TX queues=%d - TX desc=%d - TX free threshold=%d\n",
+                               nb_txq, nb_txd, tx_conf->tx_free_thresh);
+               printf("  TX threshold registers: pthresh=%d hthresh=%d "
+                      " wthresh=%d\n",
+                               tx_conf->tx_thresh.pthresh,
+                               tx_conf->tx_thresh.hthresh,
+                               tx_conf->tx_thresh.wthresh);
+               printf("  TX RS bit threshold=%d - TXQ flags=0x%"PRIx32"\n",
+                               tx_conf->tx_rs_thresh, tx_conf->txq_flags);
+       }
 }
 
 void