Score:0

CentOS 9 KVM : Guest VM NIC not on 10Gbps

bb flag

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.

shodanshok avatar
ca flag
Try using a `virtio-net` adapter in your guest rather than doing a raw pass-through of the NIC itself. Does it change anything?
Karnalta avatar
bb flag
"Direct Attachment" is also using virtio as "model" according to Cockpit UI. But yes, I also have tried to create a bridge on that NIC and use a "Bridge-to-LAN" adapter on the VM without more success.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.