DPDK patches and discussions
 help / color / mirror / Atom feed
From: Conor Walsh <conor.walsh@intel.com>
To: jerinj@marvell.com, stephen@networkplumber.org,
	bernard.iremonger@intel.com, konstantin.ananyev@intel.com,
	vladimir.medvedkin@intel.com, anatoly.burakov@intel.com,
	john.mcnamara@intel.com, david.marchand@redhat.com
Cc: dev@dpdk.org, Conor Walsh <conor.walsh@intel.com>
Subject: [dpdk-dev] [PATCH v8 5/5] doc/guides/l3_forward: update documentation for FIB
Date: Fri, 16 Apr 2021 17:19:41 +0000	[thread overview]
Message-ID: <20210416171941.346166-6-conor.walsh@intel.com> (raw)
In-Reply-To: <20210416171941.346166-1-conor.walsh@intel.com>

The purpose of this patch is to update the l3fwd user guide to include
the changes proposed in this patchset.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
---
 doc/guides/rel_notes/release_21_05.rst  |  5 +++
 doc/guides/sample_app_ug/l3_forward.rst | 50 ++++++++++++++++++-------
 2 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst
index 2e3bf5c95a..7f558ed1c5 100644
--- a/doc/guides/rel_notes/release_21_05.rst
+++ b/doc/guides/rel_notes/release_21_05.rst
@@ -174,6 +174,11 @@ New Features
   * Added command to display Rx queue used descriptor count.
     ``show port (port_id) rxq (queue_id) desc used count``
 
+* **Added support for the FIB lookup method in the l3fwd example app.**
+
+  Previously the l3fwd sample app only supported LPM and EM lookup methods,
+  the app now supports the Forwarding Information Base (FIB) lookup method.
+
 
 Removed Items
 -------------
diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst
index e7875f8dcd..9263a6d942 100644
--- a/doc/guides/sample_app_ug/l3_forward.rst
+++ b/doc/guides/sample_app_ug/l3_forward.rst
@@ -11,7 +11,7 @@ The application performs L3 forwarding.
 Overview
 --------
 
-The application demonstrates the use of the hash and LPM libraries in the DPDK
+The application demonstrates the use of the hash, LPM and FIB libraries in DPDK
 to implement packet forwarding using poll or event mode PMDs for packet I/O.
 The initialization and run-time paths are very similar to those of the
 :doc:`l2_forward_real_virtual` and :doc:`l2_forward_event`.
@@ -22,7 +22,7 @@ decision is made based on information read from the input packet.
 Eventdev can optionally use S/W or H/W (if supported by platform) scheduler
 implementation for packet I/O based on run time parameters.
 
-The lookup method is either hash-based or LPM-based and is selected at run time. When the selected lookup method is hash-based,
+The lookup method is hash-based, LPM-based or FIB-based and is selected at run time. When the selected lookup method is hash-based,
 a hash object is used to emulate the flow classification stage.
 The hash object is used in correlation with a flow table to map each input packet to its flow at runtime.
 
@@ -30,14 +30,14 @@ The hash lookup key is represented by a DiffServ 5-tuple composed of the followi
 Source IP Address, Destination IP Address, Protocol, Source Port and Destination Port.
 The ID of the output interface for the input packet is read from the identified flow table entry.
 The set of flows used by the application is statically configured and loaded into the hash at initialization time.
-When the selected lookup method is LPM based, an LPM object is used to emulate the forwarding stage for IPv4 packets.
-The LPM object is used as the routing table to identify the next hop for each input packet at runtime.
+When the selected lookup method is LPM or FIB based, an LPM or FIB object is used to emulate the forwarding stage for IPv4 packets.
+The LPM or FIB object is used as the routing table to identify the next hop for each input packet at runtime.
 
-The LPM lookup key is represented by the Destination IP Address field read from the input packet.
-The ID of the output interface for the input packet is the next hop returned by the LPM lookup.
-The set of LPM rules used by the application is statically configured and loaded into the LPM object at initialization time.
+The LPM and FIB lookup keys are represented by the Destination IP Address field read from the input packet.
+The ID of the output interface for the input packet is the next hop returned by the LPM or FIB lookup.
+The set of LPM and FIB rules used by the application is statically configured and loaded into the LPM or FIB object at initialization time.
 
