7. Pipe PMD

Pipe PMD constitutes a virtual Ethernet device (named spp_pipe) using rings which the spp_primary allocated.

It is necessary for the DPDK application using spp_pipe to implement it as the secondary process under the spp_primary as the primary process.

Using spp_pipe enables high-speed packet transfer through rings among DPDK applications using spp_pipe and SPP secondary processes such as spp_nfv and spp_vf.

7.1. Using pipe PMD

Create a pipe port by requesting to the spp_primary to use spp_pipe beforehand. There are CLI and REST API to create a pipe port. A ring used for rx transfer and a ring used for tx transfer are specified at a pipe port creation.

For example creating pipe:0 with ring:0 for rx and ring:1 for tx by CLI as follows.

spp > pri; add pipe:0 ring:0 ring:1

The name as the Ethernet device of pipe:N is spp_pipeN. DPDK application which is the secondary process of the spp_primary can get the port id of the device using rte_eth_dev_get_port_by_name.

7.1.1. Requirement of DPDK application using spp_pipe

It is necessary to use the common mbuf mempool of the SPP processes.

#define PKTMBUF_POOL_NAME "Mproc_pktmbuf_pool"

struct rte_mempool *mbuf_pool;

mbuf_pool = rte_mempool_lookup(PKTBBUF_POOL_NAME);

7.2. Use cases

Here are some examples using spp_pipe.

Note

A ring allocated by the spp_primary assumes it is single producer and single consumer. It is user responsibility that each ring in the model has single producer and single consumer.

7.2.1. Direct communication between applications

../_images/pipe_usecase_pipe.svg

To create pipe ports by CLI before running applications as follows.

spp > pri; add pipe:0 ring:0 ring:1
spp > pri; add pipe:1 ring:1 ring:0

7.2.2. Fixed application chain using spp_nfv

../_images/pipe_usecase_sfc_nfv.svg

To construct the model by CLI before running applications as follows.

spp > pri; add pipe:0 ring:0 ring:1
spp > pri; add pipe:1 ring:1 ring:2
spp > nfv 1; add ring:0
spp > nfv 1; patch phy:0 ring:0
spp > nfv 1; forward
spp > nfv 2; add ring:2
spp > nfv 2; patch ring:2 phy:1
spp > nfv 2; forward

7.2.3. Service function chaining using spp_vf

../_images/pipe_usecase_sfc_vf.svg

To construct the model by CLI before running applications as follows.

spp > pri; add pipe:0 ring:0 ring:1
spp > pri; add pipe:1 ring:2 ring:3
spp > pri; add pipe:2 ring:4 ring:5
spp > vf 1; component start fwd1 2 forward
spp > vf 1; component start fwd2 3 forward
spp > vf 1; component start fwd3 4 forward
spp > vf 1; component start fwd4 5 forward
spp > vf 1; port add phy:0 rx fwd1
spp > vf 1; port add ring:0 tx fwd1
spp > vf 1; port add ring:1 rx fwd2
spp > vf 1; port add ring:2 tx fwd2
spp > vf 1; port add ring:3 rx fwd3
spp > vf 1; port add ring:4 tx fwd3
spp > vf 1; port add ring:5 rx fwd4
spp > vf 1; port add phy:1 tx fwd4

Since applications are connected not directly but through spp_vf, service chaining can be modified without restarting applications.