mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-03 13:04:01 +00:00
net: sched: use pfifo_fast for non real queues
Some devices declare a high number of TX queues, then set a much lower real_num_tx_queues This cause setups using fq_codel, sfq or fq as the default qdisc to consume more memory than really needed. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
799977d9aa
commit
1f27cde313
4 changed files with 10 additions and 2 deletions
|
@ -345,6 +345,12 @@ extern struct Qdisc_ops pfifo_fast_ops;
|
||||||
extern struct Qdisc_ops mq_qdisc_ops;
|
extern struct Qdisc_ops mq_qdisc_ops;
|
||||||
extern struct Qdisc_ops noqueue_qdisc_ops;
|
extern struct Qdisc_ops noqueue_qdisc_ops;
|
||||||
extern const struct Qdisc_ops *default_qdisc_ops;
|
extern const struct Qdisc_ops *default_qdisc_ops;
|
||||||
|
static inline const struct Qdisc_ops *
|
||||||
|
get_default_qdisc_ops(const struct net_device *dev, int ntx)
|
||||||
|
{
|
||||||
|
return ntx < dev->real_num_tx_queues ?
|
||||||
|
default_qdisc_ops : &pfifo_fast_ops;
|
||||||
|
}
|
||||||
|
|
||||||
struct Qdisc_class_common {
|
struct Qdisc_class_common {
|
||||||
u32 classid;
|
u32 classid;
|
||||||
|
|
|
@ -567,6 +567,7 @@ struct Qdisc_ops pfifo_fast_ops __read_mostly = {
|
||||||
.dump = pfifo_fast_dump,
|
.dump = pfifo_fast_dump,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
};
|
};
|
||||||
|
EXPORT_SYMBOL(pfifo_fast_ops);
|
||||||
|
|
||||||
static struct lock_class_key qdisc_tx_busylock;
|
static struct lock_class_key qdisc_tx_busylock;
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ static int mq_init(struct Qdisc *sch, struct nlattr *opt)
|
||||||
|
|
||||||
for (ntx = 0; ntx < dev->num_tx_queues; ntx++) {
|
for (ntx = 0; ntx < dev->num_tx_queues; ntx++) {
|
||||||
dev_queue = netdev_get_tx_queue(dev, ntx);
|
dev_queue = netdev_get_tx_queue(dev, ntx);
|
||||||
qdisc = qdisc_create_dflt(dev_queue, default_qdisc_ops,
|
qdisc = qdisc_create_dflt(dev_queue, get_default_qdisc_ops(dev, ntx),
|
||||||
TC_H_MAKE(TC_H_MAJ(sch->handle),
|
TC_H_MAKE(TC_H_MAJ(sch->handle),
|
||||||
TC_H_MIN(ntx + 1)));
|
TC_H_MIN(ntx + 1)));
|
||||||
if (qdisc == NULL)
|
if (qdisc == NULL)
|
||||||
|
|
|
@ -125,7 +125,8 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)
|
||||||
|
|
||||||
for (i = 0; i < dev->num_tx_queues; i++) {
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
||||||
dev_queue = netdev_get_tx_queue(dev, i);
|
dev_queue = netdev_get_tx_queue(dev, i);
|
||||||
qdisc = qdisc_create_dflt(dev_queue, default_qdisc_ops,
|
qdisc = qdisc_create_dflt(dev_queue,
|
||||||
|
get_default_qdisc_ops(dev, i),
|
||||||
TC_H_MAKE(TC_H_MAJ(sch->handle),
|
TC_H_MAKE(TC_H_MAJ(sch->handle),
|
||||||
TC_H_MIN(i + 1)));
|
TC_H_MIN(i + 1)));
|
||||||
if (qdisc == NULL) {
|
if (qdisc == NULL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue