[dpdk-dev] [v2 PATCH] usertools: show an error message if unable to reserve requested hugepages

Stephen Hemminger stephen at networkplumber.org
Thu Dec 17 19:15:52 CET 2020


On Thu, 17 Dec 2020 16:16:16 +0500
Sarosh Arif <sarosh.arif at emumba.com> 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.


More information about the dev mailing list