From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5CFA5A0471 for ; Tue, 16 Jul 2019 12:51:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 381B02BE1; Tue, 16 Jul 2019 12:51:32 +0200 (CEST) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by dpdk.org (Postfix) with ESMTP id B21A22BE1; Tue, 16 Jul 2019 12:51:30 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 569DC408; Tue, 16 Jul 2019 06:51:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 16 Jul 2019 06:51:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=n16JR/0hdOmhQt8NMgts2vOUgbBdpUdGDg336hG2a8c=; b=iykl7NvAXvbc rE4qJ2l0sL4EN9cXYkaVHVm3x/G0jeL7tM8itZ8gZuSPdsVnM/roauUJeHlj89VF WvS/i7W3LLpqOLsrLF/rzXRfEdq0OHQ5G/UDikabzs4P2/E6Za2PNXP0VYk1LTPm rPESDRzPPy2ahj+bNi3sBGByyCM37GY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=n16JR/0hdOmhQt8NMgts2vOUgbBdpUdGDg336hG2a 8c=; b=XCg4rgC2zRxTR/swAYIG4LRzbMi7C7NQAu3P206WNwU5vxhcdIYTs6CP9 5ea/+UTBWpQZUiQ/uXPoXiCxllfMdKIzMIJ9kHQKBYr9ymB7OmRM5fMF2RUet5zY GUxZxl2HDANPOLH0Ugdje65NJvOMKHf6coQhW8FeP5yb1EcEz/EcaYTY7VK+30SQ GZBTlnVfQc22hRiK3InDDGYkDzxZaUnNmDuyyWIIz2jJfRn9Jkk1l0TRRDfy9v/o axAsT94IS/5ivJHGSeVD5pjxJdHkxy1ErDnUwWeN/nr8uvbvS/r88GMT4tNX+xAF 4hB1zTm06fJlHBRbNOw6UpdwuWNcg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddriedtgdefhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhho mhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 8A17C8005B; Tue, 16 Jul 2019 06:51:27 -0400 (EDT) From: Thomas Monjalon To: "dev@dpdk.org" Cc: stable@dpdk.org, Harman Kalra , "david.hunt@intel.com" , "ferruh.yigit@linux.intel.com" , Jerin Jacob Kollanukkaran , bruce.richardson@intel.com Date: Tue, 16 Jul 2019 12:51:26 +0200 Message-ID: <16306721.1DhVNbSdqj@xps> In-Reply-To: <1562321046-25195-2-git-send-email-hkalra@marvell.com> References: <223181000.veHZD1QNU4@xps> <1562321046-25195-1-git-send-email-hkalra@marvell.com> <1562321046-25195-2-git-send-email-hkalra@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [PATCH v3 2/2] distributor: fix additional check on no of workers X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Any review please? 05/07/2019 12:05, Harman Kalra: > 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 > --- > 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) { >