Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3f0ccc08
Commit
3f0ccc08
authored
Apr 19, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PKT_SCHED]: Proper module refcounting for packet schedulers.
parent
8a7cd77d
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
347 additions
and
450 deletions
+347
-450
include/net/pkt_sched.h
include/net/pkt_sched.h
+4
-0
net/sched/sch_api.c
net/sched/sch_api.c
+6
-0
net/sched/sch_atm.c
net/sched/sch_atm.c
+27
-35
net/sched/sch_cbq.c
net/sched/sch_cbq.c
+28
-38
net/sched/sch_csz.c
net/sched/sch_csz.c
+27
-37
net/sched/sch_dsmark.c
net/sched/sch_dsmark.c
+27
-35
net/sched/sch_fifo.c
net/sched/sch_fifo.c
+31
-36
net/sched/sch_generic.c
net/sched/sch_generic.c
+41
-46
net/sched/sch_gred.c
net/sched/sch_gred.c
+15
-21
net/sched/sch_htb.c
net/sched/sch_htb.c
+27
-35
net/sched/sch_ingress.c
net/sched/sch_ingress.c
+27
-37
net/sched/sch_prio.c
net/sched/sch_prio.c
+27
-36
net/sched/sch_red.c
net/sched/sch_red.c
+16
-27
net/sched/sch_sfq.c
net/sched/sch_sfq.c
+15
-20
net/sched/sch_tbf.c
net/sched/sch_tbf.c
+15
-27
net/sched/sch_teql.c
net/sched/sch_teql.c
+14
-20
No files found.
include/net/pkt_sched.h
View file @
3f0ccc08
...
@@ -49,6 +49,8 @@ struct Qdisc_class_ops
...
@@ -49,6 +49,8 @@ struct Qdisc_class_ops
int
(
*
dump
)(
struct
Qdisc
*
,
unsigned
long
,
struct
sk_buff
*
skb
,
struct
tcmsg
*
);
int
(
*
dump
)(
struct
Qdisc
*
,
unsigned
long
,
struct
sk_buff
*
skb
,
struct
tcmsg
*
);
};
};
struct
module
;
struct
Qdisc_ops
struct
Qdisc_ops
{
{
struct
Qdisc_ops
*
next
;
struct
Qdisc_ops
*
next
;
...
@@ -67,6 +69,8 @@ struct Qdisc_ops
...
@@ -67,6 +69,8 @@ struct Qdisc_ops
int
(
*
change
)(
struct
Qdisc
*
,
struct
rtattr
*
arg
);
int
(
*
change
)(
struct
Qdisc
*
,
struct
rtattr
*
arg
);
int
(
*
dump
)(
struct
Qdisc
*
,
struct
sk_buff
*
);
int
(
*
dump
)(
struct
Qdisc
*
,
struct
sk_buff
*
);
struct
module
*
owner
;
};
};
extern
rwlock_t
qdisc_tree_lock
;
extern
rwlock_t
qdisc_tree_lock
;
...
...
net/sched/sch_api.c
View file @
3f0ccc08
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
*/
*/
#include <linux/config.h>
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/sched.h>
...
@@ -447,6 +448,10 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
...
@@ -447,6 +448,10 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
else
else
sch
->
handle
=
handle
;
sch
->
handle
=
handle
;
err
=
-
EBUSY
;
if
(
!
try_module_get
(
ops
->
owner
))
goto
err_out
;
if
(
!
ops
->
init
||
(
err
=
ops
->
init
(
sch
,
tca
[
TCA_OPTIONS
-
1
]))
==
0
)
{
if
(
!
ops
->
init
||
(
err
=
ops
->
init
(
sch
,
tca
[
TCA_OPTIONS
-
1
]))
==
0
)
{
write_lock
(
&
qdisc_tree_lock
);
write_lock
(
&
qdisc_tree_lock
);
sch
->
next
=
dev
->
qdisc_list
;
sch
->
next
=
dev
->
qdisc_list
;
...
@@ -458,6 +463,7 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
...
@@ -458,6 +463,7 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
#endif
#endif
return
sch
;
return
sch
;
}
}
module_put
(
ops
->
owner
);
err_out:
err_out:
*
errp
=
err
;
*
errp
=
err
;
...
...
net/sched/sch_atm.c
View file @
3f0ccc08
...
@@ -575,7 +575,6 @@ static int atm_tc_init(struct Qdisc *sch,struct rtattr *opt)
...
@@ -575,7 +575,6 @@ static int atm_tc_init(struct Qdisc *sch,struct rtattr *opt)
p
->
link
.
ref
=
1
;
p
->
link
.
ref
=
1
;
p
->
link
.
next
=
NULL
;
p
->
link
.
next
=
NULL
;
tasklet_init
(
&
p
->
task
,
sch_atm_dequeue
,(
unsigned
long
)
sch
);
tasklet_init
(
&
p
->
task
,
sch_atm_dequeue
,(
unsigned
long
)
sch
);
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -612,7 +611,6 @@ static void atm_tc_destroy(struct Qdisc *sch)
...
@@ -612,7 +611,6 @@ static void atm_tc_destroy(struct Qdisc *sch)
}
}
}
}
tasklet_kill
(
&
p
->
task
);
tasklet_kill
(
&
p
->
task
);
MOD_DEC_USE_COUNT
;
}
}
...
@@ -663,41 +661,35 @@ static int atm_tc_dump(struct Qdisc *sch, struct sk_buff *skb)
...
@@ -663,41 +661,35 @@ static int atm_tc_dump(struct Qdisc *sch, struct sk_buff *skb)
return
0
;
return
0
;
}
}
static
struct
Qdisc_class_ops
atm_class_ops
=
static
struct
Qdisc_class_ops
atm_class_ops
=
{
{
.
graft
=
atm_tc_graft
,
.
graft
=
atm_tc_graft
,
.
leaf
=
atm_tc_leaf
,
.
leaf
=
atm_tc_leaf
,
.
get
=
atm_tc_get
,
.
get
=
atm_tc_get
,
.
put
=
atm_tc_put
,
.
put
=
atm_tc_put
,
.
change
=
atm_tc_change
,
.
change
=
atm_tc_change
,
.
delete
=
atm_tc_delete
,
.
delete
=
atm_tc_delete
,
.
walk
=
atm_tc_walk
,
.
walk
=
atm_tc_walk
,
.
tcf_chain
=
atm_tc_find_tcf
,
.
bind_tcf
=
atm_tc_bind_filter
,
.
tcf_chain
=
atm_tc_find_tcf
,
.
unbind_tcf
=
atm_tc_put
,
.
bind_tcf
=
atm_tc_bind_filter
,
.
dump
=
atm_tc_dump_class
,
.
unbind_tcf
=
atm_tc_put
,
.
dump
=
atm_tc_dump_class
,
};
};
struct
Qdisc_ops
atm_qdisc_ops
=
struct
Qdisc_ops
atm_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
&
atm_class_ops
,
.
cl_ops
=
&
atm_class_ops
,
.
id
=
"atm"
,
.
id
=
"atm"
,
.
priv_size
=
sizeof
(
struct
atm_qdisc_data
),
.
priv_size
=
sizeof
(
struct
atm_qdisc_data
),
.
enqueue
=
atm_tc_enqueue
,
.
dequeue
=
atm_tc_dequeue
,
.
enqueue
=
atm_tc_enqueue
,
.
requeue
=
atm_tc_requeue
,
.
dequeue
=
atm_tc_dequeue
,
.
drop
=
atm_tc_drop
,
.
requeue
=
atm_tc_requeue
,
.
init
=
atm_tc_init
,
.
drop
=
atm_tc_drop
,
.
reset
=
atm_tc_reset
,
.
destroy
=
atm_tc_destroy
,
.
init
=
atm_tc_init
,
.
change
=
NULL
,
.
reset
=
atm_tc_reset
,
.
dump
=
atm_tc_dump
,
.
destroy
=
atm_tc_destroy
,
.
owner
=
THIS_MODULE
,
.
change
=
NULL
,
.
dump
=
atm_tc_dump
};
};
...
...
net/sched/sch_cbq.c
View file @
3f0ccc08
...
@@ -1411,11 +1411,8 @@ static int cbq_init(struct Qdisc *sch, struct rtattr *opt)
...
@@ -1411,11 +1411,8 @@ static int cbq_init(struct Qdisc *sch, struct rtattr *opt)
r
=
RTA_DATA
(
tb
[
TCA_CBQ_RATE
-
1
]);
r
=
RTA_DATA
(
tb
[
TCA_CBQ_RATE
-
1
]);
MOD_INC_USE_COUNT
;
if
((
q
->
link
.
R_tab
=
qdisc_get_rtab
(
r
,
tb
[
TCA_CBQ_RTAB
-
1
]))
==
NULL
)
if
((
q
->
link
.
R_tab
=
qdisc_get_rtab
(
r
,
tb
[
TCA_CBQ_RTAB
-
1
]))
==
NULL
)
{
MOD_DEC_USE_COUNT
;
return
-
EINVAL
;
return
-
EINVAL
;
}
q
->
link
.
refcnt
=
1
;
q
->
link
.
refcnt
=
1
;
q
->
link
.
sibling
=
&
q
->
link
;
q
->
link
.
sibling
=
&
q
->
link
;
...
@@ -1749,7 +1746,6 @@ cbq_destroy(struct Qdisc* sch)
...
@@ -1749,7 +1746,6 @@ cbq_destroy(struct Qdisc* sch)
}
}
qdisc_put_rtab
(
q
->
link
.
R_tab
);
qdisc_put_rtab
(
q
->
link
.
R_tab
);
MOD_DEC_USE_COUNT
;
}
}
static
void
cbq_put
(
struct
Qdisc
*
sch
,
unsigned
long
arg
)
static
void
cbq_put
(
struct
Qdisc
*
sch
,
unsigned
long
arg
)
...
@@ -2064,41 +2060,35 @@ static void cbq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
...
@@ -2064,41 +2060,35 @@ static void cbq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
}
}
}
}
static
struct
Qdisc_class_ops
cbq_class_ops
=
static
struct
Qdisc_class_ops
cbq_class_ops
=
{
{
.
graft
=
cbq_graft
,
.
graft
=
cbq_graft
,
.
leaf
=
cbq_leaf
,
.
leaf
=
cbq_leaf
,
.
get
=
cbq_get
,
.
get
=
cbq_get
,
.
put
=
cbq_put
,
.
put
=
cbq_put
,
.
change
=
cbq_change_class
,
.
change
=
cbq_change_class
,
.
delete
=
cbq_delete
,
.
delete
=
cbq_delete
,
.
walk
=
cbq_walk
,
.
walk
=
cbq_walk
,
.
tcf_chain
=
cbq_find_tcf
,
.
bind_tcf
=
cbq_bind_filter
,
.
tcf_chain
=
cbq_find_tcf
,
.
unbind_tcf
=
cbq_unbind_filter
,
.
bind_tcf
=
cbq_bind_filter
,
.
dump
=
cbq_dump_class
,
.
unbind_tcf
=
cbq_unbind_filter
,
.
dump
=
cbq_dump_class
,
};
};
struct
Qdisc_ops
cbq_qdisc_ops
=
struct
Qdisc_ops
cbq_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
&
cbq_class_ops
,
.
cl_ops
=
&
cbq_class_ops
,
.
id
=
"cbq"
,
.
id
=
"cbq"
,
.
priv_size
=
sizeof
(
struct
cbq_sched_data
),
.
priv_size
=
sizeof
(
struct
cbq_sched_data
),
.
enqueue
=
cbq_enqueue
,
.
dequeue
=
cbq_dequeue
,
.
enqueue
=
cbq_enqueue
,
.
requeue
=
cbq_requeue
,
.
dequeue
=
cbq_dequeue
,
.
drop
=
cbq_drop
,
.
requeue
=
cbq_requeue
,
.
init
=
cbq_init
,
.
drop
=
cbq_drop
,
.
reset
=
cbq_reset
,
.
destroy
=
cbq_destroy
,
.
init
=
cbq_init
,
.
change
=
NULL
,
.
reset
=
cbq_reset
,
.
dump
=
cbq_dump
,
.
destroy
=
cbq_destroy
,
.
owner
=
THIS_MODULE
,
.
change
=
NULL
,
.
dump
=
cbq_dump
,
};
};
#ifdef MODULE
#ifdef MODULE
...
...
net/sched/sch_csz.c
View file @
3f0ccc08
...
@@ -756,8 +756,6 @@ csz_destroy(struct Qdisc* sch)
...
@@ -756,8 +756,6 @@ csz_destroy(struct Qdisc* sch)
q
->
filter_list
=
tp
->
next
;
q
->
filter_list
=
tp
->
next
;
tp
->
ops
->
destroy
(
tp
);
tp
->
ops
->
destroy
(
tp
);
}
}
MOD_DEC_USE_COUNT
;
}
}
static
int
csz_init
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
static
int
csz_init
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
...
@@ -799,7 +797,6 @@ static int csz_init(struct Qdisc *sch, struct rtattr *opt)
...
@@ -799,7 +797,6 @@ static int csz_init(struct Qdisc *sch, struct rtattr *opt)
q
->
wd_timer
.
data
=
(
unsigned
long
)
sch
;
q
->
wd_timer
.
data
=
(
unsigned
long
)
sch
;
q
->
wd_timer
.
function
=
csz_watchdog
;
q
->
wd_timer
.
function
=
csz_watchdog
;
#endif
#endif
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -1018,42 +1015,35 @@ static struct tcf_proto ** csz_find_tcf(struct Qdisc *sch, unsigned long cl)
...
@@ -1018,42 +1015,35 @@ static struct tcf_proto ** csz_find_tcf(struct Qdisc *sch, unsigned long cl)
return
&
q
->
filter_list
;
return
&
q
->
filter_list
;
}
}
struct
Qdisc_class_ops
csz_class_ops
=
struct
Qdisc_class_ops
csz_class_ops
=
{
{
.
graft
=
csz_graft
,
.
graft
=
csz_graft
,
.
leaf
=
csz_leaf
,
.
leaf
=
csz_leaf
,
.
get
=
csz_get
,
.
put
=
csz_put
,
.
get
=
csz_get
,
.
change
=
csz_change
,
.
put
=
csz_put
,
.
delete
=
csz_delete
,
.
change
=
csz_change
,
.
walk
=
csz_walk
,
.
delete
=
csz_delete
,
.
tcf_chain
=
csz_find_tcf
,
.
walk
=
csz_walk
,
.
bind_tcf
=
csz_bind
,
.
unbind_tcf
=
csz_put
,
.
tcf_chain
=
csz_find_tcf
,
.
dump
=
csz_dump_class
,
.
bind_tcf
=
csz_bind
,
.
unbind_tcf
=
csz_put
,
.
dump
=
csz_dump_class
,
};
};
struct
Qdisc_ops
csz_qdisc_ops
=
struct
Qdisc_ops
csz_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
&
csz_class_ops
,
.
cl_ops
=
&
csz_class_ops
,
.
id
=
"csz"
,
.
id
=
"csz"
,
.
priv_size
=
sizeof
(
struct
csz_sched_data
),
.
priv_size
=
sizeof
(
struct
csz_sched_data
),
.
enqueue
=
csz_enqueue
,
.
dequeue
=
csz_dequeue
,
.
enqueue
=
csz_enqueue
,
.
requeue
=
NULL
,
.
dequeue
=
csz_dequeue
,
.
drop
=
NULL
,
.
requeue
=
NULL
,
.
init
=
csz_init
,
.
drop
=
NULL
,
.
reset
=
csz_reset
,
.
destroy
=
csz_destroy
,
.
init
=
csz_init
,
.
change
=
NULL
,
.
reset
=
csz_reset
,
.
dump
=
csz_dump
,
.
destroy
=
csz_destroy
,
.
owner
=
THIS_MODULE
,
.
change
=
NULL
,
.
dump
=
csz_dump
,
};
};
...
...
net/sched/sch_dsmark.c
View file @
3f0ccc08
...
@@ -353,7 +353,6 @@ int dsmark_init(struct Qdisc *sch,struct rtattr *opt)
...
@@ -353,7 +353,6 @@ int dsmark_init(struct Qdisc *sch,struct rtattr *opt)
if
(
!
(
p
->
q
=
qdisc_create_dflt
(
sch
->
dev
,
&
pfifo_qdisc_ops
)))
if
(
!
(
p
->
q
=
qdisc_create_dflt
(
sch
->
dev
,
&
pfifo_qdisc_ops
)))
p
->
q
=
&
noop_qdisc
;
p
->
q
=
&
noop_qdisc
;
DPRINTK
(
"dsmark_init: qdisc %p
\n
"
,
&
p
->
q
);
DPRINTK
(
"dsmark_init: qdisc %p
\n
"
,
&
p
->
q
);
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -382,7 +381,6 @@ static void dsmark_destroy(struct Qdisc *sch)
...
@@ -382,7 +381,6 @@ static void dsmark_destroy(struct Qdisc *sch)
qdisc_destroy
(
p
->
q
);
qdisc_destroy
(
p
->
q
);
p
->
q
=
&
noop_qdisc
;
p
->
q
=
&
noop_qdisc
;
kfree
(
p
->
mask
);
kfree
(
p
->
mask
);
MOD_DEC_USE_COUNT
;
}
}
...
@@ -433,41 +431,35 @@ static int dsmark_dump(struct Qdisc *sch, struct sk_buff *skb)
...
@@ -433,41 +431,35 @@ static int dsmark_dump(struct Qdisc *sch, struct sk_buff *skb)
return
-
1
;
return
-
1
;
}
}
static
struct
Qdisc_class_ops
dsmark_class_ops
=
static
struct
Qdisc_class_ops
dsmark_class_ops
=
{
{
.
graft
=
dsmark_graft
,
.
graft
=
dsmark_graft
,
.
leaf
=
dsmark_leaf
,
.
leaf
=
dsmark_leaf
,
.
get
=
dsmark_get
,
.
get
=
dsmark_get
,
.
put
=
dsmark_put
,
.
put
=
dsmark_put
,
.
change
=
dsmark_change
,
.
change
=
dsmark_change
,
.
delete
=
dsmark_delete
,
.
delete
=
dsmark_delete
,
.
walk
=
dsmark_walk
,
.
walk
=
dsmark_walk
,
.
tcf_chain
=
dsmark_find_tcf
,
.
bind_tcf
=
dsmark_bind_filter
,
.
tcf_chain
=
dsmark_find_tcf
,
.
unbind_tcf
=
dsmark_put
,
.
bind_tcf
=
dsmark_bind_filter
,
.
dump
=
dsmark_dump_class
,
.
unbind_tcf
=
dsmark_put
,
.
dump
=
dsmark_dump_class
,
};
};
struct
Qdisc_ops
dsmark_qdisc_ops
=
struct
Qdisc_ops
dsmark_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
&
dsmark_class_ops
,
.
cl_ops
=
&
dsmark_class_ops
,
.
id
=
"dsmark"
,
.
id
=
"dsmark"
,
.
priv_size
=
sizeof
(
struct
dsmark_qdisc_data
),
.
priv_size
=
sizeof
(
struct
dsmark_qdisc_data
),
.
enqueue
=
dsmark_enqueue
,
.
dequeue
=
dsmark_dequeue
,
.
enqueue
=
dsmark_enqueue
,
.
requeue
=
dsmark_requeue
,
.
dequeue
=
dsmark_dequeue
,
.
drop
=
dsmark_drop
,
.
requeue
=
dsmark_requeue
,
.
init
=
dsmark_init
,
.
drop
=
dsmark_drop
,
.
reset
=
dsmark_reset
,
.
destroy
=
dsmark_destroy
,
.
init
=
dsmark_init
,
.
change
=
NULL
,
.
reset
=
dsmark_reset
,
.
dump
=
dsmark_dump
,
.
destroy
=
dsmark_destroy
,
.
owner
=
THIS_MODULE
,
.
change
=
NULL
,
.
dump
=
dsmark_dump
};
};
#ifdef MODULE
#ifdef MODULE
...
...
net/sched/sch_fifo.c
View file @
3f0ccc08
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
*/
*/
#include <linux/config.h>
#include <linux/config.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/bitops.h>
...
@@ -168,42 +169,36 @@ static int fifo_dump(struct Qdisc *sch, struct sk_buff *skb)
...
@@ -168,42 +169,36 @@ static int fifo_dump(struct Qdisc *sch, struct sk_buff *skb)
return
-
1
;
return
-
1
;
}
}
struct
Qdisc_ops
pfifo_qdisc_ops
=
struct
Qdisc_ops
pfifo_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
NULL
,
.
cl_ops
=
NULL
,
.
id
=
"pfifo"
,
.
id
=
"pfifo"
,
.
priv_size
=
sizeof
(
struct
fifo_sched_data
),
.
priv_size
=
sizeof
(
struct
fifo_sched_data
),
.
enqueue
=
pfifo_enqueue
,
.
dequeue
=
pfifo_dequeue
,
.
enqueue
=
pfifo_enqueue
,
.
requeue
=
pfifo_requeue
,
.
dequeue
=
pfifo_dequeue
,
.
drop
=
fifo_drop
,
.
requeue
=
pfifo_requeue
,
.
init
=
fifo_init
,
.
drop
=
fifo_drop
,
.
reset
=
fifo_reset
,
.
destroy
=
NULL
,
.
init
=
fifo_init
,
.
change
=
fifo_init
,
.
reset
=
fifo_reset
,
.
dump
=
fifo_dump
,
.
destroy
=
NULL
,
.
owner
=
THIS_MODULE
,
.
change
=
fifo_init
,
.
dump
=
fifo_dump
,
};
};
struct
Qdisc_ops
bfifo_qdisc_ops
=
struct
Qdisc_ops
bfifo_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
NULL
,
.
cl_ops
=
NULL
,
.
id
=
"bfifo"
,
.
id
=
"bfifo"
,
.
priv_size
=
sizeof
(
struct
fifo_sched_data
),
.
priv_size
=
sizeof
(
struct
fifo_sched_data
),
.
enqueue
=
bfifo_enqueue
,
.
dequeue
=
bfifo_dequeue
,
.
enqueue
=
bfifo_enqueue
,
.
requeue
=
bfifo_requeue
,
.
dequeue
=
bfifo_dequeue
,
.
drop
=
fifo_drop
,
.
requeue
=
bfifo_requeue
,
.
init
=
fifo_init
,
.
drop
=
fifo_drop
,
.
reset
=
fifo_reset
,
.
destroy
=
NULL
,
.
init
=
fifo_init
,
.
change
=
fifo_init
,
.
reset
=
fifo_reset
,
.
dump
=
fifo_dump
,
.
destroy
=
NULL
,
.
owner
=
THIS_MODULE
,
.
change
=
fifo_init
,
.
dump
=
fifo_dump
,
};
};
net/sched/sch_generic.c
View file @
3f0ccc08
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include <asm/system.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <asm/bitops.h>
#include <linux/config.h>
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/sched.h>
...
@@ -222,45 +223,40 @@ noop_requeue(struct sk_buff *skb, struct Qdisc* qdisc)
...
@@ -222,45 +223,40 @@ noop_requeue(struct sk_buff *skb, struct Qdisc* qdisc)
return
NET_XMIT_CN
;
return
NET_XMIT_CN
;
}
}
struct
Qdisc_ops
noop_qdisc_ops
=
struct
Qdisc_ops
noop_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
NULL
,
.
cl_ops
=
NULL
,
.
id
=
"noop"
,
.
id
=
"noop"
,
.
priv_size
=
0
,
.
priv_size
=
0
,
.
enqueue
=
noop_enqueue
,
.
dequeue
=
noop_dequeue
,
.
enqueue
=
noop_enqueue
,
.
requeue
=
noop_requeue
,
.
dequeue
=
noop_dequeue
,
.
owner
=
THIS_MODULE
,
.
requeue
=
noop_requeue
,
};
};
struct
Qdisc
noop_qdisc
=
struct
Qdisc
noop_qdisc
=
{
{
.
enqueue
=
noop_enqueue
,
.
enqueue
=
noop_enqueue
,
.
dequeue
=
noop_dequeue
,
.
dequeue
=
noop_dequeue
,
.
flags
=
TCQ_F_BUILTIN
,
.
flags
=
TCQ_F_BUILTIN
,
.
ops
=
&
noop_qdisc_ops
,
.
ops
=
&
noop_qdisc_ops
,
};
};
struct
Qdisc_ops
noqueue_qdisc_ops
=
{
struct
Qdisc_ops
noqueue_qdisc_ops
=
.
next
=
NULL
,
{
.
cl_ops
=
NULL
,
.
next
=
NULL
,
.
id
=
"noqueue"
,
.
cl_ops
=
NULL
,
.
priv_size
=
0
,
.
id
=
"noqueue"
,
.
enqueue
=
noop_enqueue
,
.
priv_size
=
0
,
.
dequeue
=
noop_dequeue
,
.
requeue
=
noop_requeue
,
.
enqueue
=
noop_enqueue
,
.
owner
=
THIS_MODULE
,
.
dequeue
=
noop_dequeue
,
.
requeue
=
noop_requeue
,
};
};
struct
Qdisc
noqueue_qdisc
=
struct
Qdisc
noqueue_qdisc
=
{
{
.
enqueue
=
NULL
,
.
enqueue
=
NULL
,
.
dequeue
=
noop_dequeue
,
.
dequeue
=
noop_dequeue
,
.
flags
=
TCQ_F_BUILTIN
,
.
flags
=
TCQ_F_BUILTIN
,
.
ops
=
&
noqueue_qdisc_ops
,
.
ops
=
&
noqueue_qdisc_ops
,
};
};
...
@@ -343,19 +339,17 @@ static int pfifo_fast_init(struct Qdisc *qdisc, struct rtattr *opt)
...
@@ -343,19 +339,17 @@ static int pfifo_fast_init(struct Qdisc *qdisc, struct rtattr *opt)
return
0
;
return
0
;
}
}
static
struct
Qdisc_ops
pfifo_fast_ops
=
static
struct
Qdisc_ops
pfifo_fast_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
NULL
,
.
cl_ops
=
NULL
,
.
id
=
"pfifo_fast"
,
.
id
=
"pfifo_fast"
,
.
priv_size
=
3
*
sizeof
(
struct
sk_buff_head
),
.
priv_size
=
3
*
sizeof
(
struct
sk_buff_head
),
.
enqueue
=
pfifo_fast_enqueue
,
.
dequeue
=
pfifo_fast_dequeue
,
.
enqueue
=
pfifo_fast_enqueue
,
.
requeue
=
pfifo_fast_requeue
,
.
dequeue
=
pfifo_fast_dequeue
,
.
init
=
pfifo_fast_init
,
.
requeue
=
pfifo_fast_requeue
,
.
reset
=
pfifo_fast_reset
,
.
owner
=
THIS_MODULE
,
.
init
=
pfifo_fast_init
,
.
reset
=
pfifo_fast_reset
,
};
};
struct
Qdisc
*
qdisc_create_dflt
(
struct
net_device
*
dev
,
struct
Qdisc_ops
*
ops
)
struct
Qdisc
*
qdisc_create_dflt
(
struct
net_device
*
dev
,
struct
Qdisc_ops
*
ops
)
...
@@ -422,6 +416,7 @@ void qdisc_destroy(struct Qdisc *qdisc)
...
@@ -422,6 +416,7 @@ void qdisc_destroy(struct Qdisc *qdisc)
ops
->
reset
(
qdisc
);
ops
->
reset
(
qdisc
);
if
(
ops
->
destroy
)
if
(
ops
->
destroy
)
ops
->
destroy
(
qdisc
);
ops
->
destroy
(
qdisc
);
module_put
(
ops
->
owner
);
if
(
!
(
qdisc
->
flags
&
TCQ_F_BUILTIN
))
if
(
!
(
qdisc
->
flags
&
TCQ_F_BUILTIN
))
kfree
(
qdisc
);
kfree
(
qdisc
);
}
}
...
...
net/sched/sch_gred.c
View file @
3f0ccc08
...
@@ -348,7 +348,6 @@ static int gred_change(struct Qdisc *sch, struct rtattr *opt)
...
@@ -348,7 +348,6 @@ static int gred_change(struct Qdisc *sch, struct rtattr *opt)
table
->
grio
=
sopt
->
grio
;
table
->
grio
=
sopt
->
grio
;
table
->
initd
=
0
;
table
->
initd
=
0
;
/* probably need to clear all the table DP entries as well */
/* probably need to clear all the table DP entries as well */
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -490,7 +489,6 @@ static int gred_init(struct Qdisc *sch, struct rtattr *opt)
...
@@ -490,7 +489,6 @@ static int gred_init(struct Qdisc *sch, struct rtattr *opt)
table
->
def
=
sopt
->
def_DP
;
table
->
def
=
sopt
->
def_DP
;
table
->
grio
=
sopt
->
grio
;
table
->
grio
=
sopt
->
grio
;
table
->
initd
=
0
;
table
->
initd
=
0
;
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -602,27 +600,23 @@ static void gred_destroy(struct Qdisc *sch)
...
@@ -602,27 +600,23 @@ static void gred_destroy(struct Qdisc *sch)
if
(
table
->
tab
[
i
])
if
(
table
->
tab
[
i
])
kfree
(
table
->
tab
[
i
]);
kfree
(
table
->
tab
[
i
]);
}
}
MOD_DEC_USE_COUNT
;
}
}
struct
Qdisc_ops
gred_qdisc_ops
=
struct
Qdisc_ops
gred_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
NULL
,
.
cl_ops
=
NULL
,
.
id
=
"gred"
,
.
id
=
"gred"
,
.
priv_size
=
sizeof
(
struct
gred_sched
),
.
priv_size
=
sizeof
(
struct
gred_sched
),
.
enqueue
=
gred_enqueue
,
.
dequeue
=
gred_dequeue
,
.
enqueue
=
gred_enqueue
,
.
requeue
=
gred_requeue
,
.
dequeue
=
gred_dequeue
,
.
drop
=
gred_drop
,
.
requeue
=
gred_requeue
,
.
init
=
gred_init
,
.
drop
=
gred_drop
,
.
reset
=
gred_reset
,
.
destroy
=
gred_destroy
,
.
init
=
gred_init
,
.
change
=
gred_change
,
.
reset
=
gred_reset
,
.
dump
=
gred_dump
,
.
destroy
=
gred_destroy
,
.
owner
=
THIS_MODULE
,
.
change
=
gred_change
,
.
dump
=
gred_dump
,
};
};
...
...
net/sched/sch_htb.c
View file @
3f0ccc08
...
@@ -1167,7 +1167,6 @@ static int htb_init(struct Qdisc *sch, struct rtattr *opt)
...
@@ -1167,7 +1167,6 @@ static int htb_init(struct Qdisc *sch, struct rtattr *opt)
q
->
rate2quantum
=
1
;
q
->
rate2quantum
=
1
;
q
->
defcls
=
gopt
->
defcls
;
q
->
defcls
=
gopt
->
defcls
;
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -1352,7 +1351,6 @@ static void htb_destroy(struct Qdisc* sch)
...
@@ -1352,7 +1351,6 @@ static void htb_destroy(struct Qdisc* sch)
htb_destroy_filters
(
&
q
->
filter_list
);
htb_destroy_filters
(
&
q
->
filter_list
);
__skb_queue_purge
(
&
q
->
direct_queue
);
__skb_queue_purge
(
&
q
->
direct_queue
);
MOD_DEC_USE_COUNT
;
}
}
static
int
htb_delete
(
struct
Qdisc
*
sch
,
unsigned
long
arg
)
static
int
htb_delete
(
struct
Qdisc
*
sch
,
unsigned
long
arg
)
...
@@ -1588,41 +1586,35 @@ static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg)
...
@@ -1588,41 +1586,35 @@ static void htb_walk(struct Qdisc *sch, struct qdisc_walker *arg)
}
}
}
}
static
struct
Qdisc_class_ops
htb_class_ops
=
static
struct
Qdisc_class_ops
htb_class_ops
=
{
{
.
graft
=
htb_graft
,
htb_graft
,
.
leaf
=
htb_leaf
,
htb_leaf
,
.
get
=
htb_get
,
htb_get
,
.
put
=
htb_put
,
htb_put
,
.
change
=
htb_change_class
,
htb_change_class
,
.
delete
=
htb_delete
,
htb_delete
,
.
walk
=
htb_walk
,
htb_walk
,
.
tcf_chain
=
htb_find_tcf
,
.
bind_tcf
=
htb_bind_filter
,
htb_find_tcf
,
.
unbind_tcf
=
htb_unbind_filter
,
htb_bind_filter
,
.
dump
=
htb_dump_class
,
htb_unbind_filter
,
htb_dump_class
,
};
};
struct
Qdisc_ops
htb_qdisc_ops
=
struct
Qdisc_ops
htb_qdisc_ops
=
{
{
.
next
=
NULL
,
NULL
,
.
cl_ops
=
&
htb_class_ops
,
&
htb_class_ops
,
.
id
=
"htb"
,
"htb"
,
.
priv_size
=
sizeof
(
struct
htb_sched
),
sizeof
(
struct
htb_sched
),
.
enqueue
=
htb_enqueue
,
.
dequeue
=
htb_dequeue
,
htb_enqueue
,
.
requeue
=
htb_requeue
,
htb_dequeue
,
.
drop
=
htb_drop
,
htb_requeue
,
.
init
=
htb_init
,
htb_drop
,
.
reset
=
htb_reset
,
.
destroy
=
htb_destroy
,
htb_init
,
.
change
=
NULL
/* htb_change */
,
htb_reset
,
.
dump
=
htb_dump
,
htb_destroy
,
.
owner
=
THIS_MODULE
,
NULL
/* htb_change */
,
htb_dump
,
};
};
#ifdef MODULE
#ifdef MODULE
...
...
net/sched/sch_ingress.c
View file @
3f0ccc08
...
@@ -262,7 +262,6 @@ int ingress_init(struct Qdisc *sch,struct rtattr *opt)
...
@@ -262,7 +262,6 @@ int ingress_init(struct Qdisc *sch,struct rtattr *opt)
memset
(
p
,
0
,
sizeof
(
*
p
));
memset
(
p
,
0
,
sizeof
(
*
p
));
p
->
filter_list
=
NULL
;
p
->
filter_list
=
NULL
;
p
->
q
=
&
noop_qdisc
;
p
->
q
=
&
noop_qdisc
;
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
error:
error:
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -308,9 +307,6 @@ static void ingress_destroy(struct Qdisc *sch)
...
@@ -308,9 +307,6 @@ static void ingress_destroy(struct Qdisc *sch)
/* for future use */
/* for future use */
qdisc_destroy(p->q);
qdisc_destroy(p->q);
#endif
#endif
MOD_DEC_USE_COUNT
;
}
}
...
@@ -329,41 +325,35 @@ static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb)
...
@@ -329,41 +325,35 @@ static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb)
return
-
1
;
return
-
1
;
}
}
static
struct
Qdisc_class_ops
ingress_class_ops
=
static
struct
Qdisc_class_ops
ingress_class_ops
=
{
{
.
graft
=
ingress_graft
,
.
graft
=
ingress_graft
,
.
leaf
=
ingress_leaf
,
.
leaf
=
ingress_leaf
,
.
get
=
ingress_get
,
.
get
=
ingress_get
,
.
put
=
ingress_put
,
.
put
=
ingress_put
,
.
change
=
ingress_change
,
.
change
=
ingress_change
,
.
delete
=
NULL
,
.
delete
=
NULL
,
.
walk
=
ingress_walk
,
.
walk
=
ingress_walk
,
.
tcf_chain
=
ingress_find_tcf
,
.
bind_tcf
=
ingress_bind_filter
,
.
tcf_chain
=
ingress_find_tcf
,
.
unbind_tcf
=
ingress_put
,
.
bind_tcf
=
ingress_bind_filter
,
.
dump
=
NULL
,
.
unbind_tcf
=
ingress_put
,
.
dump
=
NULL
,
};
};
struct
Qdisc_ops
ingress_qdisc_ops
=
struct
Qdisc_ops
ingress_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
&
ingress_class_ops
,
.
cl_ops
=
&
ingress_class_ops
,
.
id
=
"ingress"
,
.
id
=
"ingress"
,
.
priv_size
=
sizeof
(
struct
ingress_qdisc_data
),
.
priv_size
=
sizeof
(
struct
ingress_qdisc_data
),
.
enqueue
=
ingress_enqueue
,
.
dequeue
=
ingress_dequeue
,
.
enqueue
=
ingress_enqueue
,
.
requeue
=
ingress_requeue
,
.
dequeue
=
ingress_dequeue
,
.
drop
=
ingress_drop
,
.
requeue
=
ingress_requeue
,
.
init
=
ingress_init
,
.
drop
=
ingress_drop
,
.
reset
=
ingress_reset
,
.
destroy
=
ingress_destroy
,
.
init
=
ingress_init
,
.
change
=
NULL
,
.
reset
=
ingress_reset
,
.
dump
=
ingress_dump
,
.
destroy
=
ingress_destroy
,
.
owner
=
THIS_MODULE
,
.
change
=
NULL
,
.
dump
=
ingress_dump
,
};
};
...
...
net/sched/sch_prio.c
View file @
3f0ccc08
...
@@ -169,7 +169,6 @@ prio_destroy(struct Qdisc* sch)
...
@@ -169,7 +169,6 @@ prio_destroy(struct Qdisc* sch)
qdisc_destroy
(
q
->
queues
[
prio
]);
qdisc_destroy
(
q
->
queues
[
prio
]);
q
->
queues
[
prio
]
=
&
noop_qdisc
;
q
->
queues
[
prio
]
=
&
noop_qdisc
;
}
}
MOD_DEC_USE_COUNT
;
}
}
static
int
prio_tune
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
static
int
prio_tune
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
...
@@ -233,7 +232,6 @@ static int prio_init(struct Qdisc *sch, struct rtattr *opt)
...
@@ -233,7 +232,6 @@ static int prio_init(struct Qdisc *sch, struct rtattr *opt)
if
((
err
=
prio_tune
(
sch
,
opt
))
!=
0
)
if
((
err
=
prio_tune
(
sch
,
opt
))
!=
0
)
return
err
;
return
err
;
}
}
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -369,42 +367,35 @@ static struct tcf_proto ** prio_find_tcf(struct Qdisc *sch, unsigned long cl)
...
@@ -369,42 +367,35 @@ static struct tcf_proto ** prio_find_tcf(struct Qdisc *sch, unsigned long cl)
return
&
q
->
filter_list
;
return
&
q
->
filter_list
;
}
}
static
struct
Qdisc_class_ops
prio_class_ops
=
static
struct
Qdisc_class_ops
prio_class_ops
=
{
{
.
graft
=
prio_graft
,
.
graft
=
prio_graft
,
.
leaf
=
prio_leaf
,
.
leaf
=
prio_leaf
,
.
get
=
prio_get
,
.
put
=
prio_put
,
.
get
=
prio_get
,
.
change
=
prio_change
,
.
put
=
prio_put
,
.
delete
=
prio_delete
,
.
change
=
prio_change
,
.
walk
=
prio_walk
,
.
delete
=
prio_delete
,
.
tcf_chain
=
prio_find_tcf
,
.
walk
=
prio_walk
,
.
bind_tcf
=
prio_bind
,
.
unbind_tcf
=
prio_put
,
.
tcf_chain
=
prio_find_tcf
,
.
dump
=
prio_dump_class
,
.
bind_tcf
=
prio_bind
,
.
unbind_tcf
=
prio_put
,
.
dump
=
prio_dump_class
,
};
};
struct
Qdisc_ops
prio_qdisc_ops
=
struct
Qdisc_ops
prio_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
&
prio_class_ops
,
.
cl_ops
=
&
prio_class_ops
,
.
id
=
"prio"
,
.
id
=
"prio"
,
.
priv_size
=
sizeof
(
struct
prio_sched_data
),
.
priv_size
=
sizeof
(
struct
prio_sched_data
),
.
enqueue
=
prio_enqueue
,
.
dequeue
=
prio_dequeue
,
.
enqueue
=
prio_enqueue
,
.
requeue
=
prio_requeue
,
.
dequeue
=
prio_dequeue
,
.
drop
=
prio_drop
,
.
requeue
=
prio_requeue
,
.
init
=
prio_init
,
.
drop
=
prio_drop
,
.
reset
=
prio_reset
,
.
destroy
=
prio_destroy
,
.
init
=
prio_init
,
.
change
=
prio_tune
,
.
reset
=
prio_reset
,
.
dump
=
prio_dump
,
.
destroy
=
prio_destroy
,
.
owner
=
THIS_MODULE
,
.
change
=
prio_tune
,
.
dump
=
prio_dump
,
};
};
#ifdef MODULE
#ifdef MODULE
...
...
net/sched/sch_red.c
View file @
3f0ccc08
...
@@ -407,14 +407,7 @@ static int red_change(struct Qdisc *sch, struct rtattr *opt)
...
@@ -407,14 +407,7 @@ static int red_change(struct Qdisc *sch, struct rtattr *opt)
static
int
red_init
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
static
int
red_init
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
{
{
int
err
;
return
red_change
(
sch
,
opt
);
MOD_INC_USE_COUNT
;
if
((
err
=
red_change
(
sch
,
opt
))
!=
0
)
{
MOD_DEC_USE_COUNT
;
}
return
err
;
}
}
...
@@ -458,27 +451,23 @@ static int red_dump(struct Qdisc *sch, struct sk_buff *skb)
...
@@ -458,27 +451,23 @@ static int red_dump(struct Qdisc *sch, struct sk_buff *skb)
static
void
red_destroy
(
struct
Qdisc
*
sch
)
static
void
red_destroy
(
struct
Qdisc
*
sch
)
{
{
MOD_DEC_USE_COUNT
;
}
}
struct
Qdisc_ops
red_qdisc_ops
=
struct
Qdisc_ops
red_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
NULL
,
.
cl_ops
=
NULL
,
.
id
=
"red"
,
.
id
=
"red"
,
.
priv_size
=
sizeof
(
struct
red_sched_data
),
.
priv_size
=
sizeof
(
struct
red_sched_data
),
.
enqueue
=
red_enqueue
,
.
dequeue
=
red_dequeue
,
.
enqueue
=
red_enqueue
,
.
requeue
=
red_requeue
,
.
dequeue
=
red_dequeue
,
.
drop
=
red_drop
,
.
requeue
=
red_requeue
,
.
init
=
red_init
,
.
drop
=
red_drop
,
.
reset
=
red_reset
,
.
destroy
=
red_destroy
,
.
init
=
red_init
,
.
change
=
red_change
,
.
reset
=
red_reset
,
.
dump
=
red_dump
,
.
destroy
=
red_destroy
,
.
owner
=
THIS_MODULE
,
.
change
=
red_change
,
.
dump
=
red_dump
,
};
};
...
...
net/sched/sch_sfq.c
View file @
3f0ccc08
...
@@ -431,7 +431,6 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt)
...
@@ -431,7 +431,6 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt)
}
}
for
(
i
=
0
;
i
<
SFQ_DEPTH
;
i
++
)
for
(
i
=
0
;
i
<
SFQ_DEPTH
;
i
++
)
sfq_link
(
q
,
i
);
sfq_link
(
q
,
i
);
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -439,7 +438,6 @@ static void sfq_destroy(struct Qdisc *sch)
...
@@ -439,7 +438,6 @@ static void sfq_destroy(struct Qdisc *sch)
{
{
struct
sfq_sched_data
*
q
=
(
struct
sfq_sched_data
*
)
sch
->
data
;
struct
sfq_sched_data
*
q
=
(
struct
sfq_sched_data
*
)
sch
->
data
;
del_timer
(
&
q
->
perturb_timer
);
del_timer
(
&
q
->
perturb_timer
);
MOD_DEC_USE_COUNT
;
}
}
static
int
sfq_dump
(
struct
Qdisc
*
sch
,
struct
sk_buff
*
skb
)
static
int
sfq_dump
(
struct
Qdisc
*
sch
,
struct
sk_buff
*
skb
)
...
@@ -464,24 +462,21 @@ static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb)
...
@@ -464,24 +462,21 @@ static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb)
return
-
1
;
return
-
1
;
}
}
struct
Qdisc_ops
sfq_qdisc_ops
=
struct
Qdisc_ops
sfq_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
NULL
,
.
cl_ops
=
NULL
,
.
id
=
"sfq"
,
.
id
=
"sfq"
,
.
priv_size
=
sizeof
(
struct
sfq_sched_data
),
.
priv_size
=
sizeof
(
struct
sfq_sched_data
),
.
enqueue
=
sfq_enqueue
,
.
dequeue
=
sfq_dequeue
,
.
enqueue
=
sfq_enqueue
,
.
requeue
=
sfq_requeue
,
.
dequeue
=
sfq_dequeue
,
.
drop
=
sfq_drop
,
.
requeue
=
sfq_requeue
,
.
init
=
sfq_init
,
.
drop
=
sfq_drop
,
.
reset
=
sfq_reset
,
.
destroy
=
sfq_destroy
,
.
init
=
sfq_init
,
.
change
=
NULL
,
.
reset
=
sfq_reset
,
.
dump
=
sfq_dump
,
.
destroy
=
sfq_destroy
,
.
owner
=
THIS_MODULE
,
.
change
=
NULL
,
.
dump
=
sfq_dump
,
};
};
#ifdef MODULE
#ifdef MODULE
...
...
net/sched/sch_tbf.c
View file @
3f0ccc08
...
@@ -330,23 +330,17 @@ static int tbf_change(struct Qdisc* sch, struct rtattr *opt)
...
@@ -330,23 +330,17 @@ static int tbf_change(struct Qdisc* sch, struct rtattr *opt)
static
int
tbf_init
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
static
int
tbf_init
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
{
{
int
err
;
struct
tbf_sched_data
*
q
=
(
struct
tbf_sched_data
*
)
sch
->
data
;
struct
tbf_sched_data
*
q
=
(
struct
tbf_sched_data
*
)
sch
->
data
;
if
(
opt
==
NULL
)
if
(
opt
==
NULL
)
return
-
EINVAL
;
return
-
EINVAL
;
MOD_INC_USE_COUNT
;
PSCHED_GET_TIME
(
q
->
t_c
);
PSCHED_GET_TIME
(
q
->
t_c
);
init_timer
(
&
q
->
wd_timer
);
init_timer
(
&
q
->
wd_timer
);
q
->
wd_timer
.
function
=
tbf_watchdog
;
q
->
wd_timer
.
function
=
tbf_watchdog
;
q
->
wd_timer
.
data
=
(
unsigned
long
)
sch
;
q
->
wd_timer
.
data
=
(
unsigned
long
)
sch
;
if
((
err
=
tbf_change
(
sch
,
opt
))
!=
0
)
{
return
tbf_change
(
sch
,
opt
);
MOD_DEC_USE_COUNT
;
}
return
err
;
}
}
static
void
tbf_destroy
(
struct
Qdisc
*
sch
)
static
void
tbf_destroy
(
struct
Qdisc
*
sch
)
...
@@ -359,8 +353,6 @@ static void tbf_destroy(struct Qdisc *sch)
...
@@ -359,8 +353,6 @@ static void tbf_destroy(struct Qdisc *sch)
qdisc_put_rtab
(
q
->
P_tab
);
qdisc_put_rtab
(
q
->
P_tab
);
if
(
q
->
R_tab
)
if
(
q
->
R_tab
)
qdisc_put_rtab
(
q
->
R_tab
);
qdisc_put_rtab
(
q
->
R_tab
);
MOD_DEC_USE_COUNT
;
}
}
static
int
tbf_dump
(
struct
Qdisc
*
sch
,
struct
sk_buff
*
skb
)
static
int
tbf_dump
(
struct
Qdisc
*
sch
,
struct
sk_buff
*
skb
)
...
@@ -391,24 +383,20 @@ static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb)
...
@@ -391,24 +383,20 @@ static int tbf_dump(struct Qdisc *sch, struct sk_buff *skb)
return
-
1
;
return
-
1
;
}
}
struct
Qdisc_ops
tbf_qdisc_ops
=
struct
Qdisc_ops
tbf_qdisc_ops
=
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
NULL
,
.
cl_ops
=
NULL
,
.
id
=
"tbf"
,
.
id
=
"tbf"
,
.
priv_size
=
sizeof
(
struct
tbf_sched_data
),
.
priv_size
=
sizeof
(
struct
tbf_sched_data
),
.
enqueue
=
tbf_enqueue
,
.
dequeue
=
tbf_dequeue
,
.
enqueue
=
tbf_enqueue
,
.
requeue
=
tbf_requeue
,
.
dequeue
=
tbf_dequeue
,
.
drop
=
tbf_drop
,
.
requeue
=
tbf_requeue
,
.
init
=
tbf_init
,
.
drop
=
tbf_drop
,
.
reset
=
tbf_reset
,
.
destroy
=
tbf_destroy
,
.
init
=
tbf_init
,
.
change
=
tbf_change
,
.
reset
=
tbf_reset
,
.
dump
=
tbf_dump
,
.
destroy
=
tbf_destroy
,
.
change
=
tbf_change
,
.
dump
=
tbf_dump
,
};
};
...
...
net/sched/sch_teql.c
View file @
3f0ccc08
...
@@ -177,8 +177,6 @@ teql_destroy(struct Qdisc* sch)
...
@@ -177,8 +177,6 @@ teql_destroy(struct Qdisc* sch)
}
while
((
prev
=
q
)
!=
master
->
slaves
);
}
while
((
prev
=
q
)
!=
master
->
slaves
);
}
}
MOD_DEC_USE_COUNT
;
}
}
static
int
teql_qdisc_init
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
static
int
teql_qdisc_init
(
struct
Qdisc
*
sch
,
struct
rtattr
*
opt
)
...
@@ -222,8 +220,6 @@ static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt)
...
@@ -222,8 +220,6 @@ static int teql_qdisc_init(struct Qdisc *sch, struct rtattr *opt)
m
->
dev
.
mtu
=
dev
->
mtu
;
m
->
dev
.
mtu
=
dev
->
mtu
;
m
->
dev
.
flags
=
(
m
->
dev
.
flags
&~
FMASK
)
|
(
dev
->
flags
&
FMASK
);
m
->
dev
.
flags
=
(
m
->
dev
.
flags
&~
FMASK
)
|
(
dev
->
flags
&
FMASK
);
}
}
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -386,14 +382,12 @@ static int teql_master_open(struct net_device *dev)
...
@@ -386,14 +382,12 @@ static int teql_master_open(struct net_device *dev)
m
->
dev
.
mtu
=
mtu
;
m
->
dev
.
mtu
=
mtu
;
m
->
dev
.
flags
=
(
m
->
dev
.
flags
&~
FMASK
)
|
flags
;
m
->
dev
.
flags
=
(
m
->
dev
.
flags
&~
FMASK
)
|
flags
;
netif_start_queue
(
&
m
->
dev
);
netif_start_queue
(
&
m
->
dev
);
MOD_INC_USE_COUNT
;
return
0
;
return
0
;
}
}
static
int
teql_master_close
(
struct
net_device
*
dev
)
static
int
teql_master_close
(
struct
net_device
*
dev
)
{
{
netif_stop_queue
(
dev
);
netif_stop_queue
(
dev
);
MOD_DEC_USE_COUNT
;
return
0
;
return
0
;
}
}
...
@@ -440,20 +434,19 @@ static int teql_master_init(struct net_device *dev)
...
@@ -440,20 +434,19 @@ static int teql_master_init(struct net_device *dev)
static
struct
teql_master
the_master
=
{
static
struct
teql_master
the_master
=
{
{
{
.
next
=
NULL
,
.
next
=
NULL
,
.
cl_ops
=
NULL
,
.
cl_ops
=
NULL
,
.
id
=
""
,
.
id
=
""
,
.
priv_size
=
sizeof
(
struct
teql_sched_data
),
.
priv_size
=
sizeof
(
struct
teql_sched_data
),
.
enqueue
=
teql_enqueue
,
.
enqueue
=
teql_enqueue
,
.
dequeue
=
teql_dequeue
,
.
dequeue
=
teql_dequeue
,
.
requeue
=
teql_requeue
,
.
requeue
=
teql_requeue
,
.
drop
=
NULL
,
.
drop
=
NULL
,
.
init
=
teql_qdisc_init
,
.
reset
=
teql_reset
,
.
init
=
teql_qdisc_init
,
.
destroy
=
teql_destroy
,
.
reset
=
teql_reset
,
.
dump
=
NULL
,
.
destroy
=
teql_destroy
,
.
owner
=
THIS_MODULE
,
.
dump
=
NULL
,
},};
},};
...
@@ -474,6 +467,7 @@ int __init teql_init(void)
...
@@ -474,6 +467,7 @@ int __init teql_init(void)
memcpy
(
the_master
.
qops
.
id
,
the_master
.
dev
.
name
,
IFNAMSIZ
);
memcpy
(
the_master
.
qops
.
id
,
the_master
.
dev
.
name
,
IFNAMSIZ
);
the_master
.
dev
.
init
=
teql_master_init
;
the_master
.
dev
.
init
=
teql_master_init
;
SET_MODULE_OWNER
(
&
the_master
.
dev
);
err
=
register_netdevice
(
&
the_master
.
dev
);
err
=
register_netdevice
(
&
the_master
.
dev
);
if
(
err
==
0
)
{
if
(
err
==
0
)
{
err
=
register_qdisc
(
&
the_master
.
qops
);
err
=
register_qdisc
(
&
the_master
.
qops
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment