diff options
author | Petr Machata <petrm@mellanox.com> | 2020-03-19 14:47:21 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-20 05:09:19 +0100 |
commit | 2ce124109c0fe0ea03233ae3625583de1f25e89c (patch) | |
tree | ac920871bd350af54dbe2839e1603acfe4e79290 /include/net/tc_act | |
parent | net: tc_skbedit: Factor a helper out of is_tcf_skbedit_{mark, ptype}() (diff) | |
download | linux-2ce124109c0fe0ea03233ae3625583de1f25e89c.tar.xz linux-2ce124109c0fe0ea03233ae3625583de1f25e89c.zip |
net: tc_skbedit: Make the skbedit priority offloadable
The skbedit action "priority" is used for adjusting SKB priority. Allow
drivers to offload the action by introducing two new skbedit getters and a
new flow action, and initializing appropriately in tc_setup_flow_action().
Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tc_act')
-rw-r--r-- | include/net/tc_act/tc_skbedit.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/tc_act/tc_skbedit.h b/include/net/tc_act/tc_skbedit.h index ac8ff60143fe..00bfee70609e 100644 --- a/include/net/tc_act/tc_skbedit.h +++ b/include/net/tc_act/tc_skbedit.h @@ -77,4 +77,21 @@ static inline u32 tcf_skbedit_ptype(const struct tc_action *a) return ptype; } +/* Return true iff action is priority */ +static inline bool is_tcf_skbedit_priority(const struct tc_action *a) +{ + return is_tcf_skbedit_with_flag(a, SKBEDIT_F_PRIORITY); +} + +static inline u32 tcf_skbedit_priority(const struct tc_action *a) +{ + u32 priority; + + rcu_read_lock(); + priority = rcu_dereference(to_skbedit(a)->params)->priority; + rcu_read_unlock(); + + return priority; +} + #endif /* __NET_TC_SKBEDIT_H */ |