Commit 627e39b1 authored by Po Liu's avatar Po Liu Committed by David S. Miller

net: qos: police action add index for tc flower offloading

Hardware device may include more than one police entry. Specifying the
action's index make it possible for several tc filters to share the same
police action when installing the filters.

Propagate this index to device drivers through the flow offload
intermediate representation, so that drivers could share a single
hardware policer between multiple filters.

v1->v2 changes:
- Update the commit message suggest by Ido Schimmel <idosch@idosch.org>
Signed-off-by: default avatarPo Liu <Po.Liu@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 89d1f096
...@@ -232,6 +232,7 @@ struct flow_action_entry { ...@@ -232,6 +232,7 @@ struct flow_action_entry {
bool truncate; bool truncate;
} sample; } sample;
struct { /* FLOW_ACTION_POLICE */ struct { /* FLOW_ACTION_POLICE */
u32 index;
s64 burst; s64 burst;
u64 rate_bytes_ps; u64 rate_bytes_ps;
u32 mtu; u32 mtu;
......
...@@ -3659,6 +3659,7 @@ int tc_setup_flow_action(struct flow_action *flow_action, ...@@ -3659,6 +3659,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
entry->police.rate_bytes_ps = entry->police.rate_bytes_ps =
tcf_police_rate_bytes_ps(act); tcf_police_rate_bytes_ps(act);
entry->police.mtu = tcf_police_tcfp_mtu(act); entry->police.mtu = tcf_police_tcfp_mtu(act);
entry->police.index = act->tcfa_index;
} else if (is_tcf_ct(act)) { } else if (is_tcf_ct(act)) {
entry->id = FLOW_ACTION_CT; entry->id = FLOW_ACTION_CT;
entry->ct.action = tcf_ct_action(act); entry->ct.action = tcf_ct_action(act);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment