doc: replace hugepages commands with dedicated tool
PATCH 1/1 doc: replace hugepages commands with dedicated tool
The tool dpdk-hugepages.py, added in DPDK 20.11,
is referenced in the guides instead of more complicate commands.
The original Linux commands are kept in linux_gsg/sys_reqs.rst and nics/build_and_test.rst.
--- doc/guides/cryptodevs/octeontx.rst | 4 +--- doc/guides/cryptodevs/octeontx2.rst | 2 +- doc/guides/howto/lm_bond_virtio_sriov.rst | 6 +++--- doc/guides/howto/lm_virtio_vhost_user.rst | 6 +++--- doc/guides/linux_gsg/sys_reqs.rst | 2 ++ doc/guides/nics/build_and_test.rst | 6 ++++++ doc/guides/nics/mlx4.rst | 2 +- doc/guides/nics/mlx5.rst | 2 +- doc/guides/nics/virtio.rst | 2 +- doc/guides/sample_app_ug/vhost.rst | 2 +- 10 files changed, 20 insertions(+), 14 deletions(-)
doc/guides/cryptodevs/octeontx.rst +1 -3
@@ -107,9 +107,7 @@ applications. .. code-block:: console - echo 8 > /sys/kernel/mm/hugepages/hugepages-524288kB/nr_hugepages - mkdir /mnt/huge - mount -t hugetlbfs nodev /mnt/huge + dpdk-hugepages.py --setup 4G --pagesize 512M Example applications can now be executed with crypto operations offloaded to OCTEON TX crypto PMD.
doc/guides/cryptodevs/octeontx2.rst +1 -1
@@ -123,7 +123,7 @@ Another way to bind the VF would be to use the ``dpdk-devbind.py`` script: * Ensure that sufficient huge pages are available for your application:: - echo 8 > /sys/kernel/mm/hugepages/hugepages-524288kB/nr_hugepages + dpdk-hugepages.py --setup 4G --pagesize 512M Refer to :ref:`linux_gsg_hugepages` for more details.
doc/guides/howto/lm_bond_virtio_sriov.rst +3 -3
@@ -581,9 +581,9 @@ Set up DPDK in the Virtual Machine # virtio port is 03 # vf port is 04 - cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages - echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages - cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + /root/dpdk/usertools/dpdk-hugepages.py --show + /root/dpdk/usertools/dpdk-hugepages.py --setup 2G + /root/dpdk/usertools/dpdk-hugepages.py --show ifconfig -a /root/dpdk/usertools/dpdk-devbind.py --status
doc/guides/howto/lm_virtio_vhost_user.rst +3 -3
@@ -411,9 +411,9 @@ setup_dpdk_virtio_in_vm.sh # virtio port is 03 # virtio port is 04 - cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages - echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages - cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + /root/dpdk/usertools/dpdk-hugepages.py --show + /root/dpdk/usertools/dpdk-hugepages.py --setup 2G + /root/dpdk/usertools/dpdk-hugepages.py --show ifconfig -a /root/dpdk/usertools/dpdk-devbind.py --status
doc/guides/linux_gsg/sys_reqs.rst +2 -0
@@ -181,6 +181,8 @@ using a ``nr_hugepages`` file in the ``/sys/devices/`` directory:: echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages +The tool ``dpdk-hugepages.py`` can be used to manage hugepages. + .. note:: Some kernel versions may not allow reserving 1 GB hugepages at run time,
doc/guides/nics/build_and_test.rst +6 -0
@@ -64,6 +64,12 @@ This section demonstrates how to setup and run ``testpmd`` in Linux. Hugepagesize: 2048 kB + Mount and request above can be achieved simply with this tool: + + .. code-block:: console + + dpdk-hugepages.py --setup 2G + #. Load ``igb_uio`` or ``vfio-pci`` driver: .. code-block:: console
doc/guides/nics/mlx4.rst +1 -1
@@ -405,7 +405,7 @@ devices managed by librte_net_mlx4. #. Request huge pages:: - echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages/nr_hugepages + dpdk-hugepages.py --setup 2G #. Start testpmd with basic parameters::
doc/guides/nics/mlx5.rst +1 -1
@@ -1712,7 +1712,7 @@ ConnectX-4/ConnectX-5/ConnectX-6/BlueField devices managed by librte_net_mlx5. #. Request huge pages:: - echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages/nr_hugepages + dpdk-hugepages.py --setup 2G #. Start testpmd with basic parameters::
doc/guides/nics/virtio.rst +1 -1
@@ -152,7 +152,7 @@ Host2VM communication example .. code-block:: console modprobe uio - echo 512 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages + dpdk-hugepages.py --setup 1G modprobe uio_pci_generic ./usertools/dpdk-devbind.py -b uio_pci_generic 00:03.0
doc/guides/sample_app_ug/vhost.rst +1 -1
@@ -188,7 +188,7 @@ Common Issues .. code-block:: console - cat /sys/kernel/mm/hugepages/hugepages-<pagesize>/nr_hugepages + dpdk-hugepages.py --show The command above indicates how many hugepages are free to support QEMU's allocation request.
Signature · 1 line
2.30.0
Quoted 8 lines · On Thu, 11 Feb 2021 19:16:59 +0100 Thomas Monjalon <[email protected]> wrote:
The tool
dpdk-hugepages.py, added in DPDK 20.11,
is referenced in the guides instead of more complicate commands.The original Linux commands are kept in
linux_gsg/sys_reqs.rstandnics/build_and_test.rst.Suggested-by Stephen Hemminger <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>
Looks good.
Thomas Monjalon
Applied11/02/2021 20:07, Stephen Hemminger:
Quoted 6 lines
Quoted 3 lines · On Thu, 11 Feb 2021 19:16:59 +0100 Thomas Monjalon <[email protected]> wrote:
The tool
dpdk-hugepages.py, added in DPDK 20.11,
is referenced in the guides instead of more complicate commands.
Quoted 8 lines
Quoted 5 lines
The original Linux commands are kept in
linux_gsg/sys_reqs.rstandnics/build_and_test.rst.Suggested-by Stephen Hemminger <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>Looks good.
Applied
PS: sorry for applying quickly but I feel there won't be much more review of this patch.
Quoted 54 lines · Thomas Monjalon
The tool
dpdk-hugepages.py, added in DPDK 20.11,
is referenced in the guides instead of more complicate commands.The original Linux commands are kept in
linux_gsg/sys_reqs.rstandnics/build_and_test.rst.Suggested-by Stephen Hemminger <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>--- doc/guides/cryptodevs/octeontx.rst | 4 +--- doc/guides/cryptodevs/octeontx2.rst | 2 +- doc/guides/howto/lm_bond_virtio_sriov.rst | 6 +++--- doc/guides/howto/lm_virtio_vhost_user.rst | 6 +++--- doc/guides/linux_gsg/sys_reqs.rst | 2 ++ doc/guides/nics/build_and_test.rst | 6 ++++++ doc/guides/nics/mlx4.rst | 2 +- doc/guides/nics/mlx5.rst | 2 +- doc/guides/nics/virtio.rst | 2 +- doc/guides/sample_app_ug/vhost.rst | 2 +- 10 files changed, 20 insertions(+), 14 deletions(-)doc/guides/cryptodevs/octeontx.rst +1
-3@@ -107,9 +107,7 @@ applications. .. code-block:: console - echo 8 > /sys/kernel/mm/hugepages/hugepages-524288kB/nr_hugepages - mkdir /mnt/huge - mount -t hugetlbfs nodev /mnt/huge + dpdk-hugepages.py --setup 4G --pagesize 512M Example applications can now be executed with crypto operations offloaded to OCTEON TX crypto PMD.doc/guides/cryptodevs/octeontx2.rst +1
-1@@ -123,7 +123,7 @@ Another way to bind the VF would be to use the ``dpdk-devbind.py`` script: * Ensure that sufficient huge pages are available for your application:: - echo 8 > /sys/kernel/mm/hugepages/hugepages-524288kB/nr_hugepages + dpdk-hugepages.py --setup 4G --pagesize 512M Refer to :ref:`linux_gsg_hugepages` for more details.doc/guides/howto/lm_bond_virtio_sriov.rst +0
-0
doc/guides/howto/lm_bond_virtio_sriov.rst Set up DPDK in the Virtual Machine · line 586
Quoted 9 lines
doc/guides/howto/lm_bond_virtio_sriov.rst +3
-3@@ -581,9 +581,9 @@ Set up DPDK in the Virtual Machine # virtio port is 03 # vf port is 04 - cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages - echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages - cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + /root/dpdk/usertools/dpdk-hugepages.py --show + /root/dpdk/usertools/dpdk-hugepages.py --setup 2G + /root/dpdk/usertools/dpdk-hugepages.py --show
Wouldn't be better to use 'dpdk-hugepages.py' only, or perhaps './usertools/dpdk-hugepages.py' but not full path. The dpdk path, '/root/dpdk/', assumption can be missleading.
12/02/2021 12:55, Ferruh Yigit:
Quoted 7 lines · Thomas Monjalon
Quoted 6 lines
doc/guides/howto/lm_bond_virtio_sriov.rst +0
-0@@ -581,9 +581,9 @@ Set up DPDK in the Virtual Machine # virtio port is 03 # vf port is 04
Quoted 10 lines
doc/guides/howto/lm_bond_virtio_sriov.rst Set up DPDK in the Virtual Machine · line 586
Quoted 6 lines
doc/guides/howto/lm_bond_virtio_sriov.rst +3
-3- cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages - echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages - cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages + /root/dpdk/usertools/dpdk-hugepages.py --show + /root/dpdk/usertools/dpdk-hugepages.py --setup 2G + /root/dpdk/usertools/dpdk-hugepages.py --showWouldn't be better to use '
dpdk-hugepages.py' only, or perhaps './usertools/dpdk-hugepages.py' but not full path. The dpdk path, '/root/dpdk/', assumption can be missleading.
Using this fixed path is consistent with the rest of this howto. Maybe you would prefer a rewrite of the howto?