Commit f460019b authored by Vlad Buslov's avatar Vlad Buslov Committed by Jakub Kicinski

net: sched: alias action flags with TCA_ACT_ prefix

Currently both filter and action flags use same "TCA_" prefix which makes
them hard to distinguish to code and confusing for users. Create aliases
for existing action flags constants with "TCA_ACT_" prefix.
Signed-off-by: default avatarVlad Buslov <vlad@buslov.dev>
Link: https://lore.kernel.org/r/20201124164054.893168-1-vlad@buslov.devSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b6d69fc8
...@@ -768,16 +768,18 @@ enum { ...@@ -768,16 +768,18 @@ enum {
#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg)) #define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
/* tcamsg flags stored in attribute TCA_ROOT_FLAGS /* tcamsg flags stored in attribute TCA_ROOT_FLAGS
* *
* TCA_FLAG_LARGE_DUMP_ON user->kernel to request for larger than TCA_ACT_MAX_PRIO * TCA_ACT_FLAG_LARGE_DUMP_ON user->kernel to request for larger than
* actions in a dump. All dump responses will contain the number of actions * TCA_ACT_MAX_PRIO actions in a dump. All dump responses will contain the
* being dumped stored in for user app's consumption in TCA_ROOT_COUNT * number of actions being dumped stored in for user app's consumption in
* TCA_ROOT_COUNT
* *
* TCA_FLAG_TERSE_DUMP user->kernel to request terse (brief) dump that only * TCA_ACT_FLAG_TERSE_DUMP user->kernel to request terse (brief) dump that only
* includes essential action info (kind, index, etc.) * includes essential action info (kind, index, etc.)
* *
*/ */
#define TCA_FLAG_LARGE_DUMP_ON (1 << 0) #define TCA_FLAG_LARGE_DUMP_ON (1 << 0)
#define TCA_FLAG_TERSE_DUMP (1 << 1) #define TCA_ACT_FLAG_LARGE_DUMP_ON TCA_FLAG_LARGE_DUMP_ON
#define TCA_ACT_FLAG_TERSE_DUMP (1 << 1)
/* New extended info filters for IFLA_EXT_MASK */ /* New extended info filters for IFLA_EXT_MASK */
#define RTEXT_FILTER_VF (1 << 0) #define RTEXT_FILTER_VF (1 << 0)
......
...@@ -278,7 +278,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, ...@@ -278,7 +278,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
index--; index--;
goto nla_put_failure; goto nla_put_failure;
} }
err = (act_flags & TCA_FLAG_TERSE_DUMP) ? err = (act_flags & TCA_ACT_FLAG_TERSE_DUMP) ?
tcf_action_dump_terse(skb, p, true) : tcf_action_dump_terse(skb, p, true) :
tcf_action_dump_1(skb, p, 0, 0); tcf_action_dump_1(skb, p, 0, 0);
if (err < 0) { if (err < 0) {
...@@ -288,7 +288,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, ...@@ -288,7 +288,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
} }
nla_nest_end(skb, nest); nla_nest_end(skb, nest);
n_i++; n_i++;
if (!(act_flags & TCA_FLAG_LARGE_DUMP_ON) && if (!(act_flags & TCA_ACT_FLAG_LARGE_DUMP_ON) &&
n_i >= TCA_ACT_MAX_PRIO) n_i >= TCA_ACT_MAX_PRIO)
goto done; goto done;
} }
...@@ -298,7 +298,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, ...@@ -298,7 +298,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb,
mutex_unlock(&idrinfo->lock); mutex_unlock(&idrinfo->lock);
if (n_i) { if (n_i) {
if (act_flags & TCA_FLAG_LARGE_DUMP_ON) if (act_flags & TCA_ACT_FLAG_LARGE_DUMP_ON)
cb->args[1] = n_i; cb->args[1] = n_i;
} }
return n_i; return n_i;
...@@ -1473,8 +1473,8 @@ static int tcf_action_add(struct net *net, struct nlattr *nla, ...@@ -1473,8 +1473,8 @@ static int tcf_action_add(struct net *net, struct nlattr *nla,
} }
static const struct nla_policy tcaa_policy[TCA_ROOT_MAX + 1] = { static const struct nla_policy tcaa_policy[TCA_ROOT_MAX + 1] = {
[TCA_ROOT_FLAGS] = NLA_POLICY_BITFIELD32(TCA_FLAG_LARGE_DUMP_ON | [TCA_ROOT_FLAGS] = NLA_POLICY_BITFIELD32(TCA_ACT_FLAG_LARGE_DUMP_ON |
TCA_FLAG_TERSE_DUMP), TCA_ACT_FLAG_TERSE_DUMP),
[TCA_ROOT_TIME_DELTA] = { .type = NLA_U32 }, [TCA_ROOT_TIME_DELTA] = { .type = NLA_U32 },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment