[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211118130805.23897-1-simon.horman@corigine.com>
Date: Thu, 18 Nov 2021 14:07:55 +0100
From: Simon Horman <simon.horman@...igine.com>
To: netdev@...r.kernel.org
Cc: Cong Wang <xiyou.wangcong@...il.com>,
Ido Schimmel <idosch@...dia.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>, Oz Shlomo <ozsh@...dia.com>,
Roi Dayan <roid@...dia.com>, Vlad Buslov <vladbu@...dia.com>,
Baowen Zheng <baowen.zheng@...igine.com>,
Louis Peens <louis.peens@...igine.com>,
oss-drivers@...igine.com
Subject: [PATCH v4 net-next 0/10] allow user to offload tc action to net device
Baowen Zheng says:
Allow use of flow_indr_dev_register/flow_indr_dev_setup_offload to offload
tc actions independent of flows.
The motivation for this work is to prepare for using TC police action
instances to provide hardware offload of OVS metering feature - which calls
for policers that may be used by multiple flows and whose lifecycle is
independent of any flows that use them.
This patch includes basic changes to offload drivers to return EOPNOTSUPP
if this feature is used - it is not yet supported by any driver.
Tc cli command to offload and quote an action:
tc qdisc add dev $DEV ingress
tc qdisc show dev $DEV ingress
tc actions add action police rate 100mbit burst 10000k index 200 skip_sw
tc -s -d actions list action police
tc filter add dev $DEV protocol ip parent ffff: \
flower skip_sw ip_proto tcp action police index 200
tc -s -d filter show dev $DEV protocol ip parent ffff:
tc filter add dev $DEV protocol ipv6 parent ffff: \
flower skip_sw ip_proto tcp action police index 200
tc -s -d filter show dev $DEV protocol ipv6 parent ffff:
tc -s -d actions list action police
Output for the tc action verbose dump:
action order 0: police index 200 rate 100Mbit burst 10000Kb mtu 2Kb action drop overhead 0 linklayer unspec ref 3 bind 2 installed 52 sec used 0 sec firstused 30 sec
Action statistics:
Sent 136094386 bytes 91110 pkt (dropped 0, overlimits 0 requeues 0)
Sent software 0 bytes 0 pkt
Sent hardware 136094386 bytes 91110 pkt
backlog 0b 0p requeues 0
skip_sw in_hw in_hw_count 1
used_hw_stats delayed
Tc cli cleanup commands
tc qdisc del dev $DEV ingress && sleep 1
tc actions delete action police index 200
Changes compared to v3 patches:
* Made changes according to the public review comments.
* Validate flags inside tcf_action_init() instead of creating new
tcf_exts_validate_actions() function.
* Exactly match when validating flags of actions and filters.
* Add index to flow_action_entry for driver to identify actions.
Baowen Zheng (10):
flow_offload: fill flags to action structure
flow_offload: reject to offload tc actions in offload drivers
flow_offload: add index to flow_action_entry structure
flow_offload: allow user to offload tc action to net device
flow_offload: add skip_hw and skip_sw to control if offload the action
flow_offload: add process to update action stats from hardware
net: sched: save full flags for tc action
flow_offload: add reoffload process to update hw_count
flow_offload: validate flags of filter and actions
selftests: tc-testing: add action offload selftest for action and
filter
drivers/net/dsa/sja1105/sja1105_flower.c | 2 +-
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c | 2 +-
.../net/ethernet/freescale/enetc/enetc_qos.c | 6 +-
.../ethernet/mellanox/mlx5/core/en/rep/tc.c | 3 +
.../ethernet/mellanox/mlxsw/spectrum_flower.c | 2 +-
.../ethernet/netronome/nfp/flower/offload.c | 3 +
include/linux/netdevice.h | 1 +
include/net/act_api.h | 34 +-
include/net/flow_offload.h | 20 +-
include/net/pkt_cls.h | 56 ++-
include/net/tc_act/tc_gate.h | 5 -
include/uapi/linux/pkt_cls.h | 9 +-
net/core/flow_offload.c | 47 +-
net/sched/act_api.c | 451 +++++++++++++++++-
net/sched/act_bpf.c | 2 +-
net/sched/act_connmark.c | 2 +-
net/sched/act_ctinfo.c | 2 +-
net/sched/act_gate.c | 2 +-
net/sched/act_ife.c | 2 +-
net/sched/act_ipt.c | 2 +-
net/sched/act_mpls.c | 2 +-
net/sched/act_nat.c | 2 +-
net/sched/act_pedit.c | 2 +-
net/sched/act_police.c | 2 +-
net/sched/act_sample.c | 2 +-
net/sched/act_simple.c | 2 +-
net/sched/act_skbedit.c | 2 +-
net/sched/act_skbmod.c | 2 +-
net/sched/cls_api.c | 52 +-
net/sched/cls_flower.c | 9 +-
net/sched/cls_matchall.c | 9 +-
net/sched/cls_u32.c | 12 +-
.../tc-testing/tc-tests/actions/police.json | 24 +
.../tc-testing/tc-tests/filters/matchall.json | 24 +
34 files changed, 719 insertions(+), 80 deletions(-)
--
2.20.1
Powered by blists - more mailing lists