> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/fpp/2.11/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/fpp/2.11/configuration/data-plane-node-config.md).

# Configure the Data Plane node

This tutorial shows how to configure Data Plane nodes to achieve the best performance.

## Enable HugePages

To run Fast Path Provider with the Data Plane Development Kit (DPDK) and physical NICs, you must enable HugePages on the node.

1. You can enable HugePages through `sysfs`, which should be executed early in the boot process:

   ```bash
   sysctl vm.nr_hugepages=6000
   ```

   You can enable HugePages permanently after a node boot through kernel boot options: `hugepagesz=2M hugepages=6000`. To activate these options, add them to, for example, `/etc/default/grub` and run the following command:

   ```bash
   grub-mkconfig -o /boot/grub/grub.cfg
   ```

2. To make grub changes effective, reboot the host.

3. Make sure to allocate 6,000 of 2MB HugePages per node.

4. To verify whether the HugePages were configured properly and are visible in Kubernetes as an allocable resource, run:

   ```bash
   kubectl describe node {NODE_NAME}
   ```

   Sample output:

   ```
   ...
   Capacity:
     cpu:                64
     ephemeral-storage:  1950451200Ki
     hugepages-1Gi:      0
     hugepages-2Mi:      12000Mi
     memory:             131497548Ki
     pods:               250
   Allocatable:
     cpu:                63760m
     ephemeral-storage:  1787549514288
     hugepages-1Gi:      0
     hugepages-2Mi:      12000Mi
     memory:             109498956Ki
     pods:               250
   ...
   ```

## Configure CPU governor

Set CPU frequency scaling to `performance` to always keep the highest available CPU Hz set. These are sample commands to do so in the Ubuntu system:

```bash
sudo apt-get install cpufrequtils
echo 'GOVERNOR="performance"' | sudo tee /etc/default/cpufrequtils
sudo systemctl disable ondemand
```

To check the current CPU scaling governor set, run the following command on node:

```bash
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
```

## Set CPU affinity for system daemons

To better isolate the workload from system processes, set CPU affinity for system daemons:

```bash
cat /etc/systemd/system.conf
```

See the output example:

```
CPUAffinity=30 31 62 63
```

As you can see in the output, the system deamon services are processed on dedicated cores 30-13, 62-63. This means that, for example, `kubelet` run on those cores.

## Define IRQ balance

Configure which CPUs can handle NIC interrupts by defining the banned CPU mask:

```bash
cat /etc/default/irqbalance
```

See the output example:

```
IRQBALANCE_BANNED_CPUS=0x3fffffff,0x3fffffff
```

The `IRQBALANCE_BANNED_CPUS` value defines a CPU mask in hex, specifying which cores are excluded from handling NIC interrupts. In this case,`0x3fffffff,0x3fffffff` bans specific CPU cores, keeping them free for processes like VPP. 

## Configure GRUB

To use DPDK-enabled uplink interfaces, you need GRUB configuration. DPDK driver requires to use IOMMU-enabled platform with the isolation of IOMMU groups - for processor-based (northbridge) PCI root ports and controller hub-based (southbridge) PCI root ports. These are Access Control Service (ACS) capabilities.

1. To enable IOMMU grouping, add the following to boot options:

   ```
   iommu=pt intel_iommu=on pci=realloc pci=assign-busses
   ```

2. To activate those options, add them to, for example, `/etc/default/grub` and run the following command:

   ```bash
   grub-mkconfig -o /boot/grub/grub.cfg
   ```

3. Reboot the host.

4. To see what is the current GRUB config, run:

   ```bash
   cat /proc/cmdline
   ```

