History log of /dpdk/usertools/dpdk-hugepages.py (Results 1 – 10 of 10)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v24.11, v24.11-rc4, v24.11-rc3, v24.11-rc2, v24.11-rc1
# f63ca249 22-Aug-2024 Anatoly Burakov <anatoly.burakov@intel.com>

usertools/hugepages: update coding style

Update coding style:

- make the code PEP-484 compliant
- add more comments, improve readability, use f-strings everywhere
- address all Python static analys

usertools/hugepages: update coding style

Update coding style:

- make the code PEP-484 compliant
- add more comments, improve readability, use f-strings everywhere
- address all Python static analysis (e.g. mypy, pylint) warnings
- format code with Ruff
- improve error handling
- refactor printing and sysfs/procfs access functions
- sort huge page reservation status output by NUMA node

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Robin Jarry <rjarry@redhat.com>

show more ...


Revision tags: v24.07, v24.07-rc4, v24.07-rc3, v24.07-rc2, v24.07-rc1, v24.03, v24.03-rc4, v24.03-rc3, v24.03-rc2, v24.03-rc1, v23.11, v23.11-rc4, v23.11-rc3, v23.11-rc2, v23.11-rc1, v23.07, v23.07-rc4, v23.07-rc3, v23.07-rc2, v23.07-rc1, v23.03, v23.03-rc4, v23.03-rc3, v23.03-rc2, v23.03-rc1, v22.11, v22.11-rc4, v22.11-rc3
# b41bd046 04-Nov-2022 Thomas Monjalon <thomas@monjalon.net>

usertools/hugepages: show usage if no action specified

Previously, the script was doing nothing if no argument was provided.

If neither show, mount/unmount, clear/reserve are specified,
it is assum

usertools/hugepages: show usage if no action specified

Previously, the script was doing nothing if no argument was provided.

If neither show, mount/unmount, clear/reserve are specified,
it is assumed that the user does not know how to use the script.
So the usage and an error message are printed.
The exit code will be non-zero.
The user will understand something is wrong,
and can recall the script with the option -h to get more information.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>

show more ...


Revision tags: v22.11-rc2, v22.11-rc1, v22.07, v22.07-rc4, v22.07-rc3, v22.07-rc2
# 8d73de6f 24-Jun-2022 Dmitry Kozlyuk <dkozlyuk@nvidia.com>

usertools: add options for hugetlbfs mount point owner

Per mount(8), the previous owner and mode of the mount point
become invisible as long as this filesystem remains mounted.
Because dpdk-hugepage

usertools: add options for hugetlbfs mount point owner

Per mount(8), the previous owner and mode of the mount point
become invisible as long as this filesystem remains mounted.
Because dpdk-hugepages.py must be run as root,
the new owner would be root.
This is undesirable if the hugepage directory is being set up
by the administrator for an unprivileged user.
HugeTLB filesystem has options to set the mount point owner.
Add --user/-U and --group/-G options to apply this when mounting.
The benefit of performing this in dpdk-hugepages.py
is that the user does not need to care about this detail
of mount command operation.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

show more ...


# 31af02ef 24-Jun-2022 Dmitry Kozlyuk <dkozlyuk@nvidia.com>

usertools: add option for hugetlbfs directory

dpdk-hugepages.py had /dev/hugepages hardcoded as the mount point.
It may be desirable to setup hugepage directory at another path,
for example, when us

usertools: add option for hugetlbfs directory

dpdk-hugepages.py had /dev/hugepages hardcoded as the mount point.
It may be desirable to setup hugepage directory at another path,
for example, when using hugepages of multiple sizes in different
directories or when granting different permissions to mount points.
Add --directory/-d option to the script.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

show more ...


Revision tags: v22.07-rc1, v22.03, v22.03-rc4, v22.03-rc3, v22.03-rc2, v22.03-rc1, v21.11, v21.11-rc4, v21.11-rc3, v21.11-rc2, v21.11-rc1, v21.08, v21.08-rc4, v21.08-rc3, v21.08-rc2, v21.08-rc1, v21.05, v21.05-rc4, v21.05-rc3, v21.05-rc2, v21.05-rc1
# defd7f5a 08-Mar-2021 Thomas Monjalon <thomas@monjalon.net>

usertools: show hugepages requested/set on failure

In case the number of requested hugepages cannot be set,
a more detailed error message is printed.
The new message does not mention "reserve" becau

usertools: show hugepages requested/set on failure

In case the number of requested hugepages cannot be set,
a more detailed error message is printed.
The new message does not mention "reserve" because setting
can be reserving or clearing.
The filename and numbers requested/set are printed to ease debugging.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

show more ...


# 01ae049d 21-Mar-2021 Thomas Monjalon <thomas@monjalon.net>

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 t

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>

show more ...


Revision tags: v21.02, v21.02-rc4
# 0b89dbc2 11-Feb-2021 Sarosh Arif <sarosh.arif@emumba.com>

usertools: show valid hugepage sizes if wrong request

If user requests a hugepage size which is not supported by the system,
currently user gets an error message saying that the requested size
is no

usertools: show valid hugepage sizes if wrong request

If user requests a hugepage size which is not supported by the system,
currently user gets an error message saying that the requested size
is not a valid system huge page size. In addition to this if we display
the valid hugepage sizes it will be convenient for the user to request
the right size next time.

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>

show more ...


Revision tags: v21.02-rc3, v21.02-rc2, v21.02-rc1
# b25f0a7d 08-Jan-2021 Sarosh Arif <sarosh.arif@emumba.com>

usertools: show error if unable to reserve hugepages

Sometimes the system is unable to reserve the requested hugepages because
enough space is not available in the RAM. In that case, currently the
s

usertools: show error if unable to reserve hugepages

Sometimes the system is unable to reserve the requested hugepages because
enough space is not available in the RAM. In that case, currently the
script displays no error message hence the user can be under the delusion
that the hugepages requested are all successfully reserved. This patch
displays an error message if the pages reserved are different from the
requested pages.

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>

show more ...


# 2204fecc 02-Dec-2020 David Christensen <drc@linux.vnet.ibm.com>

usertools: show hugepages on POWER systems

The IBM PowerNV systems include NUMA nodes that don't have associated
CPUs or hugepage memory. Here is an example on an IBM AC922 system:

$ lscpu
...
NUM

usertools: show hugepages on POWER systems

The IBM PowerNV systems include NUMA nodes that don't have associated
CPUs or hugepage memory. Here is an example on an IBM AC922 system:

$ lscpu
...
NUMA node0 CPU(s): 0-63
NUMA node8 CPU(s): 64-127
NUMA node252 CPU(s):
...

$ numastat -m
...
Node 0 Node 8 Node 252
--------------- --------------- ---------------
MemTotal 126763.19 130785.06 0.00
MemFree 119513.38 125294.44 0.00
MemUsed 7249.81 5490.62 0.00
...
HugePages_Total 4.00 1734.00 0.00
HugePages_Free 0.00 4.00 0.00
HugePages_Surp 4.00 1730.00 0.00
...

Modify dpdk-hugepages.py to test for the ../hugepages directory before
attempting to parse the hugepage entries.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>

show more ...


Revision tags: v20.11, v20.11-rc5, v20.11-rc4, v20.11-rc3, v20.11-rc2, v20.11-rc1
# 6e1b58fa 09-Sep-2020 Stephen Hemminger <stephen@networkplumber.org>

usertools: add huge page setup script

This is an improved version of the setup of huge pages
bases on earlier DPDK setup.

Differences are:
* autodetects NUMA vs non NUMA
* allows setting diff

usertools: add huge page setup script

This is an improved version of the setup of huge pages
bases on earlier DPDK setup.

Differences are:
* autodetects NUMA vs non NUMA
* allows setting different page sizes
recent kernels support multiple sizes.
* accepts a parameter in bytes (not pages).
* can display current hugepage settings.

Most users will just use --setup argument but if necessary
the steps of clearing old settings and mounting/umounting
can be done individually.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

show more ...