DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Hunt, David" <david.hunt@intel.com>
To: Harman Kalra <hkalra@marvell.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"ferruh.yigit@linux.intel.com" <ferruh.yigit@linux.intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 2/2] distributor: fix additional check on no of workers
Date: Wed, 17 Jul 2019 16:32:22 +0100	[thread overview]
Message-ID: <2fbf5b1d-bcd5-bb8d-4e75-2c220376633b@intel.com> (raw)
In-Reply-To: <1562321046-25195-2-git-send-email-hkalra@marvell.com>

Hi Harman,

On 05/07/2019 11:05, Harman Kalra wrote:
> No of workers should never exceed RTE_MAX_LCORE.
> RTE_DIST_ALG_SINGLE also require no of workers check.
>
> Fixes: 775003ad2f96 ("distributor: add new burst-capable library")
> Cc: stable@dpdk.org
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>
> ---
>   lib/librte_distributor/rte_distributor.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
> index 208abfb1d..bfcc536fd 100644
> --- a/lib/librte_distributor/rte_distributor.c
> +++ b/lib/librte_distributor/rte_distributor.c
> @@ -595,6 +595,12 @@ rte_distributor_create_v1705(const char *name,
>   	RTE_BUILD_BUG_ON((sizeof(*d) & RTE_CACHE_LINE_MASK) != 0);
>   	RTE_BUILD_BUG_ON((RTE_DISTRIB_MAX_WORKERS & 7) != 0);
>   
> +	if (name == NULL || num_workers >=
> +		(unsigned int)RTE_MIN(RTE_DISTRIB_MAX_WORKERS, RTE_MAX_LCORE)) {
> +		rte_errno = EINVAL;
> +		return NULL;
> +	}
> +
>   	if (alg_type == RTE_DIST_ALG_SINGLE) {
>   		d = malloc(sizeof(struct rte_distributor));
>   		if (d == NULL) {
> @@ -612,11 +618,6 @@ rte_distributor_create_v1705(const char *name,
>   		return d;
>   	}
>   
> -	if (name == NULL || num_workers >= RTE_DISTRIB_MAX_WORKERS) {
> -		rte_errno = EINVAL;
> -		return NULL;
> -	}
> -
>   	snprintf(mz_name, sizeof(mz_name), RTE_DISTRIB_PREFIX"%s", name);
>   	mz = rte_memzone_reserve(mz_name, sizeof(*d), socket_id, NO_FLAGS);
>   	if (mz == NULL) {


Builds OK, runs OK. Change makes sense, also good to move the check to 
the new location.

Acked-by: David Hunt <david.hunt@intel.com>


  parent reply	other threads:[~2019-07-17 15:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-29 15:09 [dpdk-dev] [PATCH 1/2] test/distributor: flush with worker shutdown test fails Harman Kalra
2018-11-29 15:09 ` [dpdk-dev] [PATCH 2/2] distributor: imposing additional check on no of workers Harman Kalra
2019-01-16 19:53 ` [dpdk-dev] [PATCH 1/2] test/distributor: flush with worker shutdown test fails Yigit, Ferruh
2019-02-18 14:51   ` [dpdk-dev] [PATCH v2 " Harman Kalra
2019-02-18 14:51     ` [dpdk-dev] [PATCH v2 2/2] distributor: imposing additional check on no of workers Harman Kalra
2019-03-29 22:54     ` [dpdk-dev] [PATCH v2 1/2] test/distributor: flush with worker shutdown test fails Thomas Monjalon
2019-03-29 22:54       ` Thomas Monjalon
2019-07-04 16:11       ` Thomas Monjalon
2019-07-05 10:05         ` [dpdk-dev] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test Harman Kalra
2019-07-05 10:05           ` [dpdk-dev] [PATCH v3 2/2] distributor: fix additional check on no of workers Harman Kalra
2019-07-16 10:51             ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2019-07-17 15:32             ` Hunt, David [this message]
2019-07-17 20:37               ` [dpdk-dev] " Thomas Monjalon
2019-07-17 15:30           ` [dpdk-dev] [PATCH v3 1/2] test/distributor: fix flush with worker shutdown test Hunt, David

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=2fbf5b1d-bcd5-bb8d-4e75-2c220376633b@intel.com \
    --to=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@linux.intel.com \
    --cc=hkalra@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).