net: qos: police action add index for tc flower offloading
authorPo Liu <Po.Liu@nxp.com>
Wed, 24 Jun 2020 09:36:30 +0000 (17:36 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Jun 2020 05:04:26 +0000 (22:04 -0700)
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: Po Liu <Po.Liu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/flow_offload.h
net/sched/cls_api.c

index c2ef19c6b27dc06f894cd0769798af67396b24f9..eed98075b1aee18c7408df469a40438605e7ec50 100644 (file)
@@ -232,6 +232,7 @@ struct flow_action_entry {
                        bool                    truncate;
                } sample;
                struct {                                /* FLOW_ACTION_POLICE */
+                       u32                     index;
                        s64                     burst;
                        u64                     rate_bytes_ps;
                        u32                     mtu;
index 6aba7d5ba1ece5aae8fd29085462d0871d15482a..fdc4c89ca1fadba710d7fd129156517c591c76dc 100644 (file)
@@ -3659,6 +3659,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
                        entry->police.rate_bytes_ps =
                                tcf_police_rate_bytes_ps(act);
                        entry->police.mtu = tcf_police_tcfp_mtu(act);
+                       entry->police.index = act->tcfa_index;
                } else if (is_tcf_ct(act)) {
                        entry->id = FLOW_ACTION_CT;
                        entry->ct.action = tcf_ct_action(act);