DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] app/testpmd: avoid the process ID out of range
@ 2021-11-15  6:05 Haiyue Wang
  2021-11-15  8:56 ` Min Hu (Connor)
  0 siblings, 1 reply; 3+ messages in thread
From: Haiyue Wang @ 2021-11-15  6:05 UTC (permalink / raw)
  To: dev
  Cc: Haiyue Wang, Xiaoyun Li, Lijun Ou, Andrew Rybchenko,
	Ajit Khaparde, Aman Deep Singh

The 'proc-id' should be less than 'num-procs', if not, exit the testpmd
and show the error message.

Fixes: a550baf24af9 ("app/testpmd: support multi-process")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 app/test-pmd/parameters.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 0974b0a38f..5251722d0f 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -1527,6 +1527,12 @@ launch_args_parse(int argc, char** argv)
 		rte_exit(EXIT_FAILURE, "Command line is incorrect\n");
 	}
 
+	if (proc_id >= (int)num_procs)
+		rte_exit(EXIT_FAILURE,
+			 "The multi-process option '%s(%d)' should be less than '%s(%u)'\n",
+			 PARAM_PROC_ID, proc_id,
+			 PARAM_NUM_PROCS, num_procs);
+
 	/* Set offload configuration from command line parameters. */
 	rx_mode.offloads = rx_offloads;
 	tx_mode.offloads = tx_offloads;
-- 
2.33.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] app/testpmd: avoid the process ID out of range
  2021-11-15  6:05 [PATCH v1] app/testpmd: avoid the process ID out of range Haiyue Wang
@ 2021-11-15  8:56 ` Min Hu (Connor)
  2021-11-15 15:18   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Min Hu (Connor) @ 2021-11-15  8:56 UTC (permalink / raw)
  To: Haiyue Wang, dev
  Cc: Xiaoyun Li, Lijun Ou, Andrew Rybchenko, Ajit Khaparde, Aman Deep Singh

Acked-by:  Min Hu (Connor) <humin29@huawei.com>

在 2021/11/15 14:05, Haiyue Wang 写道:
> The 'proc-id' should be less than 'num-procs', if not, exit the testpmd
> and show the error message.
> 
> Fixes: a550baf24af9 ("app/testpmd: support multi-process")
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
>   app/test-pmd/parameters.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> index 0974b0a38f..5251722d0f 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -1527,6 +1527,12 @@ launch_args_parse(int argc, char** argv)
>   		rte_exit(EXIT_FAILURE, "Command line is incorrect\n");
>   	}
>   
> +	if (proc_id >= (int)num_procs)
> +		rte_exit(EXIT_FAILURE,
> +			 "The multi-process option '%s(%d)' should be less than '%s(%u)'\n",
> +			 PARAM_PROC_ID, proc_id,
> +			 PARAM_NUM_PROCS, num_procs);
> +
>   	/* Set offload configuration from command line parameters. */
>   	rx_mode.offloads = rx_offloads;
>   	tx_mode.offloads = tx_offloads;
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] app/testpmd: avoid the process ID out of range
  2021-11-15  8:56 ` Min Hu (Connor)
@ 2021-11-15 15:18   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2021-11-15 15:18 UTC (permalink / raw)
  To: Min Hu (Connor), Haiyue Wang, dev
  Cc: Xiaoyun Li, Lijun Ou, Andrew Rybchenko, Ajit Khaparde, Aman Deep Singh

On 11/15/2021 8:56 AM, Min Hu (Connor) wrote:

> 
> 在 2021/11/15 14:05, Haiyue Wang 写道:
>> The 'proc-id' should be less than 'num-procs', if not, exit the testpmd
>> and show the error message.
>>
>> Fixes: a550baf24af9 ("app/testpmd: support multi-process")
>>
>> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> > Acked-by:  Min Hu (Connor) <humin29@huawei.com>> 

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-15 15:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15  6:05 [PATCH v1] app/testpmd: avoid the process ID out of range Haiyue Wang
2021-11-15  8:56 ` Min Hu (Connor)
2021-11-15 15:18   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).