diff options
author | Jianbo Liu <jianbol@nvidia.com> | 2022-02-24 10:29:08 +0000 |
---|---|---|
committer | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-05-04 16:33:13 +0300 |
commit | 967f518a79a8ea44f4a02d7056c654388bb99f81 (patch) | |
tree | 3834f8324f9b7b33e27d2a39d3ef4ab732cd6ab7 /include | |
parent | 1b0edfb5053254adfa680812a6d7e8467a6276cd (diff) |
flow_offload: reject offload for all drivers with invalid police parameters
As more police parameters are passed to flow_offload, driver can check
them to make sure hardware handles packets in the way indicated by tc.
The conform-exceed control should be drop/pipe or drop/ok. Besides,
for drop/ok, the police should be the last action. As hardware can't
configure peakrate/avrate/overhead, offload should not be supported if
any of them is configured.
Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d97b4b105ce71f9f907f1511986cc1d224126772)
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Conflicts in drivers/net/ethernet/netronome/nfp/flower/qos_conf.c which
we did not update.
Diffstat (limited to 'include')
-rw-r--r-- | include/net/flow_offload.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h index 74f44d44abe3..92267d23083e 100644 --- a/include/net/flow_offload.h +++ b/include/net/flow_offload.h @@ -311,6 +311,12 @@ static inline bool flow_offload_has_one_action(const struct flow_action *action) return action->num_entries == 1; } +static inline bool flow_action_is_last_entry(const struct flow_action *action, + const struct flow_action_entry *entry) +{ + return entry == &action->entries[action->num_entries - 1]; +} + #define flow_action_for_each(__i, __act, __actions) \ for (__i = 0, __act = &(__actions)->entries[0]; \ __i < (__actions)->num_entries; \ |