-In the sample application, hash-based forwarding supports IPv4 and IPv6. LPM-based forwarding supports IPv4 only.
+In the sample application, hash-based and FIB-based forwarding supports both IPv4 and IPv6. LPM-based forwarding supports IPv4 only.
 
 Compiling the Application
 -------------------------
@@ -53,8 +53,7 @@ The application has a number of command line options::
 
     ./dpdk-l3fwd [EAL options] -- -p PORTMASK
                              [-P]
-                             [-E]
-                             [-L]
+                             [--lookup LOOKUP_METHOD]
                              --config(port,queue,lcore)[,(port,queue,lcore)]
                              [--eth-dest=X,MM:MM:MM:MM:MM:MM]
                              [--enable-jumbo [--max-pkt-len PKTLEN]]
@@ -66,6 +65,8 @@ The application has a number of command line options::
                              [--mode]
                              [--eventq-sched]
                              [--event-eth-rxqs]
+                             [-E]
+                             [-L]
 
 Where,
 
@@ -74,9 +75,7 @@ Where,
 * ``-P:`` Optional, sets all ports to promiscuous mode so that packets are accepted regardless of the packet's Ethernet MAC destination address.
   Without this option, only packets with the Ethernet MAC destination address set to the Ethernet address of the port are accepted.
 
-* ``-E:`` Optional, enable exact match.
-
-* ``-L:`` Optional, enable longest prefix match.
+* ``--lookup:`` Optional, Select the lookup method. Accepted options ``em`` (Exact Match), ``lpm`` (Longest Prefix Match), ``fib`` (Forwarding Information Base). Default is ``lpm``.
 
 * ``--config (port,queue,lcore)[,(port,queue,lcore)]:`` Determines which queues from which ports are mapped to which cores.
 
@@ -102,6 +101,10 @@ Where,
 
 * ``--event-eth-rxqs:`` Optional, Number of ethernet RX queues per device. Only valid if --mode=eventdev.
 
+* ``-E:`` Optional, enable exact match, legacy flag please use ``--lookup=em`` instead.
+
+* ``-L:`` Optional, enable longest prefix match, legacy flag please use ``--lookup=lpm`` instead.
+
 
 For example, consider a dual processor socket platform with 8 physical cores, where cores 0-7 and 16-23 appear on socket 0,
 while cores 8-15 and 24-31 appear on socket 1.
@@ -290,6 +293,19 @@ The LPM object is created and loaded with the pre-configured entries read from a
     }
     #endif
 
+FIB Initialization
+~~~~~~~~~~~~~~~~~~
+
+The FIB object is created and loaded with the pre-configured entries read from
+a global array. The abridged code snippet below shows the FIB initialization
+for IPv4, the full setup function including the IPv6 setup can be seen in
+the app code.
+
+.. literalinclude:: ../../../examples/l3fwd/l3fwd_fib.c
+    :language: c
+    :start-after: Function to setup fib.
+    :end-before: Create the fib IPv6 table.
+
 Packet Forwarding for Hash-based Lookups
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -380,6 +396,14 @@ for LPM-based lookups is done by the get_ipv4_dst_port() function below:
         return ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop) == 0)? next_hop : portid);
     }
 
