Commit ed7f2622 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-sched-fix-IFE-meta-modules-loading'

Roman Mashak says:

====================
net: sched: Fix IFE meta modules loading

Adjust module alias names of IFE meta modules and fix the bug that
prevented auto-loading IFE modules in run-time.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 47f25464 d3f24ba8
...@@ -40,7 +40,7 @@ struct tcf_meta_ops { ...@@ -40,7 +40,7 @@ struct tcf_meta_ops {
struct module *owner; struct module *owner;
}; };
#define MODULE_ALIAS_IFE_META(metan) MODULE_ALIAS("ifemeta" __stringify_1(metan)) #define MODULE_ALIAS_IFE_META(metan) MODULE_ALIAS("ife-meta-" metan)
int ife_get_meta_u32(struct sk_buff *skb, struct tcf_meta_info *mi); int ife_get_meta_u32(struct sk_buff *skb, struct tcf_meta_info *mi);
int ife_get_meta_u16(struct sk_buff *skb, struct tcf_meta_info *mi); int ife_get_meta_u16(struct sk_buff *skb, struct tcf_meta_info *mi);
......
...@@ -248,6 +248,20 @@ static int ife_validate_metatype(struct tcf_meta_ops *ops, void *val, int len) ...@@ -248,6 +248,20 @@ static int ife_validate_metatype(struct tcf_meta_ops *ops, void *val, int len)
return ret; return ret;
} }
static const char *ife_meta_id2name(u32 metaid)
{
switch (metaid) {
case IFE_META_SKBMARK:
return "skbmark";
case IFE_META_PRIO:
return "skbprio";
case IFE_META_TCINDEX:
return "tcindex";
default:
return "unknown";
}
}
/* called when adding new meta information /* called when adding new meta information
* under ife->tcf_lock for existing action * under ife->tcf_lock for existing action
*/ */
...@@ -263,7 +277,7 @@ static int load_metaops_and_vet(struct tcf_ife_info *ife, u32 metaid, ...@@ -263,7 +277,7 @@ static int load_metaops_and_vet(struct tcf_ife_info *ife, u32 metaid,
if (exists) if (exists)
spin_unlock_bh(&ife->tcf_lock); spin_unlock_bh(&ife->tcf_lock);
rtnl_unlock(); rtnl_unlock();
request_module("ifemeta%u", metaid); request_module("ife-meta-%s", ife_meta_id2name(metaid));
rtnl_lock(); rtnl_lock();
if (exists) if (exists)
spin_lock_bh(&ife->tcf_lock); spin_lock_bh(&ife->tcf_lock);
......
...@@ -76,4 +76,4 @@ module_exit(ifemark_cleanup_module); ...@@ -76,4 +76,4 @@ module_exit(ifemark_cleanup_module);
MODULE_AUTHOR("Jamal Hadi Salim(2015)"); MODULE_AUTHOR("Jamal Hadi Salim(2015)");
MODULE_DESCRIPTION("Inter-FE skb mark metadata module"); MODULE_DESCRIPTION("Inter-FE skb mark metadata module");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS_IFE_META(IFE_META_SKBMARK); MODULE_ALIAS_IFE_META("skbmark");
...@@ -73,4 +73,4 @@ module_exit(ifeprio_cleanup_module); ...@@ -73,4 +73,4 @@ module_exit(ifeprio_cleanup_module);
MODULE_AUTHOR("Jamal Hadi Salim(2015)"); MODULE_AUTHOR("Jamal Hadi Salim(2015)");
MODULE_DESCRIPTION("Inter-FE skb prio metadata action"); MODULE_DESCRIPTION("Inter-FE skb prio metadata action");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS_IFE_META(IFE_META_PRIO); MODULE_ALIAS_IFE_META("skbprio");
...@@ -76,4 +76,4 @@ module_exit(ifetc_index_cleanup_module); ...@@ -76,4 +76,4 @@ module_exit(ifetc_index_cleanup_module);
MODULE_AUTHOR("Jamal Hadi Salim(2016)"); MODULE_AUTHOR("Jamal Hadi Salim(2016)");
MODULE_DESCRIPTION("Inter-FE skb tc_index metadata module"); MODULE_DESCRIPTION("Inter-FE skb tc_index metadata module");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS_IFE_META(IFE_META_SKBTCINDEX); MODULE_ALIAS_IFE_META("tcindex");
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