FreeBSD 13, Iflib, 2 CPU problem

Андрей Герасимов orca at tira.com.ua
Sat May 8 13:45:31 UTC 2021


Recently I have updated to FreeBSD 13, but it had begun since iflib was
added to FreeBSD12.
Behavior is the same on different servers.
CPU 2 x CPU E5-2670
NIC driver is ix. It is standard.
As I understand, when the system is starting it creates threads for every
core of the processor.

procstat -at | grep if_io
    0 100019 kernel              if_io_tqg_0          -1   24 sleep   -
    0 100020 kernel              if_io_tqg_1          -1   24 sleep   -
    0 100021 kernel              if_io_tqg_2          -1   24 sleep   -
    0 100022 kernel              if_io_tqg_3          -1   24 sleep   -
    0 100023 kernel              if_io_tqg_4          -1   24 sleep   -
    0 100024 kernel              if_io_tqg_5          -1   24 sleep   -
    0 100025 kernel              if_io_tqg_6          -1   24 sleep   -
    0 100026 kernel              if_io_tqg_7          -1   24 sleep   -
    0 100027 kernel              if_io_tqg_8          -1   24 sleep   -
    0 100028 kernel              if_io_tqg_9          -1   24 sleep   -
    0 100029 kernel              if_io_tqg_10         -1   24 sleep   -
    0 100030 kernel              if_io_tqg_11         -1   24 sleep   -
    0 100031 kernel              if_io_tqg_12         -1   24 sleep   -
    0 100032 kernel              if_io_tqg_13         -1   24 sleep   -
    0 100033 kernel              if_io_tqg_14         -1   24 sleep   -
    0 100034 kernel              if_io_tqg_15         -1   24 sleep   -


When the network is loaded as I see in "top" only the first 8 threads are
working which are binded to the first processor. So the second processor is
not used at all.
I've been trying a different combination of sysctl tuning and couldn't load
the second processor. The only thing that helped was installing ix driver
from ports collection which does not use iflib. And only after this i see 8
threads per NIC port that can be binded  to different CPU cores.
But when a server has more than 16 cores then it does not use excess ones,
and if server has less than 16 cores, then few threads go to each core.

I thought that it would be changed with FreeBSD13 but it wasn't


More information about the freebsd-questions mailing list