Configuration Example

Getting Started with Napatech Link-Virtualization™ Software

Platform
Napatech SmartNIC
Content Type
Getting Started
Getting Started Guide
Capture Software Version
Link-Virtualization™ Software 4.5

Create a bridge with two SmartNIC physical ports and 2 virtual ports.

About this task

This describes a basic OVS configuration example using a single bridge connecting two SmartNIC physical ports and 2 virtual ports.

Before you begin

Make sure that you have completed the steps in OVS-DPDK Initialization.

Procedure

  1. Create a bridge named br0.
    ovs-vsctl --if-exists del-br br0
    ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
  2. Add ports to the bridge.
    ovs-vsctl add-port br0 dpdk0 -- set interface dpdk0 type=dpdk \
      options:dpdk-devargs=class=eth,mac=<xx:xx:xx:xx:xx:xx>
    ovs-vsctl add-port br0 dpdk1 -- set interface dpdk1 type=dpdk \
      options:dpdk-devargs=class=eth,mac=<xx:xx:xx:xx:xx:xx>
    
    ovs-vsctl add-port br0 dpdkvp0 -- set int dpdkvp0 type=dpdk \ 
      options:"dpdk-devargs=0000:<XX:XX>.0,representor=[4]"
    ovs-vsctl add-port br0 dpdkvp1 -- set int dpdkvp1 type=dpdk \
      options:"dpdk-devargs=0000:<XX:XX>.0,representor=[5]"
    where:

    XX:XX is the PCI bus ID, found with the command lspci | grep Napatech.

    xx:xx:xx:xx:xx:xx is the MAC of the SmartNIC physical ports.

    For more information see Reading MAC Addresses of the SmartNIC.

    • Ports with names of the form dpdk<n> refer to a physical port on the SmartNIC
    • Ports with names of the form dpdkvp<n> refer to a virtual port used for attaching VMs
  3. Display the bridge configuration for br0.
    # ovs-ofctl show br0
    OFPT_FEATURES_REPLY (xid=0x2): dpid:0000000de9068c34
    n_tables:254, n_buffers:0
    capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
    actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
     1(dpdk0): addr:00:0d:e9:06:8c:34
         config:     0
         state:      0
         current:    1GB-FD
         speed: 1000 Mbps now, 0 Mbps max
     2(dpdk1): addr:00:0d:e9:06:8c:35
         config:     0
         state:      0
         current:    1GB-FD
         speed: 1000 Mbps now, 0 Mbps max
     3(dpdkvp0): addr:00:00:00:00:00:00
         config:     0
         state:      0
         speed: 0 Mbps now, 0 Mbps max
     4(dpdkvp1): addr:00:00:00:00:00:00
         config:     0
         state:      0
         speed: 0 Mbps now, 0 Mbps max
     LOCAL(br0): addr:00:0d:e9:06:8c:34
         config:     PORT_DOWN
         state:      LINK_DOWN
         current:    10MB-FD COPPER
         speed: 10 Mbps now, 0 Mbps max
    OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0
  4. View the flow table entries for br0.
    # ovs-ofctl dump-flows br0
     cookie=0x0, duration=112.697s, table=0, n_packets=0, n_bytes=0, priority=0 actions=NORMAL

    By default, the bridge is created with a flow rule which matches all traffic and has actions=NORMAL therefore the bridge will behave as an ordinary learning bridge.

    Note: When using the NORMAL rule, as with any bridged network, care should be taken to avoid creating bridge loops or broadcast storms. A potential loop is created, for example, if this same configuration is used on a second server, and the two ports of each SmartNIC are connected together. This creates a scenario where OVS receives a broadcast packet on dpdk0 and sends it back out on dpdk1, which is then received on dpdk1 of the downstream switch, which then sends the frame back out on its dpdk0, and so on indefinitely.

Results

OVS configuration is complete and the next step is to start two virtual machines that attach to virtual ports dpdkvp[01] and verify layer 2 connectivity between the two VMs.