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 AB77AA09F6; Thu, 17 Dec 2020 19:19:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 051EFCA28; Thu, 17 Dec 2020 19:19:36 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by dpdk.org (Postfix) with ESMTP id 8A38DCA24 for ; Thu, 17 Dec 2020 19:19:33 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id x12so15118034plr.10 for ; Thu, 17 Dec 2020 10:19:33 -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=2B2fnlDlEbZ7/ATcmwSTxxTLcBO+KMsMQwEoOz5FCKU=; b=SxZdm8Iev1i51cG6hc8+zVxfjoIecQCGSOmGiR3KHiJzI0xMDkeq0AQh+XHE1hmO8g BnSO2aIro4ZCSElAl2jdW/hbovOR3/8rwV6FQ7f6QOSu8smAVzinzmgANTvgl7UT20rs i1Xy7zs20sioRgO/uDVnKVsfRMDbiCRxEeU6YsIXHar07EZnZ3L0wSbwC4F6YHk8AoHP 1YLsP+h0RLpo/b6uLSBMvGMwNzm7sW1nIaRCVelxZl3TvP5ZWxo+WkUUrpeOCdkIN7nh 8ovhGRumJEBmkNvHe3whdxT3w0HY6g3AOjaeLufFBd+UNa1HB37MoIb0V92DLbhejsZR VWBA== 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=2B2fnlDlEbZ7/ATcmwSTxxTLcBO+KMsMQwEoOz5FCKU=; b=VuOioR5BrAWEedTAnttHIiVQ7ZjnasBuif+tkEl2tiDFnA4NB7ifIeEImTi+/m1ym9 ubnALPMM0C7qHJCdklp76a5r0+gQhEJAVJWAs1EZeZ1AjWly5CF8m5RNqxCXKvoGqHQ3 gJaKslR82KYklNDiOMlBlRMd2+leMSFDMMJXF/rEu6Bh/gtlgOg6MtNckUp70W0mgmIX GS5ggyXoMyrX6xvzx3bJ/CJP+vI58M2TT3rFvFbYodLIjDJe2vb9sYB8YGoevqP4HBAJ qzquRpnBAKdPt66oiE9jfUpkybYihxKBip1HhMUa+5VEhM2rQZhzawEczEr0TzmcZc4m XjAA== X-Gm-Message-State: AOAM530GqrQjMj5hZNCX9pE+MsAYHUKGDOaqnSLnbEaydyIgWM670AQz 71aQMtASJ5YXz1Pw0c9wkWdLEA== X-Google-Smtp-Source: ABdhPJzY4HNFigMUZw4hJALEAkuMmLEY8/ExSJcWsVur+064tZlccludJcMQO8Z5Kvc19EaEPPQ30Q== X-Received: by 2002:a17:90a:be0a:: with SMTP id a10mr418995pjs.139.1608229171477; Thu, 17 Dec 2020 10:19:31 -0800 (PST) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id q16sm6526475pfg.139.2020.12.17.10.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 10:19:27 -0800 (PST) Date: Thu, 17 Dec 2020 10:15:52 -0800 From: Stephen Hemminger To: Sarosh Arif Cc: sthemmin@microsoft.com, dev@dpdk.org Message-ID: <20201217101552.670926d0@hermes.local> In-Reply-To: <20201217111616.24057-1-sarosh.arif@emumba.com> References: <20201130124533.23341-1-sarosh.arif@emumba.com> <20201217111616.24057-1-sarosh.arif@emumba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [v2 PATCH] usertools: show an error message if unable to reserve requested hugepages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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, 17 Dec 2020 16:16:16 +0500 Sarosh Arif wrote: > + if get_hugepages(path) != pages: > + print("Unable to reserve required pages. The pages reserved are:") > + global SHOW_HUGEPAGES > + SHOW_HUGEPAGES = True Please don't add global's to this script. The script is close to being clean according to pylint, and globals are considered bad style and shouldn't be used. I would just exit if huge pages could not be setup. The script should leave it up to the user to do another query about status if they care about what the result is.