Rate This Document
Findability
Accuracy
Completeness
Readability

One-Click Configuration

Gazelle can be configured in one-click mode or manual mode. This section describes how to configure Gazelle in one-click mode. This mode applies only to Huawei HiSilicon Hi1822 NICs. If you use other NICs, see the manual configuration method.

You can run the lspci |grep -i net command to query the NIC model.

  1. Check the name of the service network interface and record its MAC address. In this example, the name of the service network interface is enp3s0.
    1
    ip a
    
  2. Use Gazelle to take over the network interface in the 192.168 network segment.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    # Obtain the name of the network interface in the 192.168 network segment and determine the NUMA nodes with NIC affinity.
    eth=`ifconfig | grep -B 1 "192.168" | head -1 | awk -F":" '{print $1}'`
    eth_node=`cat /sys/class/net/${eth}/device/numa_node`
    
    # Disable transparent huge pages and mount huge pages.
    echo never > /sys/kernel/mm/transparent_hugepage/enabled
    hugepagesize=`cat /proc/meminfo | grep Hugepagesize | awk -F" " '{print $2}'`
    mkdir -p /data/hugepages
    mount -t hugetlbfs nodev /data/hugepages
    
    # Determine the number of huge pages to be allocated based on the default huge page size. In this example, allocate four huge pages to the NUMA nodes with NIC affinity in the system.
    echo 4 > /sys/devices/system/node/node${eth_node}/hugepages/hugepages-${hugepagesize}kB/nr_hugepages
    
    Check whether the huge page configuration is successful.
    cat /proc/meminfo | grep Huge
    
    # Bind a network interface to the user mode.
    modprobe vfio enable_unsafe_noiommu_mode=1
    modprobe vfio-pci
    ip link set ${eth} down
    dpdk-devbind -b vfio-pci ${eth}
    

    To change the default huge page size, see 4.