-System configuration
---------------------
-
-Using the NFP PMD is not different to using other PMDs. Usual steps are:
-
-#. **Configure hugepages:** All major Linux distributions have the hugepages
- functionality enabled by default. By default this allows the system uses for
- working with transparent hugepages. But in this case some hugepages need to
- be created/reserved for use with the DPDK through the hugetlbfs file system.
- First the virtual file system need to be mounted:
-
- .. code-block:: console
-
- mount -t hugetlbfs none /mnt/hugetlbfs
-
- The command uses the common mount point for this file system and it needs to
- be created if necessary.
-
- Configuring hugepages is performed via sysfs:
-
- .. code-block:: console
-
- /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
-
- This sysfs file is used to specify the number of hugepages to reserve.
- For example:
-
- .. code-block:: console
-
- echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
-
- This will reserve 2GB of memory using 1024 2MB hugepages. The file may be
- read to see if the operation was performed correctly:
-
- .. code-block:: console
-
- cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
-
- The number of unused hugepages may also be inspected.
-
- Before executing the DPDK app it should match the value of nr_hugepages.
-
- .. code-block:: console
-
- cat /sys/kernel/mm/hugepages/hugepages-2048kB/free_hugepages
-
- The hugepages reservation should be performed at system initialization and
- it is usual to use a kernel parameter for configuration. If the reservation
- is attempted on a busy system it will likely fail. Reserving memory for
- hugepages may be done adding the following to the grub kernel command line:
-
- .. code-block:: console
-
- default_hugepagesz=1M hugepagesz=2M hugepages=1024
-
- This will reserve 2GBytes of memory using 2Mbytes huge pages.
-
- Finally, for a NUMA system the allocation needs to be made on the correct
- NUMA node. In a DPDK app there is a master core which will (usually) perform
- memory allocation. It is important that some of the hugepages are reserved
- on the NUMA memory node where the network device is attached. This is because
- of a restriction in DPDK by which TX and RX descriptors rings must be created
- on the master code.
-
- Per-node allocation of hugepages may be inspected and controlled using sysfs.
- For example:
-
- .. code-block:: console