aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2020-03-07 12:40:20 +0100
committerDavid S. Miller <davem@davemloft.net>2020-03-08 21:07:48 -0700
commit44f8658017419dccbeefe64f30122fa191d0e173 (patch)
tree91666da01c7c8ae1758342a2261165c5fab6fcf6 /net/sched/cls_api.c
parentflow_offload: introduce "disabled" HW stats type and allow it in mlxsw (diff)
downloadlinux-dev-44f8658017419dccbeefe64f30122fa191d0e173.tar.xz
linux-dev-44f8658017419dccbeefe64f30122fa191d0e173.zip
sched: act: allow user to specify type of HW stats for a filter
Currently, user who is adding an action expects HW to report stats, however it does not have exact expectations about the stats types. That is aligned with TCA_ACT_HW_STATS_TYPE_ANY. Allow user to specify the type of HW stats for an action and require it. Pass the information down to flow_offload layer. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r--net/sched/cls_api.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 4e766c5ab77a..e91448640a4f 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3464,6 +3464,10 @@ int tc_setup_flow_action(struct flow_action *flow_action,
struct tc_action *act;
int i, j, k, err = 0;
+ BUILD_BUG_ON(TCA_ACT_HW_STATS_TYPE_ANY != FLOW_ACTION_HW_STATS_TYPE_ANY);
+ BUILD_BUG_ON(TCA_ACT_HW_STATS_TYPE_IMMEDIATE != FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE);
+ BUILD_BUG_ON(TCA_ACT_HW_STATS_TYPE_DELAYED != FLOW_ACTION_HW_STATS_TYPE_DELAYED);
+
if (!exts)
return 0;
@@ -3476,6 +3480,9 @@ int tc_setup_flow_action(struct flow_action *flow_action,
err = tcf_act_get_cookie(entry, act);
if (err)
goto err_out_locked;
+
+ entry->hw_stats_type = act->hw_stats_type;
+
if (is_tcf_gact_ok(act)) {
entry->id = FLOW_ACTION_ACCEPT;
} else if (is_tcf_gact_shot(act)) {