2

When I list out the qdiscs on my system, I see an mq qdisc and some pfifo_fast qdiscs. The pfifo_fast ones all seem to have a major number that is the same as their parent. Or am I misunderstanding the hierarchy or seeing a hierarchy where there isn't one? Maybe the pfifo_fast are not descendents of mq?

bjb@rhino:/opt/blueeyes/houshold$ sudo tc qdisc show dev wlan0
qdisc mq 0: root 
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
bjb@rhino:/opt/blueeyes/houshold$ 

Is it true that if the major or minor number is omitted, it is assumed to be zero?

The parents for the pfifo_fast are :1, :2, :3, :4 - would those be classes under mq? Deducing that since I read that qdiscs all have minor numbers of 0 and classes have non-zero minor numbers. So looking for confirmation that qdisc mq has a number (4 in this case) of implicit classes - one per driver queue perhaps? And that the pfifo-fast qdiscs are attached to these classes. If that is not the case - please correct me.

How is traffic distributed to the four pfifo_fast? Is it load-balanced among them? If I want to use netem on all the traffic leaving from that interface, where would I put it? Should I replace all the pfifo-queue with netem instances? Or put netem as child of root, and mq as child of netem and have the pfifo_fast as children of mq? Or something else? Maybe just have a netem at root and forget the rest? But if I do that, will I lose the ability to use all the interface per-core driver queues, which is what I understand mq provides?

1 Answers1

1

Is it true that if the major or minor number is omitted, it is assumed to be zero?

Yes.

The parents for the pfifo_fast are :1, :2, :3, :4 - would those be classes under mq?

Yes. You could replace the default "mq" qdisc (0:) with another one tc qdisc add dev wlan0 root mq and you would see the same hierarchy but with another major number than 0, which therefore would be displayed by tc qdisc show.

So looking for confirmation that qdisc mq has a number (4 in this case) of implicit classes - one per driver queue perhaps?

Exactly. One class for each device TX queue as defined driver and hardware. 1

How is traffic distributed to the four pfifo_fast? Is it load-balanced among them?

This is not done by the mq scheduler itself but by the usual Transmit Packet Stearing which tries to improve performance by localization 2. "mq" is called a dummy scheduler, probably because it doesn't do any configurable policy decision by its own.

If I want to use netem on all the traffic leaving from that interface, where would I put it? Should I replace all the pfifo-queue with netem instances? Or put netem as child of root...

Probably as a child of the root replacing the "mq" scheduler. Technically you could also replace the four pfifo_fast instances, but I don't see an advantage.

... and mq as child of netem and have the pfifo_fast as children of mq?

That wouldn't be possible, because "mq" can only be used at the root.

Maybe just have a netem at root and forget the rest?

Yes

But if I do that, will I lose the ability to use all the interface per-core driver queues,

No, "mq" more or less provides a view into the transmit queues of the driver by creating matching classes. If you replace it, you just lose the view but the multiqueue device driver will still have and utilize multiple transmit queues.

Take it with a grain of salt. @all: I'd love to be corrected!

Donald
  • 41
  • 2