+Packet Forwarding for FIB-based Lookups
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The FIB library was designed to process multiple packets at once, it does not
+have separate functions for single and bulk lookups. ``rte_fib_lookup_bulk``
+is used for IPv4 lookups and ``rte_fib6_lookup_bulk`` for IPv6.
+Various examples of these functions being used can be found in the sample app code.
+
 Eventdev Driver Initialization
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Eventdev driver initialization is same as L2 forwarding eventdev application.
-- 
2.25.1


  parent reply	other threads:[~2021-04-16 17:20 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 12:15 [dpdk-dev] [PATCH 0/5] examples/l3fwd: add FIB lookup method to l3fwd Conor Walsh
2021-02-18 12:15 ` [dpdk-dev] [PATCH 1/5] examples/l3fwd: fix LPM IPv6 subnets Conor Walsh
2021-02-18 12:15 ` [dpdk-dev] [PATCH 2/5] examples/l3fwd: move l3fwd routes to common header Conor Walsh
2021-02-18 12:15 ` [dpdk-dev] [PATCH 3/5] examples/l3fwd: add FIB infrastructure Conor Walsh
2021-02-18 12:15 ` [dpdk-dev] [PATCH 4/5] examples/l3fwd: implement FIB lookup method Conor Walsh
2021-02-18 12:15 ` [dpdk-dev] [PATCH 5/5] doc/guides/l3_forward: update documentation for FIB Conor Walsh
2021-02-18 15:20 ` [dpdk-dev] [PATCH v2 0/5] examples/l3fwd: add FIB lookup method to l3fwd Conor Walsh
2021-02-18 15:20   ` [dpdk-dev] [PATCH v2 1/5] examples/l3fwd: fix LPM IPv6 subnets Conor Walsh
2021-02-18 15:20   ` [dpdk-dev] [PATCH v2 2/5] examples/l3fwd: move l3fwd routes to common header Conor Walsh
2021-02-18 15:20   ` [dpdk-dev] [PATCH v2 3/5] examples/l3fwd: add FIB infrastructure Conor Walsh
2021-02-18 15:20   ` [dpdk-dev] [PATCH v2 4/5] examples/l3fwd: implement FIB lookup method Conor Walsh
2021-02-18 15:20   ` [dpdk-dev] [PATCH v2 5/5] doc/guides/l3_forward: update documentation for FIB Conor Walsh
2021-02-19 15:09   ` [dpdk-dev] [PATCH v3 0/5] examples/l3fwd: add FIB lookup method to l3fwd Conor Walsh
2021-02-19 15:09     ` [dpdk-dev] [PATCH v3 1/5] examples/l3fwd: fix LPM IPv6 subnets Conor Walsh
2021-03-08 10:41       ` Medvedkin, Vladimir
2021-02-19 15:09     ` [dpdk-dev] [PATCH v3 2/5] examples/l3fwd: move l3fwd routes to common header Conor Walsh
2021-03-02 16:20       ` Ananyev, Konstantin
2021-03-08 10:42       ` Medvedkin, Vladimir
2021-02-19 15:09     ` [dpdk-dev] [PATCH v3 3/5] examples/l3fwd: add FIB infrastructure Conor Walsh
2021-03-02 16:22       ` Ananyev, Konstantin
2021-03-03 11:36       ` Burakov, Anatoly
2021-03-08 15:13         ` Walsh, Conor
2021-03-08 10:42       ` Medvedkin, Vladimir
2021-02-19 15:09     ` [dpdk-dev] [PATCH v3 4/5] examples/l3fwd: implement FIB lookup method Conor Walsh
2021-03-02 16:21       ` Ananyev, Konstantin
2021-03-03 11:52       ` Burakov, Anatoly
2021-03-08 15:35         ` Walsh, Conor
2021-03-08 10:43       ` Medvedkin, Vladimir
2021-03-08 17:20         ` Walsh, Conor
2021-02-19 15:09     ` [dpdk-dev] [PATCH v3 5/5] doc/guides/l3_forward: update documentation for FIB Conor Walsh
2021-03-11 12:01     ` [dpdk-dev] [PATCH v4 0/5] examples/l3fwd: add FIB lookup method to l3fwd Conor Walsh
2021-03-11 12:01       ` [dpdk-dev] [PATCH v4 1/5] examples/l3fwd: fix LPM IPv6 subnets Conor Walsh
2021-03-11 12:01       ` [dpdk-dev] [PATCH v4 2/5] examples/l3fwd: move l3fwd routes to common header Conor Walsh
2021-03-11 12:01       ` [dpdk-dev] [PATCH v4 3/5] examples/l3fwd: add FIB infrastructure Conor Walsh
2021-03-11 12:01       ` [dpdk-dev] [PATCH v4 4/5] examples/l3fwd: implement FIB lookup method Conor Walsh
2021-03-12 18:56         ` Medvedkin, Vladimir
2021-03-15 10:21           ` Walsh, Conor
2021-03-11 12:01       ` [dpdk-dev] [PATCH v4 5/5] doc/guides/l3_forward: update documentation for FIB Conor Walsh
2021-03-15 11:34       ` [dpdk-dev] [PATCH v5 0/5] examples/l3fwd: add FIB lookup method to l3fwd Conor Walsh
2021-03-15 11:34         ` [dpdk-dev] [PATCH v5 1/5] examples/l3fwd: fix LPM IPv6 subnets Conor Walsh
2021-03-15 11:34         ` [dpdk-dev] [PATCH v5 2/5] examples/l3fwd: move l3fwd routes to common header Conor Walsh
2021-03-15 11:34         ` [dpdk-dev] [PATCH v5 3/5] examples/l3fwd: add FIB infrastructure Conor Walsh
2021-04-01 11:20           ` Burakov, Anatoly
2021-04-01 12:59             ` Walsh, Conor
2021-03-15 11:34         ` [dpdk-dev] [PATCH v5 4/5] examples/l3fwd: implement FIB lookup method Conor Walsh
2021-03-16 18:46           ` Medvedkin, Vladimir
2021-03-15 11:34         ` [dpdk-dev] [PATCH v5 5/5] doc/guides/l3_forward: update documentation for FIB Conor Walsh
2021-03-18 19:45           ` Mcnamara, John
2021-04-02 10:52         ` [dpdk-dev] [PATCH v6 0/5] examples/l3fwd: add FIB lookup method to l3fwd Conor Walsh
2021-04-02 10:52           ` [dpdk-dev] [PATCH v6 1/5] examples/l3fwd: fix LPM IPv6 subnets Conor Walsh
2021-04-02 10:52           ` [dpdk-dev] [PATCH v6 2/5] examples/l3fwd: move l3fwd routes to common header Conor Walsh
2021-04-02 10:52           ` [dpdk-dev] [PATCH v6 3/5] examples/l3fwd: add FIB infrastructure Conor Walsh
2021-04-02 16:34             ` Burakov, Anatoly
2021-04-06 11:05               ` Walsh, Conor
2021-04-02 10:52           ` [dpdk-dev] [PATCH v6 4/5] examples/l3fwd: implement FIB lookup method Conor Walsh
2021-04-02 10:52           ` [dpdk-dev] [PATCH v6 5/5] doc/guides/l3_forward: update documentation for FIB Conor Walsh
2021-04-06 11:11           ` [dpdk-dev] [PATCH v7 0/5] examples/l3fwd: add FIB lookup method to l3fwd Conor Walsh
2021-04-06 11:11             ` [dpdk-dev] [PATCH v7 1/5] examples/l3fwd: fix LPM IPv6 subnets Conor Walsh
2021-04-14 20:59               ` David Marchand
2021-04-15  8:44                 ` Walsh, Conor
2021-04-15 14:31                   ` David Marchand
2021-04-15 15:18                     ` Walsh, Conor
2021-04-06 11:11             ` [dpdk-dev] [PATCH v7 2/5] examples/l3fwd: move l3fwd routes to common header Conor Walsh
2021-04-15 14:38               ` David Marchand
2021-04-06 11:11             ` [dpdk-dev] [PATCH v7 3/5] examples/l3fwd: add FIB infrastructure Conor Walsh
2021-04-06 11:11             ` [dpdk-dev] [PATCH v7 4/5] examples/l3fwd: implement FIB lookup method Conor Walsh
2021-04-15 14:42               ` David Marchand
2021-04-06 11:11             ` [dpdk-dev] [PATCH v7 5/5] doc/guides/l3_forward: update documentation for FIB Conor Walsh
2021-04-15 14:43               ` David Marchand
2021-04-15 14:59               ` David Marchand
2021-04-16 17:19             ` [dpdk-dev] [PATCH v8 0/5] examples/l3fwd: add FIB lookup method to l3fwd Conor Walsh
2021-04-16 17:19               ` [dpdk-dev] [PATCH v8 1/5] examples/l3fwd: fix LPM IPv6 subnets Conor Walsh
2021-04-16 17:19               ` [dpdk-dev] [PATCH v8 2/5] examples/l3fwd: move l3fwd routes to common header Conor Walsh
2021-04-16 17:19               ` [dpdk-dev] [PATCH v8 3/5] examples/l3fwd: add FIB infrastructure Conor Walsh
2021-04-16 17:19               ` [dpdk-dev] [PATCH v8 4/5] examples/l3fwd: implement FIB lookup method Conor Walsh
2021-04-16 17:19               ` Conor Walsh [this message]
2021-04-20 18:28               ` [dpdk-dev] [PATCH v8 0/5] examples/l3fwd: add FIB lookup method to l3fwd Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210416171941.346166-6-conor.walsh@intel.com \
    --to=conor.walsh@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=john.mcnamara@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=vladimir.medvedkin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).