summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mscc/ocelot_flower.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2020-03-07 12:40:13 +0100
committerDavid S. Miller <davem@davemloft.net>2020-03-08 21:07:48 -0700
commit319a1d19471ec49b8a91a7f6a3fe2c4535e5c279 (patch)
tree79e4bd8825d56c9ff7662c60e7d129972e866621 /drivers/net/ethernet/mscc/ocelot_flower.c
parent1ee473306a28ae685e4a368f3cb212ce1fc1b0fe (diff)
flow_offload: check for basic action hw stats type
Introduce flow_action_basic_hw_stats_types_check() helper and use it in drivers. That sanitizes the drivers which do not have support for action HW stats types. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc/ocelot_flower.c')
-rw-r--r--drivers/net/ethernet/mscc/ocelot_flower.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot_flower.c b/drivers/net/ethernet/mscc/ocelot_flower.c
index 8986f209e981..6d84173373c7 100644
--- a/drivers/net/ethernet/mscc/ocelot_flower.c
+++ b/drivers/net/ethernet/mscc/ocelot_flower.c
@@ -17,6 +17,10 @@ static int ocelot_flower_parse_action(struct flow_cls_offload *f,
if (!flow_offload_has_one_action(&f->rule->action))
return -EOPNOTSUPP;
+ if (!flow_action_basic_hw_stats_types_check(&f->rule->action,
+ f->common.extack))
+ return -EOPNOTSUPP;
+
flow_action_for_each(i, a, &f->rule->action) {
switch (a->id) {
case FLOW_ACTION_DROP: