diff options
author | Patrick McHardy <kaber@trash.net> | 2007-07-11 22:46:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-07-11 22:46:26 -0400 |
commit | db3d99c090e0cdb34b1274767e062bfddbb384bc (patch) | |
tree | 9130391307ac77b7f458db5d3994309df6c9877b /net/sched | |
parent | 662ad4f8efd3ba2ed710d36003f968b500e6f123 (diff) |
[NET_SCHED]: ematch: module autoloading
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/em_cmp.c | 1 | ||||
-rw-r--r-- | net/sched/em_meta.c | 2 | ||||
-rw-r--r-- | net/sched/em_nbyte.c | 2 | ||||
-rw-r--r-- | net/sched/em_text.c | 2 | ||||
-rw-r--r-- | net/sched/em_u32.c | 2 | ||||
-rw-r--r-- | net/sched/ematch.c | 13 |
6 files changed, 22 insertions, 0 deletions
diff --git a/net/sched/em_cmp.c b/net/sched/em_cmp.c index 8d6dacd81900..cc49c932641d 100644 --- a/net/sched/em_cmp.c +++ b/net/sched/em_cmp.c | |||
@@ -98,3 +98,4 @@ MODULE_LICENSE("GPL"); | |||
98 | module_init(init_em_cmp); | 98 | module_init(init_em_cmp); |
99 | module_exit(exit_em_cmp); | 99 | module_exit(exit_em_cmp); |
100 | 100 | ||
101 | MODULE_ALIAS_TCF_EMATCH(TCF_EM_CMP); | ||
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index 60acf8cdb27b..650f09c8bd6a 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c | |||
@@ -848,3 +848,5 @@ MODULE_LICENSE("GPL"); | |||
848 | 848 | ||
849 | module_init(init_em_meta); | 849 | module_init(init_em_meta); |
850 | module_exit(exit_em_meta); | 850 | module_exit(exit_em_meta); |
851 | |||
852 | MODULE_ALIAS_TCF_EMATCH(TCF_EM_META); | ||
diff --git a/net/sched/em_nbyte.c b/net/sched/em_nbyte.c index b4b36efce292..370a1b2ea317 100644 --- a/net/sched/em_nbyte.c +++ b/net/sched/em_nbyte.c | |||
@@ -76,3 +76,5 @@ MODULE_LICENSE("GPL"); | |||
76 | 76 | ||
77 | module_init(init_em_nbyte); | 77 | module_init(init_em_nbyte); |
78 | module_exit(exit_em_nbyte); | 78 | module_exit(exit_em_nbyte); |
79 | |||
80 | MODULE_ALIAS_TCF_EMATCH(TCF_EM_NBYTE); | ||
diff --git a/net/sched/em_text.c b/net/sched/em_text.c index e8f46169449d..d5cd86efb7d0 100644 --- a/net/sched/em_text.c +++ b/net/sched/em_text.c | |||
@@ -150,3 +150,5 @@ MODULE_LICENSE("GPL"); | |||
150 | 150 | ||
151 | module_init(init_em_text); | 151 | module_init(init_em_text); |
152 | module_exit(exit_em_text); | 152 | module_exit(exit_em_text); |
153 | |||
154 | MODULE_ALIAS_TCF_EMATCH(TCF_EM_TEXT); | ||
diff --git a/net/sched/em_u32.c b/net/sched/em_u32.c index 0a2a7fe08de3..112796e4a7c4 100644 --- a/net/sched/em_u32.c +++ b/net/sched/em_u32.c | |||
@@ -60,3 +60,5 @@ MODULE_LICENSE("GPL"); | |||
60 | 60 | ||
61 | module_init(init_em_u32); | 61 | module_init(init_em_u32); |
62 | module_exit(exit_em_u32); | 62 | module_exit(exit_em_u32); |
63 | |||
64 | MODULE_ALIAS_TCF_EMATCH(TCF_EM_U32); | ||
diff --git a/net/sched/ematch.c b/net/sched/ematch.c index 24837391640d..f3a104e323bd 100644 --- a/net/sched/ematch.c +++ b/net/sched/ematch.c | |||
@@ -222,6 +222,19 @@ static int tcf_em_validate(struct tcf_proto *tp, | |||
222 | 222 | ||
223 | if (em->ops == NULL) { | 223 | if (em->ops == NULL) { |
224 | err = -ENOENT; | 224 | err = -ENOENT; |
225 | #ifdef CONFIG_KMOD | ||
226 | __rtnl_unlock(); | ||
227 | request_module("ematch-kind-%u", em_hdr->kind); | ||
228 | rtnl_lock(); | ||
229 | em->ops = tcf_em_lookup(em_hdr->kind); | ||
230 | if (em->ops) { | ||
231 | /* We dropped the RTNL mutex in order to | ||
232 | * perform the module load. Tell the caller | ||
233 | * to replay the request. */ | ||
234 | module_put(em->ops->owner); | ||
235 | err = -EAGAIN; | ||
236 | } | ||
237 | #endif | ||
225 | goto errout; | 238 | goto errout; |
226 | } | 239 | } |
227 | 240 | ||