Skip to content

net: add helper support in tc act_ct for ovs offloading

Xin Long netdev 3 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 0 repliesApplied 4/4
  2. v34 patches 4 repliesSuperseded
  3. v14 patches 0 repliesSuperseded

Changes in v4 from the cover letter

- have the nf_conn and ip_conntrack_info passed into nf_ct_helper() as Aaron suggested in the 1st patch.
- no need to pass the 'force' into tcf_ct_skb_nfct_cached() as Marcelo noticed, and remove the unnecessary variable 'force' in tcf_ct_act() in the 4th patch.
- fix a typo err in the cover letter as Marcelo noticed.

Patches in v4 All 4 applied

#Subject and filesSizeRepliesApplied
1/4net: move the ct 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+73 -600 repliesApplied
2/4net: move add ct 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+38 -390 repliesApplied
3/4net: sched: call tcf_ct_params_free to free params in tcf_ct_initnet/sched/act_ct.c+18 -170 repliesApplied
4/4net: 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+85 -80 repliesApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchMarcelo Ricardo Leitner
1/4A-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCHv4 net-next 0/4] 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 and 2nd patches move some common code into nf_conntrack_helper from openvswitch so that they could be used by net/sched in the 4th patch (Note there are still some other common code used in both OVS and TC, and I will extract it in other patches). The 3rd patch extracts another function in net/sched to make the 4th patch easier to write. The 4th patch adds this feature in net/sched.

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"

v1->v2:
- add the 2nd patch to extract nf_ct_add_helper from openvswitch for tc act_ct use.
- go to drop instead of return -EINVAL when fails to add SEQADJ ext in tcf_ct_act() as Paolo noticed in the 4th patch.
- add ct exts only when the ct is not confirmed as Pablo noticed in the 4th patch.

v2->v3:
- fix a warning of unused variable 'err' when CONFIG_NF_NAT is disabled in 2nd patch.

v3->v4:
- have the nf_conn and ip_conntrack_info passed into nf_ct_helper() as Aaron suggested in the 1st patch.
- no need to pass the 'force' into tcf_ct_skb_nfct_cached() as Marcelo noticed, and remove the unnecessary variable 'force' in tcf_ct_act() in the 4th patch.
- fix a typo err in the cover letter as Marcelo noticed.

Xin Long (4):
net: move the ct helper function to nf_conntrack_helper for ovs and tc
net: move add ct 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 |   5 +
 include/net/tc_act/tc_ct.h                  |   1 +
 include/uapi/linux/tc_act/tc_ct.h           |   3 +
 net/netfilter/nf_conntrack_helper.c         | 100 ++++++++++++++++
 net/openvswitch/conntrack.c                 | 105 +----------------
 net/sched/act_ct.c                          | 124 ++++++++++++++++----
 6 files changed, 214 insertions(+), 124 deletions(-)
Signature · 1 line
2.31.1