doc: replace hugepages commands with dedicated tool
authorThomas Monjalon <thomas@monjalon.net>
Thu, 11 Feb 2021 18:16:59 +0000 (19:16 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 11 Feb 2021 22:26:37 +0000 (23:26 +0100)
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.

Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
doc/guides/cryptodevs/octeontx.rst
doc/guides/cryptodevs/octeontx2.rst
doc/guides/howto/lm_bond_virtio_sriov.rst
doc/guides/howto/lm_virtio_vhost_user.rst
doc/guides/linux_gsg/sys_reqs.rst
doc/guides/nics/build_and_test.rst
doc/guides/nics/mlx4.rst
doc/guides/nics/mlx5.rst
doc/guides/nics/virtio.rst
doc/guides/sample_app_ug/vhost.rst

index d813cb2..a39f3f3 100644 (file)
@@ -107,9 +107,7 @@ applications.
 
 .. code-block:: console
 
 
 .. 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.
 
 Example applications can now be executed with crypto operations offloaded to
 OCTEON TX crypto PMD.
index a648a33..d312eeb 100644 (file)
@@ -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::
 
 
     * 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.
 
 
       Refer to :ref:`linux_gsg_hugepages` for more details.
 
index 16d86d1..3e25480 100644 (file)
@@ -581,9 +581,9 @@ Set up DPDK in the Virtual Machine
    # virtio port is 03
    # vf port is 04
 
    # 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
 
    ifconfig -a
    /root/dpdk/usertools/dpdk-devbind.py --status
index e495ac9..c5c48f1 100644 (file)
@@ -411,9 +411,9 @@ setup_dpdk_virtio_in_vm.sh
    # virtio port is 03
    # virtio port is 04
 
    # 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
 
    ifconfig -a
    /root/dpdk/usertools/dpdk-devbind.py --status
index a05b5bd..4a40121 100644 (file)
@@ -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
 
     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,
 .. note::
 
     Some kernel versions may not allow reserving 1 GB hugepages at run time,
index b47c684..e83dd46 100644 (file)
@@ -64,6 +64,12 @@ This section demonstrates how to setup and run ``testpmd`` in Linux.
 
          Hugepagesize:       2048 kB
 
 
          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
 #. Load ``igb_uio`` or ``vfio-pci`` driver:
 
    .. code-block:: console
index 09cfb5c..9742ddb 100644 (file)
@@ -405,7 +405,7 @@ devices managed by librte_net_mlx4.
 
 #. Request huge pages::
 
 
 #. 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::
 
 
 #. Start testpmd with basic parameters::
 
index d8c9041..7c50497 100644 (file)
@@ -1712,7 +1712,7 @@ ConnectX-4/ConnectX-5/ConnectX-6/BlueField devices managed by librte_net_mlx5.
 
 #. Request huge pages::
 
 
 #. 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::
 
 
 #. Start testpmd with basic parameters::
 
index 518adf4..02e74a6 100644 (file)
@@ -152,7 +152,7 @@ Host2VM communication example
     .. code-block:: console
 
         modprobe uio
     .. 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
 
         modprobe uio_pci_generic
         ./usertools/dpdk-devbind.py -b uio_pci_generic 00:03.0
 
index 15aaff2..09b1b6c 100644 (file)
@@ -188,7 +188,7 @@ Common Issues
 
   .. code-block:: console
 
 
   .. 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.
 
   The command above indicates how many hugepages are free to support QEMU's
   allocation request.