Napatech SmartNIC Configuration

Running Open-Source Libraries and Applications with Napatech SmartNICs

Platform
Napatech SmartNIC
Content Type
Application Note
Capture Software Version
Link™ Capture Software 12.11

Configure Napatech SmartNICs for traffic load distribution.

About this task

This procedure describes a configuration example for the traffic load distribution functionality of Napatech SmartNICs to improves performance running your open-source libraries and applications.
This example has the following hardware configuration:
  • Number of CPU cores: 2 × 4 × hyper-threading = 16
  • NUMA Nodes: 2
  • Only one SmartNIC enabled
Note: In case of libpcap interfaces, the Napatech libpcap devices use a fast segment-based interface by default. It meas that it does not support merging packets between SmartNICs. If you need to enable more than one SmartNIC, you have the following two options:
  • Avoid the need for packet merge between SmartNICs by adding port tests, as described in DN-0449.
  • Set up libpcap devices for packet merge between SmartNICs, as described in DN-0428.

Procedure

  1. Edit the /opt/napatech3/config/ntservice.ini file to define the number of host buffers. The number of host buffers must be equal to or larger than the number of the application instances you are planning to run.
    [Adapter0]
    AdapterType=NT200A02_2X100
    
    # Use "lspci | grep Napatech" command to get BusId if in doubt
    BusId=00:0a:00:00
        
    # Define 8 host buffer on NUMA node 0
    # and 8 host buffers on NUMA node 1
    # Define exactly as many host buffers as there are
    # Snort instances – 16 in this example.
    HostBuffersRx=[8,16,0],[8,16,1] #[Number of host buffers, Size(MB), NUMA node]
  2. Stop and restart ntservice after making changes to the ntservice.ini file.
    /opt/napatech3/bin/ntstop.sh
    /opt/napatech3/bin/ntstart.sh
  3. Use the lscpu command to determine the mapping of CPUs to NUMA nodes.
    # lscpu | grep NUMA
    NUMA node(s):          2
    NUMA node0 CPU(s):     0-3,8-11
    NUMA node1 CPU(s):     4-7,12-15
  4. Create a file with the following NTPL example. This example configures 16 streams and their affinity to NUMA nodes.
    Delete=All
    HashMode=Hash5TupleSorted
    Assign[StreamId=(0..15)]=All
    Setup[NUMANode=0]=StreamId==0,1,2,3,8,9,10,11
    Setup[NUMANode=1]=StreamId==4,5,6,7,12,13,14,15
    Apply NTPL using the ntpl tool.
    /opt/napatech/bin/ntpl -f <ntpl_file>
    Note: Each stream appears to libpcap as a device named nt3g<n>, where <n> is the stream ID. 16 streams in this example will appear as nt3g0 - nt3g15.
    This table summarizes your application instances affinity to CPU cores for the various number of your application instances.
    CPU core NUMA Node 0 NUMA Node 1
    0 1 2 3 8 9 10 11 4 5 6 7 12 13 14 15
    Number of app instances 4 0 1 - - - - - - 2 3 - - - - - -
    8 0 1 2 3 - - - - 4 5 6 7 - - - -
    12 0 1 2 3 8 9 - - 4 5 6 7 10 11 - -
    16 0 1 2 3 8 9 10 11 4 5 6 7 12 13 14 15
        Stream numbers