Managing the network stack

The administration of the EVL network stack is done via the evl-net command line interface from the EVL command set. The general syntax is as follows:

$ evl net --help
usage: evl-net [options]:
-e -i <ifname>                     enable out-of-band port in network interface <ifname>
   -p <pool-size>                  max number of out-of-band socket buffers (0=default)
   -b <buffer-size>                size (in bytes) of out-of-band socket buffer (0=default)
-d -i <ifname>                     disable out-of-band port in network interface <ifname>
-s <ipaddr> -i <ifname>            neighbour solicitation with <ipaddr>, forced via <ifname> if given
-S <ipaddr> -i <ifname>            same as -s, marking ARP entry as permanent
-Q[RrTtosfa] -i <ifname>           query network interface information about <ifname>
-F[<bpf-module.o>] -i <ifname>     install/remove eBPF filter (RX)

Enabling an out-of-band port on a network device

In order for EVL to send and/or receive network traffic via a network interface device, the latter should be enabled as an out-of-band port. This can be done using the -e switch from the evl net command, where -i specifies the network interface to enable as an out-of-band port. In addition, you can fine-tune the number of buffers in the per-device pool maintained by EVL which should be pre-allocated for out-of-band use with the -p switch. The size of this pool depends on the volume of the egress traffic, since EVL consumes those buffers on the transmit path only, the receive buffers are allocated by the NIC drivers instead. You can also set the size (in bytes) of such buffer with the -b switch, which should accomodate for the largest MTU you intend to use with your device.

~# evl net -ei eth1.42 -p 4096

Every buffer in the per-device pool is pre-mapped for DMA operation when the out-of-band port is brought up. Such mapping lasts as long as the port stays enabled. Changing the buffer count or buffer size requires bringing down the port then up again with the appropriate settings (dynamic update is not available for these parameters).

Disabling an out-of-band port on a network device

The converse operation to evl net -ei <interface> is evl net -di <interface>, which brings down an out-of-band port.

~# evl net -di eth1.42

Bringing down a network device automatically dismantles the out-of-band port enabled for it.

Soliciting a peer for out-of-band communication

As explained in this document, EVL can guarantee that egress traffic is sent from the out-of-band stage directly, only if its front caches contain the routing information needed to reach the peers. Otherwise, the outgoing traffic is offloaded to the in-band stage. Both evl -Si <ipaddr> <interface> and evl -si <ipaddr> <interface> call forms issue a solicitation request to a particular peer identified by its IPv4 address, in order to update those caches appropriately. Unlike -s, the -S form makes the gathered information permanent in the ARP front cache, which is likely what you want.

Querying the status and statistics about of an out-of-band port

You can get some statistics about any given port using the evl net -Q[<modifier>] sub-command. <modifier> indicates which particular information you want to obtain, as a terse list of space-separated values. The command outputs all of the available information in verbose format if no modifier is given.

  • R displays the number of packets sent through the port.
  • r displays the number of bytes sent through the port.
  • T displays the number of packets received through the port.
  • t displays the number of bytes received through the port.
  • o displays the out-of-band capability status of the underlying NIC driver the port uses for sending and receiving traffic.
  • s displays the size of a buffer in the per-device pool.
  • f displays the number of free buffers still available in the per-device pool.
  • a displays the overall number of buffers in the per-device pool.
~# evl net -Q -i eth0.42
oob capability: yes
    rx packets: 0
      rx bytes: 0
    tx packets: 0
      tx bytes: 0
      skb size: 4096
      skb free: 2048 / 2048
	  
~# evl net -QoRTf -i eth0.42
1 2092625 137399 2048

The data above only and specifically applies to out-of-band I/O, which is accounted separately from in-band I/O statistics as displayed by ethtool.

Loading an eBPF filter on an out-of-band port

As mentioned in this document, you can load an eBPF program module in order to implement complex selection rules of out-of-band packets. evl -F[<modpath] -i <interface> loads such a program if a module path is given, or removes any module already loaded on the port otherwise.

~# evl net -Fnetrx.o -i eth0.42
[  782.270250] fec 2188000.ethernet eth0: out-of-band eBPF program installed

~# evl net -F -i eth0.42
[  819.919746] fec 2188000.ethernet eth0: out-of-band eBPF program removed

Make sure to append the module path directly after the -F option letter if provided, without any space.