[v9,0/9] net/tap: fix RSS (BPF) support

Message ID 20240426155125.125910-1-stephen@networkplumber.org (mailing list archive)
Headers
Series net/tap: fix RSS (BPF) support |

Message

Stephen Hemminger April 26, 2024, 3:48 p.m. UTC
  The support of doing RSS for rte_flow_action was a cool idea
but it has been broken for several releases of DPDK as the
kernel and BPF infrastructure changed.

This series cleans up the BPF program, implements several
features that were never completed in the original code
and changes to use the current BPF toolchain.

The result should be easier to read and maintain. I do not
intend to support backporting this to stable releases due
to lack of demand and dealing with older distros.

v9 - rebase and keep max queues at 16

Stephen Hemminger (9):
  net/tap: do not duplicate fd's
  net/tap: remove unused fields
  net/tap: validate and setup parameters for BPF RSS
  net/tap: do not build flow support if header is out of date
  net/tap: rewrite the RSS BPF program
  net/tap: use libbpf to load new BPF program
  net/tap: remove no longer used files
  doc: update documentation of TAP PMD
  net/tap: simplify the internal structure

 .gitignore                            |    3 -
 doc/guides/linux_gsg/sys_reqs.rst     |    3 +
 doc/guides/nics/tap.rst               |  274 ++--
 drivers/net/tap/bpf/Makefile          |   19 -
 drivers/net/tap/bpf/README            |   38 +
 drivers/net/tap/bpf/bpf_api.h         |  276 ----
 drivers/net/tap/bpf/bpf_elf.h         |   53 -
 drivers/net/tap/bpf/bpf_extract.py    |   86 --
 drivers/net/tap/bpf/meson.build       |  107 ++
 drivers/net/tap/bpf/tap_bpf_program.c |  255 ----
 drivers/net/tap/bpf/tap_rss.c         |  267 ++++
 drivers/net/tap/meson.build           |   42 +-
 drivers/net/tap/rte_eth_tap.c         |  267 ++--
 drivers/net/tap/rte_eth_tap.h         |   32 +-
 drivers/net/tap/tap_bpf.h             |  121 --
 drivers/net/tap/tap_bpf_api.c         |  190 ---
 drivers/net/tap/tap_bpf_insns.h       | 1743 -------------------------
 drivers/net/tap/tap_flow.c            |  559 +++-----
 drivers/net/tap/tap_flow.h            |   17 +-
 drivers/net/tap/tap_intr.c            |    7 +-
 drivers/net/tap/tap_rss.h             |   21 +-
 drivers/net/tap/tap_tcmsgs.h          |    4 +-
 22 files changed, 833 insertions(+), 3551 deletions(-)
 delete mode 100644 drivers/net/tap/bpf/Makefile
 create mode 100644 drivers/net/tap/bpf/README
 delete mode 100644 drivers/net/tap/bpf/bpf_api.h
 delete mode 100644 drivers/net/tap/bpf/bpf_elf.h
 delete mode 100644 drivers/net/tap/bpf/bpf_extract.py
 create mode 100644 drivers/net/tap/bpf/meson.build
 delete mode 100644 drivers/net/tap/bpf/tap_bpf_program.c
 create mode 100644 drivers/net/tap/bpf/tap_rss.c
 delete mode 100644 drivers/net/tap/tap_bpf.h
 delete mode 100644 drivers/net/tap/tap_bpf_api.c
 delete mode 100644 drivers/net/tap/tap_bpf_insns.h
  

Comments

Ferruh Yigit May 1, 2024, 11:18 a.m. UTC | #1
On 4/26/2024 4:48 PM, Stephen Hemminger wrote:
> The support of doing RSS for rte_flow_action was a cool idea
> but it has been broken for several releases of DPDK as the
> kernel and BPF infrastructure changed.
> 
> This series cleans up the BPF program, implements several
> features that were never completed in the original code
> and changes to use the current BPF toolchain.
> 
> The result should be easier to read and maintain. I do not
> intend to support backporting this to stable releases due
> to lack of demand and dealing with older distros.
> 
> v9 - rebase and keep max queues at 16
> 
> Stephen Hemminger (9):
>   net/tap: do not duplicate fd's
>   net/tap: remove unused fields
>   net/tap: validate and setup parameters for BPF RSS
>   net/tap: do not build flow support if header is out of date
>   net/tap: rewrite the RSS BPF program
>   net/tap: use libbpf to load new BPF program
>   net/tap: remove no longer used files
>   doc: update documentation of TAP PMD
>   net/tap: simplify the internal structure
>

Thanks for reviving tap eBPF support, I am for merging this set (as
early as possible).

But I have two concerns,
1. Build environment header file dependencies and external library
dependency version changed. Not sure if this will impact users.
What do you think at least to update release notes to notify users?

2. We need this to be tested, either by users or test teams. I will
bring the issue in next release status meeting to see if we have anyone
testing tap eBPF support.

Thanks,
ferruh
  
Stephen Hemminger May 1, 2024, 3:41 p.m. UTC | #2
On Wed, 1 May 2024 12:18:16 +0100
Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> Thanks for reviving tap eBPF support, I am for merging this set (as
> early as possible).
> 
> But I have two concerns,
> 1. Build environment header file dependencies and external library
> dependency version changed. Not sure if this will impact users.
> What do you think at least to update release notes to notify users?

Added a short note in release notes. 

> 
> 2. We need this to be tested, either by users or test teams. I will
> bring the issue in next release status meeting to see if we have anyone
> testing tap eBPF support.

Agreed. I ended up doing lots of manual tests. That is how it was
discovered that > 1 flow rule never worked with TAP.

There is a bigger issue here. There is no basic test suite for
PMD's. I see lots of differences creeping in with statistics etc.

And there is no test suite for rte_flow. Lots of untested code paths
and driver differences.  Testing actual flows is hard, but basic
functional tests should be possible. Like:
   - try all possible flow rules and actions
   - make sure that any supported flow rule accepts a valid parameter.
     and for those supported flow rules pass invalid data (like queue > nrx queue).
   - make sure validate and create work the same.
   - make sure that validate doesn't actually create state in hw/sw.
     should be possible to validate same rule 10,000 times without leaks blowing up.