5. To check whether the system supports IOMMU grouping, run:

   ```bash
   find /sys/kernel/iommu_groups/ -type l
   ```

   The proper output should look as follows:

   ```
   /sys/kernel/iommu_groups/0/devices/0000:00:00.0
   /sys/kernel/iommu_groups/1/devices/0000:00:02.0
   /sys/kernel/iommu_groups/2/devices/0000:00:14.0
   /sys/kernel/iommu_groups/3/devices/0000:00:16.0
   /sys/kernel/iommu_groups/4/devices/0000:00:19.0
   /sys/kernel/iommu_groups/5/devices/0000:00:1a.0
   /sys/kernel/iommu_groups/6/devices/0000:00:1b.0
   /sys/kernel/iommu_groups/7/devices/0000:00:1c.0
   /sys/kernel/iommu_groups/9/devices/0000:00:1c.1
   /sys/kernel/iommu_groups/10/devices/0000:00:1c.2
   /sys/kernel/iommu_groups/11/devices/0000:02:00.0
   /sys/kernel/iommu_groups/12devices/0000:03:00.0
   /sys/kernel/iommu_groups/13/devices/0000:00:1d.0
   /sys/kernel/iommu_groups/14/devices/0000:00:1f.0
   /sys/kernel/iommu_groups/15/devices/0000:00:1f.2
   ```

   If the platform does not support IOMMU grouping, then the above output would look like the following one:

   ```
   /sys/kernel/iommu_groups/17/devices/0000:00:1f.0
   /sys/kernel/iommu_groups/17/devices/0000:00:1f.2
   /sys/kernel/iommu_groups/17/devices/0000:00:1f.3
   sys/kernel/iommu_groups/18/devices/0000:02:00.0
   /sys/kernel/iommu_groups/18/devices/0000:02:00.1
   /sys/kernel/iommu_groups/18/devices/0000:03:01.0
   /sys/kernel/iommu_groups/18/devices/0000:03:05.0
   /sys/kernel/iommu_groups/18/devices/0000:03:07.0
   /sys/kernel/iommu_groups/18/devices/0000:03:09.0
   /sys/kernel/iommu_groups/18/devices/0000:04:00.0
   /sys/kernel/iommu_groups/18/devices/0000:05:00.0
   /sys/kernel/iommu_groups/18/devices/0000:06:00.0
   /sys/kernel/iommu_groups/18/devices/0000:07:00.0
   /sys/kernel/iommu_groups/19/devices/0000:08:00.0
   /sys/kernel/iommu_groups/19/devices/0000:08:00.1
   ```

### Configuration for VFIO-no-IOMMU platform

When a worker node does not support IOMMU, you can run FPP by disabling IOMMU. Make sure that the following boot options are **not set** in `/proc/cmdline`:

```bash
iommu=pt intel_iommu=on pci=realloc pci=assign-busses
```

For DPDK driver to pick up NIC (PF/VF) on platform that does not support IOMMU, enable unsafe no-iommu mode:

```bash
echo 1 > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode
```

Apply the above setting after each node restart.

To check if the kernel supports no-iommu module, run:

```bash
cat /boot/config-$(uname -r) | grep NOIOMMU
```

The output confirms that the no-iommu module is supported:

```
CONFIG_VFIO_NOIOMMU=y
```

## Configure Kubelet

You can configure Kubelet with strict CPU allocation rules:

```
cpuManagerPolicy: static
reserved-cpus: 30-31,62-63
topologyManagerPolicy: single-numa-node
```

The above configuration enables Kubernetes to assign cores to the workload pods (`cpuManagerPolicy: static`). Do not use cores assigned to systemd daemons (`reserved-cpus: 30-31,62-63`) and also try to fit the pod on a single numa node.

## Update the Intel DDP package

FPP supports Intel E810 NIC cards after updating the Dynamic Device Personalization (DDP) package. Perform the following steps to update the DDP package:

1. Download the DDP package from the [Intel driver page](https://www.intel.com/content/www/us/en/download/19660/intel-ethernet-800-series-telecommunication-comms-dynamic-device-personalization-ddp-package.html), tested with `1.3.37.0` version.
2. Unpack the downloaded zip file and unpack the `ice_comms-1.3.37.0.zip` file located inside.
3. Copy the DDP package file `ice_comms-1.3.37.0.pkg` to `/lib/firmware/intel/ice/ddp/`.
4. In the same directory (`/lib/firmware/intel/ice/ddp`), create symlink `/lib/firmware/intel/ice/ddp/ice.pkg` to point to the file you copied earlier:

   ```bash
   ls -ltr /lib/firmware/intel/ice/ddp/
   ```

   See the output example:

   ```
   total 712
   -rw-r--r-- 1 root root 725428 Sep  1 17:04 ice_comms-1.3.37.0.pkg
   lrwxrwxrwx 1 root root     22 Sep  1 17:04 ice.pkg -> ice_comms-1.3.37.0.pkg
   ```

   The `ice_comms-1.3.37.0.pkg` file is the DDP package file. The `ice.pkg` symlink points to this package, confirming that the file is correct.

5. On the host, run `update-initramfs -c -k $(uname -r)` to update initrd. All PFs must have the same DDP package version.
6. Reboot the node to load the updated DDP package.
7. Check whether the DDP package has been updated.

   ```bash
   dmesg|grep DDP
   ```

   The output confirms that the DDP package was successfully loaded:

   ```
   [   16.685250] ice 0000:8a:00.0: The DDP package was successfully loaded: ICE COMMS Package version 1.3.37.0
   ```
