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

Message ID 20190502154446.35861-1-herakliusz.lipiec@intel.com
State Changes Requested, archived
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

Lipiec, Herakliusz 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(+)

Comments

Bernard Iremonger June 7, 2019, 1:25 p.m. | #1
Hi Herakliusz,

> -----Original Message-----
> From: Lipiec, Herakliusz
> Sent: Thursday, May 2, 2019 4:45 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>
> Cc: dev@dpdk.org; Xiao, QimaiX <qimaix.xiao@intel.com>; Wang, Ying A
> <ying.a.wang@intel.com>; Lipiec, Herakliusz <herakliusz.lipiec@intel.com>
> Subject: [PATCH] app/testpmd: add warning message when user sets rxq greater
> than txq
> 
> 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>

./dpdk/devtools/check-git-log.sh -1
Headline too long:
        app/testpmd: add warning message when user sets rxq greater than txq

Commit message needs to be fixed, otherwise
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Ferruh Yigit June 27, 2019, 3:25 p.m. | #2
On 5/2/2019 4:44 PM, Herakliusz Lipiec wrote:
> 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>


Hi Hero,

Can you please give some context that why we need this check? What is broken
without this check?

Thanks,
ferruh

> ---
>  app/test-pmd/cmdline.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> 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")) {
>

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")) {