0

While trying to understand multiqueue queuing disciplines (mq qdisc), I stumbled across the following configs :

On my laptop, my WiFi interface implements a mq qdisc with 1 rx and 4 tx :

$ sudo tc qdisc list dev wlp2s0
    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

$ sudo ll /sys/class/net/wlp2s0/queues/
    total 0
    33458 0 drwxr-xr-x 2 root root 0 août  18 05:54 rx-0/
    33461 0 drwxr-xr-x 3 root root 0 août  18 05:54 tx-0/
    33472 0 drwxr-xr-x 3 root root 0 août  18 05:54 tx-1/
    33483 0 drwxr-xr-x 3 root root 0 août  18 05:54 tx-2/
    33494 0 drwxr-xr-x 3 root root 0 août  18 05:54 tx-3/

On the other hand, on an HP ProLiant server, each NIC implements a mq qdisc with 4 rx and 1 tx :

$ sudo tc qdisc show dev eno3
qdisc mq 0: root 
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

$ sudo ll /sys/class/net/eno3/queues/
total 0
41241 0 drwxr-xr-x 2 root root 0 août  12 23:17 rx-0/
41244 0 drwxr-xr-x 2 root root 0 août  12 23:17 rx-1/
41247 0 drwxr-xr-x 2 root root 0 août  12 23:17 rx-2/
41250 0 drwxr-xr-x 2 root root 0 août  12 23:17 rx-3/
41256 0 drwxr-xr-x 3 root root 0 août  12 23:17 tx-0/

I guess the point of multiqueuing is performance, so what's the reasoning behind this ? Why does a WiFi card implement "tx multiqueuing", while a NIC implements "rx multiqueuing" ?

ChennyStar
  • 1,319
  • 9
  • 22

1 Answers1

0

I do not know that I can answer your question decisively. To do so would presume I know the design decisions of the hardware engineers and NIC driver writer. You have correctly noted the differences in the number of Queues used in the multi-queuing, however, they are applied differently than you've described.

The output provided from tc shows the Tx queues only. mq is a logical qdisc which allows for associating other queue disciplines underneath. I don't know that mq does any shaping of its own. In the case of your wireless NIC mq is set at the root level with 4 Tx queues using pfifo_fast: the Linux default.

You'll notice that the output from the ProLiant server is quite different.

$ sudo tc qdisc show dev eno3
qdisc mq 0: root 
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

$ sudo ll /sys/class/net/eno3/queues/
total 0
41241 0 drwxr-xr-x 2 root root 0 août  12 23:17 rx-0/
41244 0 drwxr-xr-x 2 root root 0 août  12 23:17 rx-1/
41247 0 drwxr-xr-x 2 root root 0 août  12 23:17 rx-2/
41250 0 drwxr-xr-x 2 root root 0 août  12 23:17 rx-3/
41256 0 drwxr-xr-x 3 root root 0 août  12 23:17 tx-0/

It does show the use of mq at the root level, but it's effectively a single queue. This is because there is but a single instance of pfifo_fast which is associated with the single Tx queue shown in the output from sysfs.

Why? Respecting the server, it does make some sense. Depending on what services are provided, it may be that much more data will be received than sent. As to the WiFi ... I really don't know. One would expect that a laptop would be receiving more than it's sending.

In any regard, if you're using hardware which supports multiple queues (which you are), you can adjust the number of queues the NIC driver uses via the ethtool command. Read the manual page for ethtool for a better understanding.

Andrew Falanga
  • 509
  • 8
  • 19