This is the documentation for the 19.02 version. Looking for the documentation of the latest version? Have a look here.

Shared Memory Packet Interfaces (memif)ΒΆ

A Shared Memory Packet Interface (memif) has two components: A socket and an interface. A memif also requires a role, either master or slave. In most TNSR applications, it will be the master and the other endpoint will be a slave. A single socket may only be associated with one role type.

The interface memif socket command requires an identifier number and a filename, both of which must be unique to this socket. For example, to create a socket with an ID of 23, using a socket file of /tmp/memif23.sock, run this command:

tnsr(config)# interface memif socket id 23 filename /tmp/memif23.sock

Next, the interface memif interface command creates a memif object. This command requires its own identifier, and it must be tied to the socket using the same ID from the previous command:

tnsr(config)# interface memif interface 100
tnsr(config-memif)# socket-id 23
tnsr(config-memif)# role master
tnsr(config-memif)# exit

At this point, an interface is available in TNSR. The name of this interface is composed of the socket ID and the interface ID: interface memif<socket id>/<interface id>. In this example with a socket ID of 23 and an interface ID of 100, the full interface name is memif23/100.

For a list of all current memif entries, along with their names and configuration, use the show interface memif command:

tnsr# show interface memif

Socket Id  Filename
---------- --------------------------------------------------
0          /run/vpp/memif.sock
23         /tmp/memif23.sock

memif id: 100
    Memif name: memif23/100
    Interface: memif23/100
    Role: master
    Mode: ethernet
    MAC address: 02:fe:8c:e5:ce:06
    Socket id: 23
    Ring size: 0
    Buffer size: 0
    Admin up: false
    Link up: false