On 10/9/18 10:12 AM, Davide Caratti wrote:
quoted
quoted
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -37,6 +37,11 @@ static LIST_HEAD(tcf_proto_base);
/* Protects list of registered TC modules. It is pure SMP lock. */
static DEFINE_RWLOCK(cls_mod_lock);
+const struct nla_policy cls_tca_policy[TCA_MAX + 1] = {
+ [TCA_KIND] = { .type = NLA_STRING },
+ [TCA_CHAIN] = { .type = NLA_U32 },
+};
+
quoted
it be nice to have a tc_common module so this stuff does not have to be
defined multiple times.
it makes sense to avoid duplicating the declaration of that array. But I
don't think we can put it in a module, because CONFIG_NET_SCHED is 'bool'
and
obj-$(CONFIG_NET_SCHED) += sch_api.o
I can try a v2 where 'rtm_tca_policy' symbol in sch_api is exported and
used by cls_api.c code. WDYT?
since NET_SCHED is a bool, that should work.