summaryrefslogtreecommitdiff
path: root/net/dsa/slave.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 /net/dsa/slave.c
parent1ee473306a28ae685e4a368f3cb212ce1fc1b0fe (diff)
downloadlinux-next-319a1d19471ec49b8a91a7f6a3fe2c4535e5c279.tar.gz
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 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 79d9b4384d7b..fca9bfa8437e 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -865,6 +865,10 @@ static int dsa_slave_add_cls_matchall(struct net_device *dev,
if (!flow_offload_has_one_action(&cls->rule->action))
return err;
+ if (!flow_action_basic_hw_stats_types_check(&cls->rule->action,
+ cls->common.extack))
+ return err;
+
act = &cls->rule->action.entries[0];
if (act->id == FLOW_ACTION_MIRRED && protocol == htons(ETH_P_ALL)) {