mbox series

[net-next,v3,0/8] Introduce conntrack offloading to the nfp driver

Message ID 20210602115952.17591-1-simon.horman@corigine.com (mailing list archive)
Headers show
Series Introduce conntrack offloading to the nfp driver | expand

Message

Simon Horman June 2, 2021, 11:59 a.m. UTC
Louis Peens says:

This is the first in a series of patches to offload conntrack
to the nfp. The approach followed is to flatten out three
different flow rules into a single offloaded flow. The three
different flows are:

1) The rule sending the packet to conntrack (pre_ct)
2) The rule matching on +trk+est after a packet has been through
   conntrack. (post_ct)
3) The rule received via callback from the netfilter (nft)

In order to offload a flow we need a combination of all three flows, but
they could be added/deleted at different times and in different order.

To solve this we save potential offloadable CT flows in the driver,
and every time we receive a callback we check against these saved flows
for valid merges. Once we have a valid combination of all three flows
this will be offloaded to the NFP. This is demonstrated in the diagram
below.

	+-------------+                      +----------+
	| pre_ct flow +--------+             | nft flow |
	+-------------+        v             +------+---+
	                  +----------+              |
	                  | tc_merge +--------+     |
	                  +----------+        v     v
	+--------------+       ^           +-------------+
	| post_ct flow +-------+       +---+nft_tc merge |
	+--------------+               |   +-------------+
	                               |
	                               |
	                               |
	                               v
	                        Offload to nfp

This series is only up to the point of the pre_ct and post_ct
merges into the tc_merge. Follow up series will continue
to add the nft flows and merging of these flows with the result
of the pre_ct and post_ct merged flows.

Changes since v2:
- nfp: flower-ct: add zone table entry when handling pre/post_ct flows
    Fixed another docstring. Should finally have the patch check
    environment properly configured now to avoid more of these.
- nfp: flower-ct: add tc merge functionality
    Fixed warning found by "kernel test robot <lkp@intel.com>"
    Added code comment explaining chain_index comparison

Changes since v1:
- nfp: flower-ct: add ct zone table
    Fixed unused variable compile warning
    Fixed missing colon in struct description

Louis Peens (8):
  nfp: flower: move non-zero chain check
  nfp: flower-ct: add pre and post ct checks
  nfp: flower-ct: add ct zone table
  nfp: flower-ct: add zone table entry when handling pre/post_ct flows
  nfp: flower-ct: add nfp_fl_ct_flow_entries
  nfp: flower-ct: add a table to map flow cookies to ct flows
  nfp: flower-ct: add tc_merge_tb
  nfp: flower-ct: add tc merge functionality

 drivers/net/ethernet/netronome/nfp/Makefile   |   3 +-
 .../ethernet/netronome/nfp/flower/conntrack.c | 492 ++++++++++++++++++
 .../ethernet/netronome/nfp/flower/conntrack.h | 155 ++++++
 .../net/ethernet/netronome/nfp/flower/main.h  |   6 +
 .../ethernet/netronome/nfp/flower/metadata.c  | 101 +++-
 .../ethernet/netronome/nfp/flower/offload.c   |  31 +-
 6 files changed, 781 insertions(+), 7 deletions(-)
 create mode 100644 drivers/net/ethernet/netronome/nfp/flower/conntrack.c
 create mode 100644 drivers/net/ethernet/netronome/nfp/flower/conntrack.h

Comments

Jakub Kicinski June 2, 2021, 4:59 p.m. UTC | #1
On Wed,  2 Jun 2021 13:59:44 +0200 Simon Horman wrote:
> This is the first in a series of patches to offload conntrack
> to the nfp. The approach followed is to flatten out three
> different flow rules into a single offloaded flow. The three
> different flows are:
> 
> 1) The rule sending the packet to conntrack (pre_ct)
> 2) The rule matching on +trk+est after a packet has been through
>    conntrack. (post_ct)
> 3) The rule received via callback from the netfilter (nft)
> 
> In order to offload a flow we need a combination of all three flows, but
> they could be added/deleted at different times and in different order.

Acked-by: Jakub Kicinski <kuba@kernel.org>
patchwork-bot+netdevbpf@kernel.org June 2, 2021, 9:10 p.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Wed,  2 Jun 2021 13:59:44 +0200 you wrote:
> Louis Peens says:
> 
> This is the first in a series of patches to offload conntrack
> to the nfp. The approach followed is to flatten out three
> different flow rules into a single offloaded flow. The three
> different flows are:
> 
> [...]

Here is the summary with links:
  - [net-next,v3,1/8] nfp: flower: move non-zero chain check
    https://git.kernel.org/netdev/net-next/c/2bda0a5e3bf8
  - [net-next,v3,2/8] nfp: flower-ct: add pre and post ct checks
    https://git.kernel.org/netdev/net-next/c/c8b034fbeba5
  - [net-next,v3,3/8] nfp: flower-ct: add ct zone table
    https://git.kernel.org/netdev/net-next/c/e236e4849b58
  - [net-next,v3,4/8] nfp: flower-ct: add zone table entry when handling pre/post_ct flows
    https://git.kernel.org/netdev/net-next/c/bd0fe7f96a3c
  - [net-next,v3,5/8] nfp: flower-ct: add nfp_fl_ct_flow_entries
    https://git.kernel.org/netdev/net-next/c/072c089ca536
  - [net-next,v3,6/8] nfp: flower-ct: add a table to map flow cookies to ct flows
    https://git.kernel.org/netdev/net-next/c/fa81d6d214a4
  - [net-next,v3,7/8] nfp: flower-ct: add tc_merge_tb
    https://git.kernel.org/netdev/net-next/c/f7ae12e2f95d
  - [net-next,v3,8/8] nfp: flower-ct: add tc merge functionality
    https://git.kernel.org/netdev/net-next/c/3c863c300c09

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html