CentOS 9 KVM : Guest VM NIC not on 10Gbps

CentOS 9 KVM : Guest VM NIC not on 10Gbps

I have a CentOS KVM host with a traditionnal 1Gbps NIC for general network and a Intel NC522SFP NIC to allow 10Gbps transfer with my computer. I am facing a problem that I can't solve, I am on it since almost a week now.

When I set an IP to the adapter on the host itself, and then do a iperf3 test, I get the following result :

Connecting to host 192.168.11.203, port 5201
[  4] local 192.168.11.100 port 1229 connected to 192.168.11.203 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   645 MBytes  5.41 Gbits/sec
[  4]   1.00-2.00   sec   684 MBytes  5.74 Gbits/sec
[  4]   2.00-3.00   sec   678 MBytes  5.69 Gbits/sec
[  4]   3.00-4.00   sec   671 MBytes  5.63 Gbits/sec
[  4]   4.00-5.00   sec   672 MBytes  5.64 Gbits/sec
[  4]   5.00-6.00   sec   674 MBytes  5.65 Gbits/sec
[  4]   6.00-7.00   sec   659 MBytes  5.53 Gbits/sec
[  4]   7.00-8.00   sec   678 MBytes  5.69 Gbits/sec
[  4]   8.00-9.00   sec   664 MBytes  5.57 Gbits/sec
[  4]   9.00-10.00  sec   663 MBytes  5.56 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec  6.53 GBytes  5.61 Gbits/sec                  sender
[  4]   0.00-10.00  sec  6.53 GBytes  5.61 Gbits/sec                  receiver

This is not fully 10Gbps but I suspect it's a PCIE port limitation. I am OK with these results because anyway my P410 raid controller won't be able to output more than this.

My problem is that when I setup a CentOS VM on the host and simply pass this NIC in "direct attachment" (virtio), I only get 1Gbps throughput.

Connecting to host 192.168.11.240, port 5201
[  4] local 192.168.11.100 port 1138 connected to 192.168.11.240 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   128 MBytes  1.08 Gbits/sec
[  4]   1.00-2.00   sec   128 MBytes  1.08 Gbits/sec
[  4]   2.00-3.00   sec   129 MBytes  1.08 Gbits/sec
[  4]   3.00-4.00   sec   128 MBytes  1.08 Gbits/sec
[  4]   4.00-5.00   sec   130 MBytes  1.09 Gbits/sec
[  4]   5.00-6.00   sec   126 MBytes  1.05 Gbits/sec
[  4]   6.00-7.00   sec   125 MBytes  1.05 Gbits/sec
[  4]   7.00-8.00   sec   128 MBytes  1.07 Gbits/sec
[  4]   8.00-9.00   sec   126 MBytes  1.05 Gbits/sec
[  4]   9.00-10.00  sec   124 MBytes  1.04 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec  1.24 GBytes  1.07 Gbits/sec                  sender
[  4]   0.00-10.00  sec  1.24 GBytes  1.07 Gbits/sec                  receiver

Both host and VM are on CentOS Stream 9.

Anybody can help me to understand why performance inside the VM are so bad compared to the host ?

Thank a lot for your help.

관련 정보