DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v6 2/8] doc: fix the requirements and building of TAP flow
Date: Fri,  5 Apr 2024 14:14:54 -0700	[thread overview]
Message-ID: <20240405211745.699697-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20240405211745.699697-1-stephen@networkplumber.org>

The build process for TAP eBPF RSS is now changed, so documentation
needs to be updated.

Since kernel 4.19 is the oldest current LTS supported kernel,
the TAP documentation can be simplified. Any complaints about
flow not working means the kernel is out of scope of current DPDK.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/linux_gsg/sys_reqs.rst |  3 +
 doc/guides/nics/tap.rst           | 95 ++++++++-----------------------
 2 files changed, 28 insertions(+), 70 deletions(-)

diff --git a/doc/guides/linux_gsg/sys_reqs.rst b/doc/guides/linux_gsg/sys_reqs.rst
index 13be715933..0254568517 100644
--- a/doc/guides/linux_gsg/sys_reqs.rst
+++ b/doc/guides/linux_gsg/sys_reqs.rst
@@ -101,6 +101,9 @@ Running DPDK Applications
 
 To run a DPDK application, some customization may be required on the target machine.
 
+.. _linux_gsg_kernel_version:
+
+
 System Software
 ~~~~~~~~~~~~~~~
 
diff --git a/doc/guides/nics/tap.rst b/doc/guides/nics/tap.rst
index d4f45c02a1..dcfefba567 100644
--- a/doc/guides/nics/tap.rst
+++ b/doc/guides/nics/tap.rst
@@ -103,13 +103,8 @@ options. Default interface name is ``dtunX``, where X stands for unique id.
 Flow API support
 ----------------
 
-The tap PMD supports major flow API pattern items and actions, when running on
-linux kernels above 4.2 ("Flower" classifier required).
-The kernel support can be checked with this command::
 
-   zcat /proc/config.gz | ( grep 'CLS_FLOWER=' || echo 'not supported' ) |
-   tee -a /dev/stderr | grep -q '=m' &&
-   lsmod | ( grep cls_flower || echo 'try modprobe cls_flower' )
+The tap PMD supports major flow API pattern items and actions, when running on a supported Linux version. See :ref:`linux_gsg_kernel_version`.
 
 Supported items:
 
@@ -123,7 +118,7 @@ Supported actions:
 - DROP
 - QUEUE
 - PASSTHRU
-- RSS (requires kernel 4.9)
+- RSS (requires clang, libbpf, and bpftool)
 
 It is generally not possible to provide a "last" item. However, if the "last"
 item, once masked, is identical to the masked spec, then it is supported.
@@ -229,80 +224,40 @@ load commands at startup in command line or Lua script in pktgen.
 
 RSS specifics
 -------------
-Packet distribution in TAP is done by the kernel which has a default
-distribution. This feature is adding RSS distribution based on eBPF code.
-The default eBPF code calculates RSS hash based on Toeplitz algorithm for
-a fixed RSS key. It is calculated on fixed packet offsets. For IPv4 and IPv6 it
-is calculated over src/dst addresses (8 or 32 bytes for IPv4 or IPv6
-respectively) and src/dst TCP/UDP ports (4 bytes).
+The default packet distribution in TAP without flow rules is done by the
+kernel which has a default flow based distribution.
+When flow rules are used to distribute packets across a set of queues
+an eBPF program is used to calculate the RSS based on Toeplitz algorithm for
+with the given key.
 
-The RSS algorithm is written in file ``tap_bpf_program.c`` which
-does not take part in TAP PMD compilation. Instead this file is compiled
-in advance to eBPF object file. The eBPF object file is then parsed and
-translated into eBPF byte code in the format of C arrays of eBPF
-instructions. The C array of eBPF instructions is part of TAP PMD tree and
-is taking part in TAP PMD compilation. At run time the C arrays are uploaded to
-the kernel via BPF system calls and the RSS hash is calculated by the
-kernel.
+The hash is calculated for IPv4 and IPv6, over src/dst addresses
+(8 or 32 bytes for IPv4 or IPv6 respectively) and
+optionally the src/dst TCP/UDP ports (4 bytes).
 
-It is possible to support different RSS hash algorithms by updating file
-``tap_bpf_program.c``  In order to add a new RSS hash algorithm follow these
-steps:
-
-#. Write the new RSS implementation in file ``tap_bpf_program.c``
-
-   BPF programs which are uploaded to the kernel correspond to
-   C functions under different ELF sections.
-
-#. Install ``LLVM`` library and ``clang`` compiler versions 3.7 and above
-
-#. Use make to compile  `tap_bpf_program.c`` via ``LLVM`` into an object file
-   and extract the resulting instructions into ``tap_bpf_insn.h``::
-
-    cd bpf; make
-
-#. Recompile the TAP PMD.
-
-The C arrays are uploaded to the kernel using BPF system calls.
-
-``tc`` (traffic control) is a well known user space utility program used to
-configure the Linux kernel packet scheduler. It is usually packaged as
-part of the ``iproute2`` package.
-Since commit 11c39b5e9 ("tc: add eBPF support to f_bpf") ``tc`` can be used
-to uploads eBPF code to the kernel and can be patched in order to print the
-C arrays of eBPF instructions just before calling the BPF system call.
-Please refer to ``iproute2`` package file ``lib/bpf.c`` function
-``bpf_prog_load()``.
-
-An example utility for eBPF instruction generation in the format of C arrays will
-be added in next releases
+The RSS algorithm is written in file ``tap_rss.c`` which is compiled with
+clang and then turned into a skeleton header file with bpftool.
+The skeleton header file is then compiled into the tap driver.
 
 TAP reports on supported RSS functions as part of dev_infos_get callback:
 ``RTE_ETH_RSS_IP``, ``RTE_ETH_RSS_UDP`` and ``RTE_ETH_RSS_TCP``.
-**Known limitation:** TAP supports all of the above hash functions together
-and not in partial combinations.
+
+**Known limitation:** TAP supports only these functions, it is not possible
+to be more fine grained. For example, selecting only IPv4 and not IPV6
+to be hashed is not possible.
 
 Systems supporting flow API
 ---------------------------
 
-- "tc flower" classifier requires linux kernel above 4.2
-- eBPF/RSS requires linux kernel above 4.9
-
-+--------------------+-----------------------+
-| RH7.3              | No flow rule support  |
-+--------------------+-----------------------+
-| RH7.4              | No RSS action support |
-+--------------------+-----------------------+
-| RH7.5              | No RSS action support |
-+--------------------+-----------------------+
-| SLES 15,           | No limitation         |
-| kernel 4.12        |                       |
-+--------------------+-----------------------+
-| Azure Ubuntu 16.04,| No limitation         |
-| kernel 4.13        |                       |
-+--------------------+-----------------------+
+- Any system which meets the current DPDK kernel requirements should
+  be able to support the flow API.
+
+- Supporting eBPF/RSS requires ``bpftool`` and ``libbpf``.
 
 Limitations
 -----------
 
 * Rx/Tx must have the same number of queues.
