summaryrefslogtreecommitdiffstats
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorPieter Jansen van Vuuren2019-05-04 13:46:16 +0200
committerDavid S. Miller2019-05-06 06:49:23 +0200
commita7a7be6087b07563490725f61f4dbf4826f099e2 (patch)
tree7833bac31d3fe4aab2ccde2486e93c9aa5c4a8af /net/sched/cls_api.c
parentMerge branch 'of_net-Add-NVMEM-support-to-of_get_mac_address' (diff)
downloadkernel-qcow2-linux-a7a7be6087b07563490725f61f4dbf4826f099e2.tar.gz
kernel-qcow2-linux-a7a7be6087b07563490725f61f4dbf4826f099e2.tar.xz
kernel-qcow2-linux-a7a7be6087b07563490725f61f4dbf4826f099e2.zip
net/sched: add sample action to the hardware intermediate representation
Add sample action to the hardware intermediate representation model which would subsequently allow it to be used by drivers for offload. Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 263c2ec082c9..f8ee2d78654a 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -37,6 +37,7 @@
#include <net/tc_act/tc_tunnel_key.h>
#include <net/tc_act/tc_csum.h>
#include <net/tc_act/tc_gact.h>
+#include <net/tc_act/tc_sample.h>
#include <net/tc_act/tc_skbedit.h>
extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1];
@@ -3257,6 +3258,13 @@ int tc_setup_flow_action(struct flow_action *flow_action,
} else if (is_tcf_skbedit_mark(act)) {
entry->id = FLOW_ACTION_MARK;
entry->mark = tcf_skbedit_mark(act);
+ } else if (is_tcf_sample(act)) {
+ entry->id = FLOW_ACTION_SAMPLE;
+ entry->sample.psample_group =
+ tcf_sample_psample_group(act);
+ entry->sample.trunc_size = tcf_sample_trunc_size(act);
+ entry->sample.truncate = tcf_sample_truncate(act);
+ entry->sample.rate = tcf_sample_rate(act);
} else {
goto err_out;
}