diff options
author | Jiri Pirko <jiri@mellanox.com> | 2020-03-07 14:40:13 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-09 07:07:48 +0300 |
commit | 319a1d19471ec49b8a91a7f6a3fe2c4535e5c279 (patch) | |
tree | 79e4bd8825d56c9ff7662c60e7d129972e866621 /drivers/net/ethernet/mscc | |
parent | 1ee473306a28ae685e4a368f3cb212ce1fc1b0fe (diff) | |
download | linux-319a1d19471ec49b8a91a7f6a3fe2c4535e5c279.tar.xz |
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')
-rw-r--r-- | drivers/net/ethernet/mscc/ocelot_flower.c | 4 |
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: |