5

This LWN article suggests that one may add/replace the network scheduler for a queue "under" the mq "dummy scheduler." These two point to that end:

The mq scheduler does two things:

- present device TX queues as classes, allowing to attach
  different qdiscs to them, which are grafted to the TX queues

- present accumulated statistics of all device queue root qdiscs

I would appreciate being schooled on how to do this. I've tried many combinations. For example, from this listing of the default (CentOS 7.6):

# tc qdisc show dev eth2
qdisc mq 0: root 
qdisc pfifo_fast 0: parent :8 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :7 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :6 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :5 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :4 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :3 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent :1 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

I've tried many variations trying to experiment with grafting different schedulers under mq. Here are some attempts:

# tc qdisc add dev eth2 parent 0:1 fq_codel target 1ms interval 10ms quantum 9014
RTNETLINK answers: No such file or directory
# tc qdisc add dev eth2 parent 0:1 handle 1: fq_codel target 1ms interval 10ms quantum 9014
RTNETLINK answers: No such file or directory

Would anyone know the magic to put different schedulers under mq than only pfifo_fast? One point that is highly frustrating is that the manual page, and many internet articles, reference root and parents regarding the schedulers and queues. However, none do an adequate job in describing, from the output I have above from the tc qdisc show dev eth2 command, what is the root and which are the parents. I'm guessing, but my guesses seem to be far off.

Andrew Falanga
  • 509
  • 8
  • 19

1 Answers1

4

The kernel's default reserved handle 0: can't be referenced correctly (as major value 0: ). You have first to (re)install the qdisc root mq, using a valid handle (ie: not 0:):

# tc qdisc add dev eth2 root handle 1: mq

Which now should give you this:

# tc qdisc show dev eth2
qdisc mq 1: root 
qdisc pfifo_fast 0: parent 1:8 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent 1:7 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent 1:6 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent 1:5 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent 1:4 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent 1:3 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent 1:2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: parent 1:1 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

You can now run your commands as intended using parent 1:1 instead of 0:1 etc.

A.B
  • 31,762
  • 2
  • 62
  • 101
  • I apologize for the late "check mark" for your answer. It seems through the last month, at work, fires keep popping up and I've had to respond. Thank you for clarifying. This is exactly what I needed. – Andrew Falanga Dec 03 '19 at 19:53
  • Glad that helped – A.B Dec 03 '19 at 23:10