Configuring the Host

Getting Started with OVS Offload Software

Platform
Napatech IPU
Content Type
Getting Started
Capture Software Version
OVS Offload Software 1.0

Use this information to load the virtio drivers and configure the network for the virtio devices on the host.

Before you begin

Make sure that you have:

About this task

Note: The following prompts are used to indicate which part of the system to run the provided commands on.
  • soc: The SoC on the IPU.
  • host: The server where the IPU is installed.

Procedure

  1. On the host, load the virtio_net driver if it is not loaded.
    Check whether the virtio_net driver is loaded.
    host# lsmod | grep virtio
    An output example:
    virtio_net             65536  0
    net_failover           24576  1 virtio_net
    If virtio_net is not listed, run the following commands.
    host# modprobe virtio
    host# modprobe virtio_pci
    host# modprobe virtio_net
  2. Check the virtio devices.
    host# ip -br link
    After the virtio_net driver is loaded, the virtio devices are recognized as Linux kernel network devices. This is an output example with the bare-metal FPGA image on the IPU.
    …
    enp134s0  UP 00:e8:ca:11:be:80 <BROADCAST,MULTICAST,UP,LOWER_UP>
    enp135s0  UP 00:e8:ca:11:be:7f <BROADCAST,MULTICAST,UP,LOWER_UP>
    enp136s0  UP 00:e8:ca:11:be:7e <BROADCAST,MULTICAST,UP,LOWER_UP>
    enp137s0  UP 00:e8:ca:11:be:7d <BROADCAST,MULTICAST,UP,LOWER_UP>
    …
    …
    enp146s0  UP 00:e8:ca:11:be:74 <BROADCAST,MULTICAST,UP,LOWER_UP>
    enp147s0  UP 00:e8:ca:11:be:73 <BROADCAST,MULTICAST,UP,LOWER_UP>
    enp148s0  UP 00:e8:ca:11:be:72 <BROADCAST,MULTICAST,UP,LOWER_UP>
    enp149s0  UP 00:e8:ca:11:be:71 <BROADCAST,MULTICAST,UP,LOWER_UP>
    Network device names may vary depending on the kernel version and network configuration. Physical function 0 has a MAC address ending with :80, and physical function 1 has a MAC address ending with :7f. In this case, enp134s0 and enp135s0, respectively.
  3. Create namespaces.
    Namespaces can be used to isolate network configuration for each physical function / virtual function and simplify OVS testing. To create 2 namespaces on the same IPv4 subnet, run the following commands
    host# ip netns add pf0
    host# ip link set enp134s0 netns pf0 
    host# ip netns exec pf0 ip addr add 192.168.1.10/24 dev enp134s0 
    host# ip netns exec pf0 ip link set enp134s0 up
    
    host# ip netns add pf1
    host# ip link set enp135s0 netns pf1 
    host# ip netns exec pf1 ip addr add 192.168.1.11/24 dev enp135s0 
    host# ip netns exec pf1 ip link set enp135s0 up
    Two namespaces are configured as follows:
    Namespace Kernel net device name IP address
    pf0 enp134s0 192.168.1.10
    pf1 enp135s0 192.168.1.11
  4. Check IP addresses.
    Run the following command to check the IP address of the PF0 interface.
    host# ip netns exec pf0 ip addr
    An output example:
    1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    8: enp134s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether 00:e8:ca:11:be:80 brd ff:ff:ff:ff:ff:ff
        inet 192.168.1.10/24 scope global enp134s0
           valid_lft forever preferred_lft forever
        inet6 fe80::2e8:caff:fe11:be80/64 scope link
           valid_lft forever preferred_lft forever
    This command is to check the IP address of the PF1 interface.
    host# ip netns exec pf1 ip addr
    An output example:
    1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    9: enp135s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether 00:e8:ca:11:be:7f brd ff:ff:ff:ff:ff:ff
        inet 192.168.1.11/24 scope global enp135s0
           valid_lft forever preferred_lft forever
        inet6 fe80::2e8:caff:fe11:be7f/64 scope link
           valid_lft forever preferred_lft forever
  5. Ping from one namespace to another to test the connectivity between two namespaces.
    For example:
    host# ip netns exec pf0 ping 192.168.1.11
    host# ip netns exec pf1 ping 192.168.1.10