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 7D427A0547; Fri, 12 Feb 2021 00:20:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1650F22A1FF; Fri, 12 Feb 2021 00:20:28 +0100 (CET) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mails.dpdk.org (Postfix) with ESMTP id 63AC422A1FB for ; Fri, 12 Feb 2021 00:20:27 +0100 (CET) Received: by mail-pg1-f170.google.com with SMTP id t11so5017670pgu.8 for ; Thu, 11 Feb 2021 15:20:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M46JnEi0IXAliuj3SiTNvLOQR8DSs9V9LpnSknEVBTw=; b=vl0i5qbdos1nOSXNCWTraeBBMYuCzIGzwnNmuHJ14OnhWPnidvhmYPstwqbykIwsO4 vBmN1Pgohk2T1uU/l+1Qn3Suusnphx84P1l5BmbyWZzkh/zlVIoYyI6tgomORevODTaS c7sbSFi0yyIKl/VTy2rIqvQNXrebjbInIGSe5uic79f+W36u5oNSvKwOhej3EUvh7e0a SD+BxH8QUt5zLONEo+A8ntjNnbTmByOCBve8UHZQrJ6/18EdrLqhC21wt61kbVQmBT55 pplc5uuN8BaYOKGyyQ3INXDTiULImiLD6iQri41eJB9rzgCSHWJolBOJ9soobHDpCwEx Q7kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M46JnEi0IXAliuj3SiTNvLOQR8DSs9V9LpnSknEVBTw=; b=TNrcx/ZygQjiCfVgY37HzWQHaijgixRTx221MrqozOHVr1M1wTO7150fdIJhQA4w23 EpyZnMOIDwbe2hvuhYM8AMXqsMI1FHYqfbiN1B1ywOKa2ViOAiPtRL9iJFINAqaqkHK8 DsoEzIntUmmCeZDMLv2jfduqs5EnzHKcSxr4OQYMH9mDfF6bqL2KDQ8MegG3YC6CaEUB M/MS7Gw84oNrcslb6PSzw9ytrdxUkQClt0Mwtx08qxg1HEcp6PUqPjVs0J1nHs7ICZhi TDpm4a+HA43nGn01MNzMvFvq5k8se+vETJHKHt2AXquWlpuhdDFLIi2HubYJm9flFMWp Pdag== X-Gm-Message-State: AOAM531ob5sFagwt2VkXA62a8xMHKt5LYugAlTsKZ3KkHuJzhJux33vb rkPqb5ORgdBSRpboWcsAhdgxfg== X-Google-Smtp-Source: ABdhPJwuZOC0ekXjieoM/G77biwc/Fc+7jghmw8c73QYL4tyZfzYGqtTh13qHwGHg6aTERb88QK+xA== X-Received: by 2002:a62:e303:0:b029:1bc:22d3:9e58 with SMTP id g3-20020a62e3030000b02901bc22d39e58mr416388pfh.29.1613085626627; Thu, 11 Feb 2021 15:20:26 -0800 (PST) Received: from hermes.local (76-14-222-244.or.wavecable.com. [76.14.222.244]) by smtp.gmail.com with ESMTPSA id a5sm6890124pgl.41.2021.02.11.15.20.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 15:20:26 -0800 (PST) Date: Thu, 11 Feb 2021 15:18:27 -0800 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org, sarosh.arif@emumba.com Message-ID: <20210211151827.4e2b7d33@hermes.local> In-Reply-To: <20210211220544.55439-1-thomas@monjalon.net> References: <20210211220544.55439-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] 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" On Thu, 11 Feb 2021 23:05:44 +0100 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