DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: Haiyue Wang <haiyue.wang@intel.com>, <dev@dpdk.org>
Cc: Xiaoyun Li <xiaoyun.li@intel.com>, Lijun Ou <oulijun@huawei.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Aman Deep Singh <aman.deep.singh@intel.com>
Subject: Re: [PATCH v1] app/testpmd: avoid the process ID out of range
Date: Mon, 15 Nov 2021 16:56:29 +0800	[thread overview]
Message-ID: <0a42ffde-d5ca-490a-77ff-041203910bd5@huawei.com> (raw)
In-Reply-To: <20211115060509.216653-1-haiyue.wang@intel.com>

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;
> 

  reply	other threads:[~2021-11-15  8:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  6:05 Haiyue Wang
2021-11-15  8:56 ` Min Hu (Connor) [this message]
2021-11-15 15:18   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a42ffde-d5ca-490a-77ff-041203910bd5@huawei.com \
    --to=humin29@huawei.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=haiyue.wang@intel.com \
    --cc=oulijun@huawei.com \
    --cc=xiaoyun.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).