app/testpmd: add warning message when user sets rxq greater than txq

Message ID 20190502154446.35861-1-herakliusz.lipiec@intel.com
State New
Delegated to: Ferruh Yigit
Headers show
Series
  • app/testpmd: add warning message when user sets rxq greater than txq
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Herakliusz Lipiec May 2, 2019, 3:44 p.m.
add a warning message when user sets port config all rxq value larger
than txq in interactive mode.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
---
 app/test-pmd/cmdline.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 5a10c5f38..94be3c6f8 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1741,6 +1741,10 @@  cmd_config_rx_tx_parsed(void *parsed_result,
 		}
 		if (check_nb_rxq(res->value) != 0)
 			return;
+		if (res->value > nb_txq) {
+			printf("Warning: rxq should not be larger than txq\n");
+			return;
+		}
 		nb_rxq = res->value;
 	}
 	else if (!strcmp(res->name, "txq")) {
@@ -1750,6 +1754,10 @@  cmd_config_rx_tx_parsed(void *parsed_result,
 		}
 		if (check_nb_txq(res->value) != 0)
 			return;
+		if (res->value < nb_rxq) {
+			printf("Warning: rxq should not be larger than txq\n");
+			return;
+		}
 		nb_txq = res->value;
 	}
 	else if (!strcmp(res->name, "rxd")) {