summaryrefslogtreecommitdiffstats
path: root/extras/libmemif/examples/examples_doc.rst
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2021-10-12 14:00:25 +0200
committerDave Wallace <dwallacelf@gmail.com>2021-10-13 15:30:03 +0000
commit8acc5ee9079d0b03229a72e72a5308e7de0a359a (patch)
treeba3e5789abc2c3cd4edd9806fc44991c45d705f1 /extras/libmemif/examples/examples_doc.rst
parent87e90830b8931b4c55526bf7cb5a148a10df061f (diff)
libmemif: docs md->rst
Type: improvement Change-Id: Ibebd2d47a4268189f11601d004073e4858548f25 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'extras/libmemif/examples/examples_doc.rst')
-rw-r--r--extras/libmemif/examples/examples_doc.rst42
1 files changed, 42 insertions, 0 deletions
diff --git a/extras/libmemif/examples/examples_doc.rst b/extras/libmemif/examples/examples_doc.rst
new file mode 100644
index 00000000000..3fb8c3127f8
--- /dev/null
+++ b/extras/libmemif/examples/examples_doc.rst
@@ -0,0 +1,42 @@
+.. _libmemif_examples_doc:
+
+Examples
+========
+
+After build, root folder will contain scripts linking binary examples
+with library (same name as example apps). These scripts can be executed
+to run example apps without installing the library. Example apps
+binaries can be found in *libs* folder. To run binaries directly, make
+sure that libmemif library is installed.
+
+Run in container
+----------------
+
+``ligato/libmemif-sample-service`` image contains built and installed
+libmemf. To run different examples, override docker CMD to start
+container in bash:
+
+::
+
+ # docker run -it --entrypoint=/bin/bash -i --rm --name icmp-responder --hostname icmp-responder --privileged -v "/run/vpp/:/run/vpp/" ligato/libmemif-sample-service
+
+Current WORKDIR is set to root repository directory. Example apps can be
+run from this directory (a script linking binary with library), or
+browse to ``./.libs`` folder and execute binary directly.
+
+* ``extras/libmemif/examples/icmp_responder``
+
+Simplest implementation. Event polling is handled by libmemif.
+Single memif connection in slave mode is created (id 0). Use Ctrl + C to exit app.
+Memif receive mode: interrupt.
+
+* ``extras/libmemif/examples/icmp_responder-epoll`` (run in container by default)
+
+Supports multiple connections and master mode. User can create/delete connections, set ip addresses,
+print connection information. :ref:`libmemif_example_setup_doc` contains instructions on basic
+connection use cases setups. Memif receive mode: interrupt. App provides functionality to disable
+interrupts for specified queue/s for testing purposes. Polling mode is not implemented in this example.
+
+* ``extras/libmemif/examples/icmp_responder-mt``
+
+Multi-thread example, very similar to icmpr-epoll. Packets are handled in threads assigned to specific queues. Slave mode only. Memif receive mode: polling (memif_rx_poll function), interrupt (memif_rx_interrupt function). Receive modes differ per queue.