> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/fpp/2.9/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.9/installation/multinode-direct-nic.md).

# Deploy Fast Path Provider on multiple nodes using direct NIC assignment

This document describes the prerequisites and steps for a multi-node deployment of Fast Path Provider (FPP) using direct NIC assignment. There is also a tutorial for [SRIOV Networks as uplinks](https://docs.cennso.com/components/fpp/2.9/installation/multinode-sriov.md).

## Prerequisites

- [Common prerequisites](https://docs.cennso.com/components/fpp/2.9/installation/installation-common.md)
- NIC firmware updated to the latest version [in the case of Intel e810 cards](#intel-e810-support) for direct NIC assignment in VPPSwitch

Terminology used in the installation document:

- VPPSwitch - Amberd pod in the `node` mode, which acts as a virtual switch on each Data Plane node
- Uplink - network interface, virtual or physical, which is used by VPPSwitch to communicate inside the cluster and create a VXLAN mesh to interconnect workload CNFs between nodes

### Supported NICs

The following Network Interface Cards are supported using this installation guide:

- **Intel E810**, vendor ID: **8086**, device ID: **1593**, model name: **E810-XXVDA4**

### Intel E810 support

Check [the Intel DDP package section](https://docs.cennso.com/components/fpp/2.9/configuration/data-plane-node-config.md#update-the-intel-ddp-package) of the Data Plane configuration guide for more details.

## Steps

1. Enable image download

   In order to be able to pull FPP images from a private registry, you may need to configure imagePullSecrets for the FPP service account. One possibility is to create `/tmp/pullsecret.yaml` file, adding proper base64-encoded docker auth information, so that later it can be used to augment the FPP deployment:

   ```yaml
   ---
   apiVersion: v1
   kind: Secret
   type: kubernetes.io/dockerconfigjson
   metadata:
      name: image-secret
   data:
      .dockerconfigjson: ...
   ---
   apiVersion: v1
   kind: ServiceAccount
   metadata:
      name: fpp-sa
   imagePullSecrets:
   - name: image-secret
   ```

   Create this secret in `{fpp-namespace}`:

   ```bash
   kubectl apply -n {fpp-namespace} -f /tmp/pullsecret.yaml
   ```

1. Label the nodes

   For the FPP DaemonSet to actually start, each node in the cluster using FPP must get a label, for example `fpp-manager.cennso.com/vppswitch-uplinks=2`:

   ```bash
   kubectl label node node1 node2 node3 fpp-manager.cennso.com/vppswitch-uplinks=2
   kubectl label node node1 node2 node3 fpp-manager.cennso.com/vppswitch=""
   ```

   `fpp-manager.cennso.com/vppswitch=""` is used for workloads' nodeSelector to select the nodes where VPPSwitch is available.

1. Configure direct NIC binding to use them as uplinks or external network interfaces

   FPP Manager can use Physical Functions (PFs) as uplinks. This means that no SRIOV operator is needed and NIC PCI IDs can be passed directly in the FPP deployment. The Helm-based deployment uses `directNICMappings`, which configures PCI IDs through environment variables and enables direct access to the system firmware directory (`/lib/firmware`). Check which card should be used by FPP, for example by running `lshw -c network -businfo`:

   ```bash

   Bus info          Device           Class          Description
   =============================================================
   pci@0000:51:00.0  eno1             network        Ethernet Controller 10G X550T
   pci@0000:51:00.1  eno2             network        Ethernet Controller 10G X550T
   pci@0000:8a:00.0  ens6f0           network        Ethernet Controller E810-C for SFP
   pci@0000:8a:00.1  ens6f1           network        Ethernet Controller E810-C for SFP
   pci@0000:8a:00.2  ens6f2           network        Ethernet Controller E810-C for SFP
   pci@0000:8a:00.3  ens6f3           network        Ethernet Controller E810-C for SFP
   ```

   In this example, `8a:00.1` and `8a:00.3` are used. When using PFs with VPP, use the `vfio-pci` driver. Ensure that no VFs are created on that NICs, in case if SRIOV Network Operator is used this means that SRIOV Custom Resources using these NICs need to be removed (`SriovNetworkNodePolicy` objects). Below is an example command that disables VFs on the machine:

   ```bash
   echo 0 > /sys/class/net/ens6f1/device/sriov_numvfs
   echo 0 > /sys/class/net/ens6f3/device/sriov_numvfs
   ```

   After that, you can bind NICs to the vfio driver using an init container in the FPP node deployment. For example:

   ```yaml
   additionalInitContainers:
   - name: bind-vfio
     image: travelping/nettools:1.12.0
     command:
     - /bin/sh
     - -c
     - |
        if [ "$(basename $(readlink /sys/bus/pci/devices/0000:8a:00.1/driver))" != vfio-pci ]; then
           echo '8086 1593' >/sys/bus/pci/drivers/vfio-pci/new_id
           echo '0000:8a:00.1' > '/sys/bus/pci/devices/0000:8a:00.1/driver/unbind'
           echo '0000:8a:00.1' > /sys/bus/pci/drivers/vfio-pci/bind
           echo '0000:8a:00.3' > '/sys/bus/pci/devices/0000:8a:00.1/driver/unbind'
           echo '0000:8a:00.3' > /sys/bus/pci/drivers/vfio-pci/bind
        fi
     securityContext:
       privileged: true
     volumeMounts:
     - name: hostsys
       mountPath: /sys
     resources:
       limits:
         cpu: 100m
         memory: 100Mi
   additionalVolumes:
   - name: hostsys
     hostPath:
       path: /sys
   ```

   Every time the FPP node DaemonSet starts, the proper NIC binding is configured, so the method is reboot-safe.

   The `8086 1593` is a vendor and device ID of the NIC. You can check it by running `lspci -nn -s <PCI-ID>`. Example:

   ```bash
   # lspci -nn -s 8a:00.1
   8a:00.1 Ethernet controller [0200]: Intel Corporation Ethernet Controller E810-C for SFP [8086:1593] (rev 02)
   ```

   After performing these steps, NICs is ready to be used by FPP Manager. The following chart configuration enables FPP DaemonSet to use NICs and assign IPs:

   ```yaml
   directNICMappings:
      uplink:
      - "0000:8a:00.1"
      - "0000:8a:00.3"
   ```

   The above settings are translated into environmental variables in the FPP DaemonSet:

   ```yaml
   - name: MAPPING_NIC
     value: uplink
   - name: PCIDEVICE_NIC
     value: 0000:8a:00.1,0000:8a:00.3
   ```

   The following DPDK interfaces are configured in `startup.conf`:

   ```sh
   dpdk {

      dev 0000:8a:00.1 {
         name uplink0
         num-rx-queues 4
         num-tx-queues 4
         num-rx-desc 2048
         num-tx-desc 2048
      }

      dev 0000:8a:00.3 {
         name uplink1
         num-rx-queues 4
         num-tx-queues 4
         num-rx-desc 2048
         num-tx-desc 2048
      }
   }
   ```

   `uplink0` and `uplink1` can be used in VPPConfig `beforeCommands` and `afterCommands` sections. FPP Manager creates these VPPInterface objects corresponding to these NICs to be used as uplinks or as external network interfaces if according to the external network prefixes defined in `VPPConfig` (interfaces not matching any interface name prefixes are used as uplinks).

   In this configuration example, the FPP operator identifies all defined uplink interfaces, bonds them, and creates a VLAN subinterface with an assigned IP.

   You can use `spec.uplinkConfig.ips` in VPPConfig to assign the IPs to the uplink interface. `spec.uplinkConfig.vlanId` allows you to create a VLAN subinterface for uplink.

   Use `spec.externalNetworkConfig.vlanId` to create a VLAN subinterface that provides external connectivity for FPP-based workloads. For example, to connect a VLAN interface to FPP network ID 1, set `spec.externalNetworkConfig.ifacePrefix` to `uplink-bond` (automatically created for bonded DPDK interfaces).

   ```yaml
   directNICMappings:
      uplink:
      - "0000:8a:00.1"
      - "0000:8a:00.3"

   vppConfigs:
   - nodeName: wk-1234.dev.cennso.net
     spec:
       uplinkConfig:
         bondMode: LACP
         ips:
         - 10.0.40.1/24
         vlanId: 1000

       externalNetworkConfig:
        - ifacePrefix: uplink-bond
          bridgeDomain: 1
          vlanId: 1001
   ```

1. Install the [FPP chart](https://docs.cennso.com/components/fpp/2.9/installation/chart-configuration.generated.md) in the [`node` mode](https://docs.cennso.com/components/fpp/2.9/installation/deployment-types.md) using the following chart configuration:

   - Configure the number of buffers per NUMA for optimal performance

      ```yaml
      buffersPerNuma: 512000
      ```

   - Configure image pull secret to be able to download the `fpp-manager` image from a private registry

      ```yaml
      imagePullSecrets:
      - name: image-secret
      ```

      Instead of using image pull secret, you can use a preconfigured service account:

      ```yaml
      serviceAccount: fpp-sa
      ```

   - Specify an optional log level:

      ```yaml
      # available values: trace, debug, info, error
      logLevel: "debug"
      ```

      To enable more verbose logging, VPP API calls (on the internal intermediate VPPLink level) and Kubernetes controller events (Create/Update/Delete) can be logged:

      ```yaml
      vpp:
        traceAPICalls: true
        logLevel: "trace"
      ```

   - Specify the node selector for the subset of nodes to deploy FPP DaemonSet:

      ```yaml
      nodeSelector:
        fpp-manager.cennso.com/vppswitch-uplinks: "2"
      ```

   - Configure pod resources:

      ```yaml
      resources:
        cpu: "10"
        hugepages-2Mi: 9Gi
        memory: 2Gi
      ```

   - Include **directNICMappings** and **vppConfigs** section from the above point

      This configures the networking and bond with VLAN configuration.

   - Include **additionalInitContainers** and **additionalVolumes** from the above point

      This will configure the VFIO NIC binding in a reboot-safe manner.

## Verification

After deploying FPP, you can verify whether a VPPInterface VLAN object with your desired **vlanId** was created in the Kubernetes API and whether its status is ready.

Run the following command to do it:

```bash
kubectl get -n fpp vppinterfaces.fpp-manager.cennso.com nic-node-wk-1234.dev.cennso.net-uplink-bond-extnet-vlan -oyaml
```

As a response, you get a VPPInterface object. See the example:

```yaml
apiVersion: fpp-manager.cennso.com/v1alpha1
kind: VPPInterface
metadata:
   creationTimestamp: "2025-02-10T13:39:39Z"
   finalizers:
   - fpp-manager.cennso.com/vpp-interface-finalizer
   generation: 1
   labels:
      fpp-manager.cennso.com/plumbing-node: wk-1234.dev.cennso.net
      fpp-manager.cennso.com/plumbing-physifrole: vlan
      fpp-manager.cennso.com/plumbing-physiftype: extnet
      fpp-manager.cennso.com/slice: default
   name: nic-node-wk-1234.dev.cennso.net-uplink-bond-extnet-vlan
   namespace: fpp
   resourceVersion: "25120"
   uid: 66f64312-9e23-4265-b90a-91735a296e7a
spec:
   bridgeDomain: 1
   ifName: uplink-bond.1001
   type: extnet
   vlan:
      ID: 1001
      parentIfName: uplink-bond
status:
   memberCount: 0
   ready: true
   swIfIndex: 5
   vppName: uplink-bond.1001
```

You can also verify the interface creation by running the following command in the FPP DeamonSet pods:

```bash
vppctl -s /run/vppswitch/cli.sock show interfaces
```

In the resulting list, look for your interface by its ID (as in **{INTERFACE_NAME}.ID**):

```
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count
local0                            0     down          0/0/0/0
uplink-bond                       3      up          9000/0/0/0     rx packets                  5109
                                                                    rx bytes                  628353
                                                                    drops                       1028
                                                                    ip6                           23
uplink-bond.1000                  4      up          9000/0/0/0
uplink-bond.1001                  5      up           0/0/0/0
uplink0                           1      up          9000/0/0/0     rx packets                  3059
                                                                    rx bytes                  374219
                                                                    tx packets                    73
                                                                    tx bytes                    9052
                                                                    drops                       2042
uplink1                           2      up          9000/0/0/0     rx packets                  2050
                                                                    rx bytes                  254134
                                                                    tx packets                    77
                                                                    tx bytes                    9548
                                                                    drops                       2039
```
