From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 95DD3A0A02; Thu, 25 Mar 2021 18:05:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E0A20140ECD; Thu, 25 Mar 2021 18:05:04 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id F2EE0140EAB for ; Thu, 25 Mar 2021 18:05:03 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 76C3D5C00E8; Thu, 25 Mar 2021 13:05:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Mar 2021 13:05:03 -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=fm3; bh= x0qV+gA3YnnI4RX2ojerYI54B8yo3T99C4XGRNsMj/Y=; b=FCIzgNA5uJWgxeKY atQ+lU66DA4SZQ0dFvvTfu8H//A5Z9tOOrcAXsGZshNxU6jkrSZW5ko65LhV8YXc aOah0ROXOUBJIfpGUuZLahdB4MYbncwSRkK1+mKQ5UcK2DObXXHa7rzJfVH6rkuX Y0iSlUTJTLp6qpus4Au4UPQVhlmqOkj6s0qEnCbo4GCE6dyYwZ/thdry89CWOfdz b5ybVZqXoKnUTaRVBtwMqH2O8QSOdvlhpkM49MLZPn1yYvekOJU6l8mVLyKkld8v UmFSdxlpAJtOVA2IU8Ha+/IoLYwnT92fA6tPsoJtsRWwZ+MlRU3jhioV12ui+Jte pbPauQ== 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=fm2; bh=x0qV+gA3YnnI4RX2ojerYI54B8yo3T99C4XGRNsMj /Y=; b=mjIyvwJcAjStRkqrKQvkmvj2O23ntNwOiMHZfFQhBeyfPE3fxWlai2X45 PalYe3g2/G+GxLpd69AuH/0pyfjdC9zlKc3pKzLrrR3bu/snlrIjhqjMv/UZKOyq cCp14x2NAI3+jBe3v4FFWmr3snT4/3mMo6LrxVepFDvK+NYuyKmA6WTr9gnSsjk9 G1gIe+zQEHTMnuVJkunVayHuLw6O6nx6aHPrk5JmDM+3raCldxD2Zw8PbC1jLS8g JY8iQaZue91BqjAoGfmMLMxouh5ZJeyFBknqsl1FdkMK3xIT+EvuN9Hy7Uw4MBTt Zliu1rCLuOrzM8SYYcKCOk+XvI/kQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehtddgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght 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 2C982240057; Thu, 25 Mar 2021 13:05:02 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: sarosh.arif@emumba.com, Stephen Hemminger , "Burakov, Anatoly" Date: Thu, 25 Mar 2021 18:04:59 +0100 Message-ID: <5172321.eQpyLiSyhY@thomas> In-Reply-To: <6593f04c-acb6-9671-dc86-29d52ab65d55@intel.com> References: <20210211220544.55439-1-thomas@monjalon.net> <20210321090903.612998-1-thomas@monjalon.net> <6593f04c-acb6-9671-dc86-29d52ab65d55@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] usertools: check 0-division with hugepage size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 23/03/2021 12:30, Burakov, Anatoly: > On 21-Mar-21 9:09 AM, Thomas Monjalon wrote: > > The default page size can be None, and the page size from user request > > can be 0 kB if lower than 1024. In these cases, a division will fail. > > In order to avoid a Python exception, the page size is checked > > and an error message "Invalid page size" is printed. > > > > A similar error message is printed in set_hugepages() > > if the size is not supported, except at this stage the message can be > > completed with "Valid page sizes". > > Unfortunately the first check is too early to print such information. > > > > A third error message can be printed in a different place (get_memsize) > > in case of a format issue, e.g. a negative size. > > The function get_memsize() is also used for total requested size, > > so the error message "not a valid page size" was potentially wrong. > > This message is replaced with the more general "is not a valid size". > > > > Signed-off-by: Thomas Monjalon > > Acked-by: Stephen Hemminger > > --- > > v2: use simple "if not" construct for both None and 0 > > --- > Acked-by: Anatoly Burakov Applied