+
+* The kernel will distribute packets across all queues.
+  If using flow API then add a default match and action to force a different
+  behavior.
-- 
2.43.0


  parent reply	other threads:[~2024-04-05 21:18 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30  3:46 [RFC 0/2] net/tap RSS BPF rewrite Stephen Hemminger
2024-01-30  3:46 ` [RFC 1/2] tap: stop "vendoring" linux bpf headers Stephen Hemminger
2024-01-30  3:46 ` [RFC 2/2] tap: rework BPF handling Stephen Hemminger
2024-02-07 22:11 ` [PATCH v2 0/7] net/tap: RSS using BPF overhaul Stephen Hemminger
2024-02-07 22:11   ` [PATCH v2 1/7] net/tap: remove unused RSS hash types Stephen Hemminger
2024-02-07 22:11   ` [PATCH v2 2/7] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-02-07 22:11   ` [PATCH v2 3/7] net/tap: stop "vendoring" linux bpf headers Stephen Hemminger
2024-02-07 22:11   ` [PATCH v2 4/7] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-02-07 22:11   ` [PATCH v2 5/7] net/tap: use libbpf to load new " Stephen Hemminger
2024-02-07 22:11   ` [PATCH v2 6/7] net/tap: remove no longer used files Stephen Hemminger
2024-02-07 22:11   ` [PATCH v2 7/7] MAINTAINERS: add maintainer for TAP device Stephen Hemminger
2024-02-08  7:01     ` Morten Brørup
2024-02-08 17:41 ` [PATCH v3 0/7] net/tap: RSS using BPF overhaul Stephen Hemminger
2024-02-08 17:41   ` [PATCH v3 1/7] net/tap: remove unused RSS hash types Stephen Hemminger
2024-02-08 17:41   ` [PATCH v3 2/7] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-02-08 17:41   ` [PATCH v3 3/7] tap: stop "vendoring" linux bpf headers Stephen Hemminger
2024-02-08 17:41   ` [PATCH v3 4/7] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-02-08 17:41   ` [PATCH v3 5/7] net/tap: use libbpf to load new " Stephen Hemminger
2024-02-08 18:02     ` Stephen Hemminger
2024-02-08 17:41   ` [PATCH v3 6/7] net/tap: remove no longer used files Stephen Hemminger
2024-02-08 17:41   ` [PATCH v3 7/7] MAINTAINERS: add maintainer for TAP device Stephen Hemminger
2024-02-08 19:05 ` [PATCH v4 0/7] net/tap: queue flow action RSS using BPF redo Stephen Hemminger
2024-02-08 19:05   ` [PATCH v4 1/7] net/tap: remove unused RSS hash types Stephen Hemminger
2024-02-08 19:05   ` [PATCH v4 2/7] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-02-08 19:05   ` [PATCH v4 3/7] tap: stop "vendoring" linux bpf headers Stephen Hemminger
2024-02-08 19:05   ` [PATCH v4 4/7] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-02-10  0:54     ` Ferruh Yigit
2024-02-10  2:09       ` Stephen Hemminger
2024-02-28 17:27         ` Ferruh Yigit
2024-02-29 23:39           ` Stephen Hemminger
2024-02-08 19:05   ` [PATCH v4 5/7] net/tap: use libbpf to load new " Stephen Hemminger
2024-02-08 20:39     ` Stephen Hemminger
2024-02-08 19:05   ` [PATCH v4 6/7] net/tap: remove no longer used files Stephen Hemminger
2024-02-08 19:05   ` [PATCH v4 7/7] MAINTAINERS: add maintainer for TAP device Stephen Hemminger
2024-02-12 16:47   ` [PATCH v4 0/7] net/tap: queue flow action RSS using BPF redo Stephen Hemminger
2024-04-02 17:12 ` [PATCH v5 0/8] net/tap: cleanups and fix BPF flow Stephen Hemminger
2024-04-02 17:12   ` [PATCH v5 1/8] net/tap: do not duplicate fd's Stephen Hemminger
2024-04-02 17:12   ` [PATCH v5 2/8] doc: fix the requirements and building of TAP flow Stephen Hemminger
2024-04-02 17:12   ` [PATCH v5 3/8] net/tap: remove unused RSS hash types Stephen Hemminger
2024-04-02 17:12   ` [PATCH v5 4/8] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-04-02 17:12   ` [PATCH v5 5/8] net/tap: stop "vendoring" linux bpf headers Stephen Hemminger
2024-04-02 17:12   ` [PATCH v5 6/8] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-04-02 17:12   ` [PATCH v5 7/8] net/tap: use libbpf to load new " Stephen Hemminger
2024-04-03 11:50     ` Luca Boccassi
2024-04-03 14:53       ` Stephen Hemminger
2024-04-03 15:55       ` Stephen Hemminger
2024-04-03 21:19         ` Luca Boccassi
2024-04-03 23:41           ` Stephen Hemminger
2024-04-04  0:49             ` Luca Boccassi
2024-04-04 15:51               ` Stephen Hemminger
2024-04-04 16:12                 ` Luca Boccassi
2024-04-04 15:30           ` Stephen Hemminger
2024-04-04 16:11             ` Luca Boccassi
2024-04-02 17:12   ` [PATCH v5 8/8] net/tap: remove no longer used files Stephen Hemminger
2024-04-02 20:43     ` Stephen Hemminger
2024-04-05 21:14 ` [PATCH v6 0/8] net/tap: cleanup and fix BPF flow support Stephen Hemminger
2024-04-05 21:14   ` [PATCH v6 1/8] net/tap: do not duplicate fd's Stephen Hemminger
2024-04-05 21:14   ` Stephen Hemminger [this message]
2024-04-05 21:14   ` [PATCH v6 3/8] net/tap: remove unused fields Stephen Hemminger
2024-04-05 21:14   ` [PATCH v6 4/8] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-04-05 21:14   ` [PATCH v6 5/8] net/tap: stop "vendoring" linux bpf headers Stephen Hemminger
2024-04-05 21:14   ` [PATCH v6 6/8] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-04-05 21:14   ` [PATCH v6 7/8] net/tap: use libbpf to load new " Stephen Hemminger
2024-04-05 21:15   ` [PATCH v6 8/8] net/tap: remove no longer used files Stephen Hemminger
2024-04-08 21:18 ` [PATCH v7 0/8] net/tap: cleanups and fix BPF support Stephen Hemminger
2024-04-08 21:18   ` [PATCH v7 1/8] net/tap: do not duplicate fd's Stephen Hemminger
2024-04-08 21:18   ` [PATCH v7 2/8] net/tap: remove unused fields Stephen Hemminger
2024-04-08 21:18   ` [PATCH v7 3/8] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-04-08 21:18   ` [PATCH v7 4/8] net/tap: do not build flow support if header is out of date Stephen Hemminger
2024-04-08 21:18   ` [PATCH v7 5/8] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-04-08 21:18   ` [PATCH v7 6/8] net/tap: use libbpf to load new " Stephen Hemminger
2024-04-08 21:18   ` [PATCH v7 7/8] net/tap: remove no longer used files Stephen Hemminger
2024-04-08 21:18   ` [PATCH v7 8/8] doc: update documentation of TAP PMD Stephen Hemminger
2024-04-09  3:40 ` [PATCH v8 0/8] net/tap: cleanups and fix BPF support Stephen Hemminger
2024-04-09  3:40   ` [PATCH v8 1/8] net/tap: do not duplicate fd's Stephen Hemminger
2024-04-09  3:40   ` [PATCH v8 2/8] net/tap: remove unused fields Stephen Hemminger
2024-04-09  3:40   ` [PATCH v8 3/8] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-04-09  3:40   ` [PATCH v8 4/8] net/tap: do not build flow support if header is out of date Stephen Hemminger
2024-04-09  3:40   ` [PATCH v8 5/8] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-04-09  3:40   ` [PATCH v8 6/8] net/tap: use libbpf to load new " Stephen Hemminger
2024-04-09  3:40   ` [PATCH v8 7/8] net/tap: remove no longer used files Stephen Hemminger
2024-04-09  3:40   ` [PATCH v8 8/8] doc: update documentation of TAP PMD Stephen Hemminger
2024-04-26 15:48 ` [PATCH v9 0/9] net/tap: fix RSS (BPF) support Stephen Hemminger
2024-04-26 15:48   ` [PATCH v9 1/9] net/tap: do not duplicate fd's Stephen Hemminger
2024-05-01 11:13     ` Ferruh Yigit
2024-05-01 23:53       ` Stephen Hemminger
2024-04-26 15:48   ` [PATCH v9 2/9] net/tap: remove unused fields Stephen Hemminger
2024-04-26 15:48   ` [PATCH v9 3/9] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-04-26 15:48   ` [PATCH v9 4/9] net/tap: do not build flow support if header is out of date Stephen Hemminger
2024-04-26 15:48   ` [PATCH v9 5/9] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-05-01 11:14     ` Ferruh Yigit
2024-04-26 15:48   ` [PATCH v9 6/9] net/tap: use libbpf to load new " Stephen Hemminger
2024-04-26 15:48   ` [PATCH v9 7/9] net/tap: remove no longer used files Stephen Hemminger
2024-04-26 15:48   ` [PATCH v9 8/9] doc: update documentation of TAP PMD Stephen Hemminger
2024-05-01 12:36     ` Ferruh Yigit
2024-04-26 15:48   ` [PATCH v9 9/9] net/tap: simplify the internal structure Stephen Hemminger
2024-05-01 11:18   ` [PATCH v9 0/9] net/tap: fix RSS (BPF) support Ferruh Yigit
2024-05-01 15:41     ` Stephen Hemminger
2024-05-01 16:11 ` [PATCH v10 0/9] net/tap: fix RSS (BPF) flow support Stephen Hemminger
2024-05-01 16:12   ` [PATCH v10 1/9] net/tap: do not duplicate fd's Stephen Hemminger
2024-05-01 16:12   ` [PATCH v10 2/9] net/tap: remove unused fields Stephen Hemminger
2024-05-01 16:12   ` [PATCH v10 3/9] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-05-01 16:12   ` [PATCH v10 4/9] net/tap: do not build flow support if header is out of date Stephen Hemminger
2024-05-01 16:12   ` [PATCH v10 5/9] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-05-01 16:12   ` [PATCH v10 6/9] net/tap: use libbpf to load new " Stephen Hemminger
2024-05-01 16:12   ` [PATCH v10 7/9] net/tap: remove no longer used files Stephen Hemminger
2024-05-01 16:12   ` [PATCH v10 8/9] net/tap: simplify internals Stephen Hemminger
2024-05-01 16:12   ` [PATCH v10 9/9] net/tap: update documentation Stephen Hemminger
2024-05-02  2:49 ` [PATCH v11 0/9] net/tap fix RSS (BPF) flow support Stephen Hemminger
2024-05-02  2:49   ` [PATCH v11 1/9] net/tap: do not duplicate fd's Stephen Hemminger
2024-05-02  2:49   ` [PATCH v11 2/9] net/tap: remove unused fields Stephen Hemminger
2024-05-02  2:49   ` [PATCH v11 3/9] net/tap: validate and setup parameters for BPF RSS Stephen Hemminger
2024-05-02  2:49   ` [PATCH v11 4/9] net/tap: do not build flow support if header is out of date Stephen Hemminger
2024-05-02  2:49   ` [PATCH v11 5/9] net/tap: rewrite the RSS BPF program Stephen Hemminger
2024-05-02  2:49   ` [PATCH v11 6/9] net/tap: use libbpf to load new " Stephen Hemminger
2024-05-02  2:49   ` [PATCH v11 7/9] net/tap: remove no longer used files Stephen Hemminger
2024-05-02  2:49   ` [PATCH v11 8/9] net/tap: simplify internals Stephen Hemminger
2024-05-02  2:49   ` [PATCH v11 9/9] net/tap: update documentation Stephen Hemminger

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=20240405211745.699697-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /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).