Skip to content

net: add helper support in tc act_ct for ovs offloading

Xin Long netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net: move the helper function to nf_conntrack_helper for ovs and tcinclude/net/netfilter/nf_conntrack_helper.h net/netfilter/nf_conntrack_helper.c net/openvswitch/conntrack.c+74 -600 replies
2/3net: sched: call tcf_ct_params_free to free params in tcf_ct_initnet/sched/act_ct.c+18 -170 replies
3/3net: sched: add helper support in act_ctinclude/net/tc_act/tc_ct.h include/uapi/linux/tc_act/tc_ct.h net/sched/act_ct.c+112 -54 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/3] net: add helper support in tc act_ct for ovs offloading

Ilya reported an issue that FTP traffic would be broken when the OVS flow with ct(commit,alg=ftp) installed in the OVS kernel module, and it was caused by that TC didn't support the ftp helper offloaded from OVS.

This patchset is to add the helper support in act_ct for ovs offloading in kernel net/sched.

The 1st patch moves some code from openvswitch into nf_conntrack_helper so that it can be used by net/sched in the 3rd patch (Note there are still some other common code used in both OVS and TC and I will extract it in other patches). The 2nd patch extracts another function in net/ sched to make the 3rd patch easier to write.

The user space part will be added in another patch, and with it these OVS flows (FTP over SNAT) can be used to test this feature:

  table=0, in_port=veth1,tcp,tcp_dst=2121,ct_state=-trk \
    actions=ct(table=1, nat), normal
  table=0, in_port=veth2,tcp,ct_state=-trk actions=ct(table=1, nat)
  table=0, in_port=veth1,tcp,ct_state=-trk actions=ct(table=0, nat)
  table=0, in_port=veth1,tcp,ct_state=+trk+rel actions=ct(commit, nat),normal
  table=0, in_port=veth1,tcp,ct_state=+trk+est actions=veth2"

  table=1, in_port=veth1,tcp,tcp_dst=2121,ct_state=+trk+new \
    actions=ct(commit, nat(src=7.7.16.1), alg=ftp),normal"
  table=1, in_port=veth1,tcp,tcp_dst=2121,ct_state=+trk+est actions=veth2"
  table=1, in_port=veth2,tcp,ct_state=+trk+est actions=veth1"

Xin Long (3):
net: move the helper function to nf_conntrack_helper for ovs and tc
net: sched: call tcf_ct_params_free to free params in tcf_ct_init
net: sched: add helper support in act_ct

 include/net/netfilter/nf_conntrack_helper.h |   2 +
 include/net/tc_act/tc_ct.h                  |   1 +
 include/uapi/linux/tc_act/tc_ct.h           |   3 +
 net/netfilter/nf_conntrack_helper.c         |  71 ++++++++++
 net/openvswitch/conntrack.c                 |  61 +-------
 net/sched/act_ct.c                          | 148 +++++++++++++++++---
 6 files changed, 204 insertions(+), 82 deletions(-)
Signature · 1 line
2.31.1