Function to get rx/tx port configuration from the PMDs
was added in previous release to simplify the port configuration
in all sample apps, but testpmd was not modified.
This patch makes testpmd get the default rx/tx port configuration,
but still uses the parameters passed by the command line.
This patch depends on patch "testpmd: remove duplicated parameter parsing"
(http://dpdk.org/dev/patchwork/patch/3015)
Signed-off-by: Pablo de Lara
---
app/test-pmd/cmdline.c| 12 +++---
app/test-pmd/config.c | 15 +--
app/test-pmd/parameters.c | 20 +-
app/test-pmd/testpmd.c| 93 +++--
app/test-pmd/testpmd.h| 18 +---
5 files changed, 93 insertions(+), 65 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 590e427..a310680 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2097,17 +2097,17 @@ cmd_config_thresh_parsed(void *parsed_result,
}
if (!strcmp(res->name, "txpt"))
- tx_thresh.pthresh = res->value;
+ tx_pthresh = res->value;
else if(!strcmp(res->name, "txht"))
- tx_thresh.hthresh = res->value;
+ tx_hthresh = res->value;
else if(!strcmp(res->name, "txwt"))
- tx_thresh.wthresh = res->value;
+ tx_wthresh = res->value;
else if(!strcmp(res->name, "rxpt"))
- rx_thresh.pthresh = res->value;
+ rx_pthresh = res->value;
else if(!strcmp(res->name, "rxht"))
- rx_thresh.hthresh = res->value;
+ rx_hthresh = res->value;
else if(!strcmp(res->name, "rxwt"))
- rx_thresh.wthresh = res->value;
+ rx_wthresh = res->value;
else {
printf("Unknown parameter\n");
return;
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index c40f819..6bcd23c 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -774,18 +774,23 @@ rxtx_config_display(void)
printf(" packet len=%u - nb packet segments=%d\n",
(unsigned)tx_pkt_length, (int) tx_pkt_nb_segs);
+ struct rte_eth_rxconf *rx_conf = [0].rx_conf;
+ struct rte_eth_txconf *tx_conf = [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_free_thresh);
+ nb_rxq, nb_rxd, rx_conf->rx_free_thresh);
printf(" RX threshold registers: pthresh=%d hthresh=%d wthresh=%d\n",
- rx_thresh.pthresh, rx_thresh.hthresh, rx_thresh.wthresh);
+ 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_free_thresh);
+ nb_txq, nb_txd, tx_conf->tx_free_thresh);
printf(" TX threshold registers: pthresh=%d hthresh=%d wthresh=%d\n",
- tx_thresh.pthresh, tx_thresh.hthresh, tx_thresh.wthresh);
+ 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_rs_thresh, txq_flags);
+ tx_conf->tx_rs_thresh, tx_conf->txq_flags);
}
void
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index e66153d..19fbf46 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -835,14 +835,14 @@ launch_args_parse(int argc, char** argv)
if (!strcmp(lgopts[opt_idx].name, "txfreet")) {
n = atoi(optarg);
if (n >= 0)
- tx_free_thresh = (uint16_t)n;
+ tx_free_thresh = (int16_t)n;
else
rte_exit(EXIT_FAILURE, "txfreet must be
>= 0\n");
}
if (!strcmp(lgopts[opt_idx].name, "txrst")) {
n = atoi(optarg);
if (n >= 0)
- tx_rs_thresh = (uint16_t)n;
+ tx_rs_thresh = (int16_t)n;
else
rte_exit(EXIT_FAILURE, "txrst must be
>= 0\n");
}
@@ -850,7 +850,7 @@ launch_args_parse(int argc, char** argv)
char *end = NULL;
n = strtoul(optarg, , 16);
if (n >= 0)
- txq_flags = (uint32_t)n;
+ txq_flags = (int32_t)n;