numam-dpdk/usertools
Thomas Monjalon 01ae049dda usertools: check 0-division with hugepage size
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 <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2021-03-25 18:04:32 +01:00
..
cpu_layout.py usertools: fix CPU layout script to be PEP8 compliant 2020-11-13 15:40:21 +01:00
dpdk-devbind.py usertools: fix binding built-in kernel driver 2021-02-11 23:23:02 +01:00
dpdk-hugepages.py usertools: check 0-division with hugepage size 2021-03-25 18:04:32 +01:00
dpdk-pmdinfo.py usertools: fix pmdinfo parsing 2020-11-22 22:22:44 +01:00
dpdk-telemetry-client.py usertools: remove unnecessary parens and else 2020-11-22 22:14:12 +01:00
dpdk-telemetry.py usertools: print process name when telemetry connects 2021-03-25 18:00:46 +01:00
meson.build usertools: add huge page setup script 2020-11-22 22:38:03 +01:00