libmemif: Jumbo frames data/buffer length fix
[vpp.git] / extras / libmemif / README.md
1 Shared Memory Packet Interface (memif) Library
2 ==============================================
3 ## Introduction
4
5 Shared memory packet interface (memif) provides high performance packet transmit and receive between user application and Vector Packet Processing (VPP) or multiple user applications. Using libmemif, user application can create shared memory interface in master or slave mode and connect to VPP or another application using libmemif. Once the connection is established, user application can receive or transmit packets using libmemif API.
6
7 ![Architecture](docs/architecture.png)
8
9 ## Features
10
11 - [x] Slave mode
12   - [x] Connect to VPP over memif
13   - [x] ICMP responder example app
14 - [x] Transmit/receive packets
15 - [x] Interrupt mode support
16 - [x] File descriptor event polling in libmemif (optional)
17   - [x] Simplify file descriptor event polling (one handler for control and interrupt channel)
18 - [x] Multiple connections
19 - [x] Multiple queues
20   - [x] Multi-thread support
21 - [x] Master mode
22         - [ ] Multiple regions (TODO)
23 - [ ] Performance testing (TODO)
24
25 ## Quickstart
26
27 This setup will run libmemif ICMP responder example app in container. Install [docker](https://docs.docker.com/engine/installation) engine.
28 Useful link: [Docker documentation](https://docs.docker.com/get-started).
29
30 Pull image:
31 ```
32 # docker pull ligato/libmemif-sample-service
33 ```
34
35 Now you should be able to see ligato/libmemif-sample-service image on your local machine (IMAGE ID in this README may be outdated):
36 ```
37 # docker images
38 REPOSITORY                       TAG                 IMAGE ID            CREATED              SIZE
39 ligato/libmemif-sample-service   latest              32ecc2f9d013        About a minute ago   468MB
40 ...
41 ```
42
43 Run container:
44 ```
45 # docker run -it --rm --name icmp-responder --hostname icmp-responder --privileged -v "/run/vpp/:/run/vpp/" ligato/libmemif-sample-service
46 ```
47 Example application will start in debug mode. Output should look like this:
48 ```
49 ICMP_Responder:add_epoll_fd:204: fd 0 added to epoll
50 MEMIF_DEBUG:src/main.c:memif_init:383: app name: ICMP_Responder
51 ICMP_Responder:add_epoll_fd:204: fd 4 added to epoll
52 LIBMEMIF EXAMPLE APP: ICMP_Responder (debug)
53 ==============================
54 libmemif version: 1.0 (debug)
55 memif version: 256
56 commands:
57         help - prints this help
58         exit - exit app
59         conn <index> - create memif (slave-mode)
60         del  <index> - delete memif
61         show - show connection details
62         ip-set <index> <ip-addr> - set interface ip address
63         rx-mode <index> <qid> <polling|interrupt> - set queue rx mode
64 ```
65
66 Continue with [Example setup](examples/ExampleSetup.md) which contains instructions on how to set up conenction between icmpr-epoll example app and VPP-memif.
67
68 #### Next steps
69
70 - [Build instructions](docs/BuildInstructions.md) Instructions on how to build/install libmemif.
71 - [Examples](examples/README.md) More example apps presenting different features.
72 - [Getting started](docs/GettingStarted.md) Introduction to libmemif API. Explaining library usage in custom app.