netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net/sched: Introduce tc connection tracking
@ 2019-06-11 13:28 Paul Blakey
  2019-06-11 13:28 ` [PATCH net-next 1/3] net/sched: Introduce action ct Paul Blakey
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Paul Blakey @ 2019-06-11 13:28 UTC (permalink / raw)
  To: Jiri Pirko, Paul Blakey, Roi Dayan, Yossi Kuperman, Oz Shlomo,
	Marcelo Ricardo Leitner, netdev, David Miller, Aaron Conole,
	Zhike Wang
  Cc: Rony Efraim, nst-kernel, John Hurley, Simon Horman, Justin Pettit

Hi,

This patch series add connection tracking capabilities in tc sw datapath.
It does so via a new tc action, called act_ct, and new tc flower classifier matching
on conntrack state, mark and label.

Usage is as follows:
$ tc qdisc add dev ens1f0_0 ingress
$ tc qdisc add dev ens1f0_1 ingress

$ tc filter add dev ens1f0_0 ingress \
  prio 1 chain 0 proto ip \
  flower ip_proto tcp ct_state -trk \
  action ct zone 2 pipe \
  action goto chain 2
$ tc filter add dev ens1f0_0 ingress \
  prio 1 chain 2 proto ip \
  flower ct_state +trk+new \
  action ct zone 2 commit mark 0xbb nat src 5.5.5.7 pipe \
  action mirred egress redirect dev ens1f0_1
$ tc filter add dev ens1f0_0 ingress \
  prio 1 chain 2 proto ip \
  flower ct_zone 2 ct_mark 0xbb ct_state +trk+est \
  action ct nat pipe \
  action mirred egress redirect dev ens1f0_1

$ tc filter add dev ens1f0_1 ingress \
  prio 1 chain 0 proto ip \
  flower ip_proto tcp ct_state -trk \
  action ct zone 2 pipe \
  action goto chain 1
$ tc filter add dev ens1f0_1 ingress \
  prio 1 chain 1 proto ip \
  flower ct_zone 2 ct_mark 0xbb ct_state +trk+est \
  action ct nat pipe \
  action mirred egress redirect dev ens1f0_0

The pattern used in the design here closely resembles OvS, as the plan is to also offload
OvS conntrack rules to tc. OvS datapath rules uses it's recirculation mechanism to send
specific packets to conntrack, and return with the new conntrack state (ct_state) on some other recirc_id
to be matched again (we use goto chain for this).

This results in the following OvS datapath rules:

recirc_id(0),in_port(ens1f0_0),ct_state(-trk),... actions:ct(zone=2),recirc(2)
recirc_id(2),in_port(ens1f0_0),ct_state(+new+trk),ct_mark(0xbb),... actions:ct(commit,zone=2,nat(src=5.5.5.7),mark=0xbb),ens1f0_1
recirc_id(2),in_port(ens1f0_0),ct_state(+est+trk),ct_mark(0xbb),... actions:ct(zone=2,nat),ens1f0_1

recirc_id(1),in_port(ens1f0_1),ct_state(-trk),... actions:ct(zone=2),recirc(1)
recirc_id(1),in_port(ens1f0_1),ct_state(+est+trk),... actions:ct(zone=2,nat),ens1f0_0

Paul Blakey (3):
  net/sched: Introduce action ct
  net/flow_dissector: add connection tracking dissection
  net/sched: cls_flower: Add matching on conntrack info

 include/linux/skbuff.h            |  10 +
 include/net/flow_dissector.h      |  15 +
 include/net/flow_offload.h        |   5 +
 include/net/tc_act/tc_ct.h        |  64 +++
 include/uapi/linux/pkt_cls.h      |  18 +
 include/uapi/linux/tc_act/tc_ct.h |  41 ++
 net/core/flow_dissector.c         |  44 ++
 net/sched/Kconfig                 |  11 +
 net/sched/Makefile                |   1 +
 net/sched/act_ct.c                | 900 ++++++++++++++++++++++++++++++++++++++
 net/sched/cls_api.c               |   5 +
 net/sched/cls_flower.c            | 127 +++++-
 12 files changed, 1236 insertions(+), 5 deletions(-)
 create mode 100644 include/net/tc_act/tc_ct.h
 create mode 100644 include/uapi/linux/tc_act/tc_ct.h
 create mode 100644 net/sched/act_ct.c

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2019-06-24 17:47 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 13:28 [PATCH net-next 0/3] net/sched: Introduce tc connection tracking Paul Blakey
2019-06-11 13:28 ` [PATCH net-next 1/3] net/sched: Introduce action ct Paul Blakey
2019-06-11 13:59   ` Toke Høiland-Jørgensen
2019-06-11 14:15     ` Paul Blakey
2019-06-11 15:34       ` Toke Høiland-Jørgensen
2019-06-11 15:53         ` Marcelo Ricardo Leitner
2019-06-11 20:23           ` Toke Høiland-Jørgensen
2019-06-13 13:46             ` Paul Blakey
2019-06-13 14:08               ` Toke Høiland-Jørgensen
2019-06-14 18:07           ` Cong Wang
2019-06-14 19:24             ` Marcelo Ricardo Leitner
2019-06-18 16:03               ` Cong Wang
2019-06-20  7:32                 ` Paul Blakey
2019-06-24 17:46                   ` Cong Wang
2019-06-13 11:00       ` Kevin Darbyshire-Bryant
2019-06-12 18:04   ` Marcelo Ricardo Leitner
2019-06-13 13:44     ` Paul Blakey
2019-06-12 19:55   ` Florian Westphal
2019-06-13 13:39     ` Paul Blakey
2019-06-13 10:16   ` Davide Caratti
2019-06-13 10:49     ` Davide Caratti
2019-06-13 13:40       ` Paul Blakey
2019-06-14 18:02   ` Cong Wang
2019-06-16  7:29     ` Paul Blakey
2019-06-19 18:33   ` Marcelo Ricardo Leitner
2019-06-20  7:07     ` Paul Blakey
2019-06-11 13:28 ` [PATCH net-next 2/3] net/flow_dissector: add connection tracking dissection Paul Blakey
2019-06-11 13:28 ` [PATCH net-next 3/3] net/sched: cls_flower: Add matching on conntrack info Paul Blakey

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).