Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    [solved] pfSense (2.6.0 & 22.01 ) is very slow on Hyper-V

    Scheduled Pinned Locked Moved Virtualization
    187 Posts 36 Posters 112.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stephenw10S
      stephenw10 Netgate Administrator
      last edited by

      Is the VLAN issue only happening on gen 1 VMs?
      That was an early theory but I've not seen definite conclusion.

      Bob.DigB 1 Reply Last reply Reply Quote 0
      • Bob.DigB
        Bob.Dig LAYER 8 @stephenw10
        last edited by Bob.Dig

        @stephenw10 said in After Upgrade inter (V)LAN communication is very slow (on Hyper-V).:

        Is the VLAN issue only happening on gen 1 VMs?
        That was an early theory but I've not seen definite conclusion.

        It is not VLAN related but related to hn interfaces and or virtual switches I would say.
        Just for the record:

        • First who encountered it

        • Server 2022 Gen2 VM

        • AMD System

        • WAN-Speed never was affected

        • Even just using virtual adapters on private switch without VLAN it happened

        • Most probably a bug in FreeBSD 12.3 regarding hyper-v

        1 Reply Last reply Reply Quote 1
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          Mmm, I'd bet it's going to be one of these changes from Mar 2021:
          https://github.com/pfsense/FreeBSD-src/commits/RELENG_2_6_0/sys/dev/hyperv/netvsc

          And given that one of those enabled RSC support....

          1 Reply Last reply Reply Quote 0
          • H
            hendryjl
            last edited by

            +1 for Disabling RSC. My setup...

            • Home "power user"
            • Fitlet2 with three network interfaces
            • Windows Server 2019
            • Hyper-V Gen 1 VM.
              ** Three virtual switches (one for each ISP, one for switch)
              ** 7 network interfaces at VM level (one for each ISP, 5 for 5 VLANs, set with VLAN tagging at virtual NIC level in HyperV)
              ** All virtual nics with every check box disabled except VLAN (no VMQ, etc)

            WAN speed was terrible. Changed software receive side coalescing on the VM switches, and all good.

            Commands used:

            Check:
            Get-VMSwitch | % { $_ | Select-Object *RSC* }

            Change:
            Get-VMSwitch | % { $_ | Set-VMSwitch -EnableSoftwareRsc $false }

            Re-Check:
            Get-VMSwitch | % { $_ | Select-Object *RSC* }

            F 1 Reply Last reply Reply Quote 5
            • Bob.DigB
              Bob.Dig LAYER 8
              last edited by Bob.Dig

              Yup, that is the main difference, it is not about WAN-Speed in my and some few others cases.
              If WAN then RSC.

              I had disabled RSC today a second time, even rebooted the host, it again didn't helped in my case.

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by stephenw10

                Looking at that commit there are some things adds we should be able to check. Some sysctls:

                dev.hn.0.rx.0.rsc_drop: 0
                dev.hn.0.rx.0.rsc_pkts: 0
                

                And if you boot verbose the logs show:

                Feb 24 18:51:42 	kernel 		hn0: hwcaps rsc: ip4 1 ip6 1
                Feb 24 18:51:42 	kernel 		hn0: offload rsc: ip4 2, ip6 2 
                

                So I wonder if this is somehow not being disabled because it still seems to fit:
                It only affects TCP.
                It only affects traffic between VMs in the same host.

                Steve

                H ChrisLynchC 2 Replies Last reply Reply Quote 0
                • H
                  hendryjl @stephenw10
                  last edited by

                  @stephenw10 said in After Upgrade inter (V)LAN communication is very slow (on Hyper-V).:

                  It only affects TCP.

                  Confirmed for me. UDP streams were fine. RSC affects only with TCP packets (by definition).

                  It only affects traffic between VMs in the same host.

                  In my case, because my traffic comes in on other physcial nics, and those physical nics tie to a physical nic with virtual nics (vlan tagged by hyper-v) and the clients live on those VLANs, it definitely affects traffic outside of the host.

                  1 Reply Last reply Reply Quote 1
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    Be good to get those values from an affected VM. I grabbed those from Azure which isn't.

                    Steve

                    H 1 Reply Last reply Reply Quote 0
                    • H
                      hendryjl @stephenw10
                      last edited by

                      @stephenw10 said in After Upgrade inter (V)LAN communication is very slow (on Hyper-V).:

                      Be good to get those values from an affected VM

                      I switched RSC back on, booted the VM back up, and verified the problem existed. Here are the ctls (attached).sysctls.txt

                      I booted verbose, but missed the output. I couldn't find it in the logs. Am I going to have to do a serial console to see them?

                      T 1 Reply Last reply Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by

                        Nice, so you see traffic in those counters with RSC enabled in the vswitches when the problem exists. Do you stil see data there when RSC is disabled in the switches?

                        It would be interesting to see if that varies for VMs that are still hitting issues even with RSC disabled.

                        Steve

                        H 1 Reply Last reply Reply Quote 0
                        • T
                          ttmcmurry @hendryjl
                          last edited by ttmcmurry

                          I still think there's more than one issue. My post several days ago is with a pfSense on hyper-v, gen 2 vm, with no vlans defined in pfSense, vnic, or vswitch, and RSC is disabled. And I had (well, have if I turn the pfSense 2.6 vm back on) the slow performance issue.

                          Perhaps for hyper-v configuration with native interfaces throughout, RSC is not a factor. Perhaps at best a clue.

                          For those using hyper-v with vlans and disabling RSC is the fix, that's great, and also a clue.

                          My mind keeps going back to the troubleshooting where migrating the pfSense VM to another host fixing slow network performance. I'm beginning to think the issue is how FreeBSD is interfacing with the hn driver. In my physical setup, technically my LAN is a directly connected native vSwitch to the hyper-v host. Any device connected to hn1 (in my case) is connected to the same physical hyper-v host. pfSense is routing data between different vNICs which are connected to different vSwitches which are bound to unique physical uplinks.

                          Unfortunately I haven't time to prove this or packet cap it. This seems OS/Driver related to me.

                          1 Reply Last reply Reply Quote 0
                          • m0njiM
                            m0nji
                            last edited by m0nji

                            VMQ disabled on all VMs
                            RSC disabled on Hyper-V Host

                            PS C:\WINDOWS\system32> Get-VMSwitch -Name "Bridged_LAN" | Select-Object *RSC*
                            
                            SoftwareRscEnabled RscOffloadEnabled
                            ------------------ -----------------
                                         False             False
                            

                            fresh booted FreeBSD 12.3 after 120 seconds iperf test (with speed problems)

                            dev.hn.0.rx.0.rsc_drop: 0
                            dev.hn.1.rx.0.rsc_drop: 0
                            dev.hn.2.rx.0.rsc_drop: 0
                            dev.hn.2.rx.0.rsc_pkts: 0
                            dev.hn.1.rx.0.rsc_pkts: 0
                            dev.hn.0.rx.0.rsc_pkts: 321
                            

                            fresh booted FreeBSD 13.0 after 120s iperf test (speed problem does not exist)
                            sysctl's do not exist!

                            root@freebsd130:~ # sysctl dev.hn.0.rx.0.rsc_drop
                            sysctl: unknown oid 'dev.hn.0.rx.0.rsc_drop'
                            root@freebsd130:~ # sysctl dev.hn.1rx.0.rsc_drop
                            sysctl: unknown oid 'dev.hn.1.rx.0.rsc_drop'
                            root@freebsd130:~ # sysctl dev.hn.2rx.0.rsc_drop
                            sysctl: unknown oid 'dev.hn.2.rx.0.rsc_drop'
                            root@freebsd130:~ # sysctl dev.hn.0rx.0.rsc_pkts
                            sysctl: unknown oid 'dev.hn.0.rx.0.rsc_pkts'
                            root@freebsd130:~ # sysctl dev.hn.1rx.0.rsc_pkts
                            sysctl: unknown oid 'dev.hn.1.rx.0.rsc_pkts'
                            root@freebsd130:~ # sysctl dev.hn.2rx.0.rsc_pkts
                            sysctl: unknown oid 'dev.hn.2.rx.0.rsc_pkts'
                            

                            Intel i3-N305 / 4 x 2.5Gbe LAN @2.7.2-Release
                            WAN: Vodafone 1000/50, Telekom 250/40; Switch: USW Enterprise 8 PoE, USW Flex XG, US-8-60W; Wifi: Unifi 6 Lite AP, U6 Mesh

                            1 Reply Last reply Reply Quote 1
                            • H
                              hendryjl @stephenw10
                              last edited by

                              @stephenw10 said in After Upgrade inter (V)LAN communication is very slow (on Hyper-V).:

                              It would be interesting to see if that varies for VMs that are still hitting issues even with RSC disabled.

                              Shutdown, Disable RCS on virtual switches, Boot, Test (success), Check CTLs... results attached (all 0's - good).

                              sysctls_rcsdisabled.txt

                              Definitely two different issues.

                              1 Reply Last reply Reply Quote 0
                              • m0njiM
                                m0nji
                                last edited by m0nji

                                just a theory:

                                on FreeBSD 13.0, RSC was removed completly from the kernel/system, thats why the sysctl's doesn't exist and so we do not have these problems?

                                on FreeBSD 12.3, RSC can't be disabled completly under some circumstances (drivers, nic's), thats why some people do see these problems?

                                if i interpret my values correctly, then even with RSC disabled, some packages hit RSC?! (321 packages) at least if "pkts" means packages ;)

                                EDIT: i think i will test tomorrow FreeBSD 12.2 (pfsense 2.5.x) and will see if RSC makes a difference there

                                Intel i3-N305 / 4 x 2.5Gbe LAN @2.7.2-Release
                                WAN: Vodafone 1000/50, Telekom 250/40; Switch: USW Enterprise 8 PoE, USW Flex XG, US-8-60W; Wifi: Unifi 6 Lite AP, U6 Mesh

                                H stephenw10S 2 Replies Last reply Reply Quote 0
                                • H
                                  hendryjl @m0nji
                                  last edited by

                                  @m0nji said in After Upgrade inter (V)LAN communication is very slow (on Hyper-V).:

                                  EDIT: i think i will test tomorrow FreeBSD 12.2 (pfsense 2.5.x) and will see if RSC makes a difference there

                                  I still have my image of 2.5.2 before I applied 2.6. I reverted to it when I first had my issues (before I ever tried disabling RSC on the Hyper-V virtual switches). I didn't see any issues. Later tonight I will revert to it again and see what the sysctls say.

                                  1 Reply Last reply Reply Quote 0
                                  • stephenw10S
                                    stephenw10 Netgate Administrator
                                    last edited by

                                    RSC support wasn't added to hn(4) until 12.3 so I would expect to see no sysctls there.

                                    The driver looks to try to use them based on the VNIC revision. I'm speculating that under some set of circumstances the driver/host/platform maybe trying and failing to use RSC even when it's disabled in the vswitch.

                                    I'd like to check the sysctl and verbose boot logs from someone who is hitting this still with rsc seemingly disabled. Since we know they should be all zeros if it's actually disabled.

                                    Steve

                                    Bob.DigB 1 Reply Last reply Reply Quote 0
                                    • stephenw10S
                                      stephenw10 Netgate Administrator @m0nji
                                      last edited by stephenw10

                                      @m0nji said in After Upgrade inter (V)LAN communication is very slow (on Hyper-V).:

                                      on FreeBSD 13.0, RSC was removed completly from the kernel/system, thats why the sysctl's doesn't exist and so we do not have these problems?

                                      Ah, nope! It's because FreeBSD 13 is actually older than 12.3 and doesn't have any of the RSC support patches:
                                      https://github.com/freebsd/freebsd-src/tree/releng/13.0/sys/dev/hyperv/netvsc

                                      I would expect an 13-stable snapshot to fail the same way.

                                      Steve

                                      1 Reply Last reply Reply Quote 1
                                      • Bob.DigB
                                        Bob.Dig LAYER 8 @stephenw10
                                        last edited by Bob.Dig

                                        @stephenw10 said in After Upgrade inter (V)LAN communication is very slow (on Hyper-V).:

                                        I'd like to check the sysctl and verbose boot logs from someone who is hitting this still with rsc seemingly disabled. Since we know they should be all zeros if it's actually disabled.

                                        Steve

                                        I would like to but I need description for dummies how to do it.

                                        m0njiM 1 Reply Last reply Reply Quote 0
                                        • m0njiM
                                          m0nji @Bob.Dig
                                          last edited by m0nji

                                          @bob-dig just open the VM preview window, reboot and on the boot screen hit the "boot options" and select verbose boot

                                          63e6e7d6-391f-42f5-b3ba-d3c8cde56986-image.png

                                          FreeBSD 12.3

                                          root@freebsd123:~ # grep -i "rsc" /var/log/messages
                                          Feb 25 08:48:02 freebsd123 kernel: hn0: hwcaps rsc: ip4 1 ip6 1
                                          Feb 25 08:48:02 freebsd123 kernel: hn0: offload rsc: ip4 2, ip6 2
                                          Feb 25 08:48:02 freebsd123 kernel: hn1: hwcaps rsc: ip4 1 ip6 1
                                          Feb 25 08:48:02 freebsd123 kernel: hn1: offload rsc: ip4 2, ip6 2
                                          Feb 25 08:48:02 freebsd123 kernel: hn2: hwcaps rsc: ip4 1 ip6 1
                                          Feb 25 08:48:02 freebsd123 kernel: hn2: offload rsc: ip4 2, ip6 2
                                          
                                          

                                          pfSense 2.6.0

                                          [2.6.0-RELEASE][admin@pfSense.home.arpa]/root: grep -i "rsc" /var/log/system.log                
                                          Feb 25 07:56:22 pfSense kernel: hn0: hwcaps rsc: ip4 1 ip6 1
                                          Feb 25 07:56:22 pfSense kernel: hn0: offload rsc: ip4 2, ip6 2
                                          Feb 25 07:56:22 pfSense kernel: hn1: hwcaps rsc: ip4 1 ip6 1
                                          Feb 25 07:56:22 pfSense kernel: hn1: offload rsc: ip4 2, ip6 2
                                          Feb 25 07:56:22 pfSense kernel: hn2: hwcaps rsc: ip4 1 ip6 1
                                          Feb 25 07:56:22 pfSense kernel: hn2: offload rsc: ip4 2, ip6 2
                                          
                                          

                                          Intel i3-N305 / 4 x 2.5Gbe LAN @2.7.2-Release
                                          WAN: Vodafone 1000/50, Telekom 250/40; Switch: USW Enterprise 8 PoE, USW Flex XG, US-8-60W; Wifi: Unifi 6 Lite AP, U6 Mesh

                                          Bob.DigB 1 Reply Last reply Reply Quote 1
                                          • Bob.DigB
                                            Bob.Dig LAYER 8 @m0nji
                                            last edited by Bob.Dig

                                            @m0nji I tried this with 2.5.2. I don't see anything regarding rsc in the logs or OS Boot log.
                                            Also where to put those commands in? If I try with putty, it gives my permission denied. In the WebUI there is no output as well.

                                            So I guess not noob friendly enough. 😓

                                            
                                            Enter an option: 8
                                            
                                            [2.5.2-RELEASE][admin@pfSense.home.arpa]/root: # grep -i "rsc" /var/log/messages                                      
                                            #: Command not found.
                                            [2.5.2-RELEASE][admin@pfSense.home.arpa]/root: grep -i "rsc" /var/log/system.log                                      
                                            [2.5.2-RELEASE][admin@pfSense.home.arpa]/root: ~ # grep -i "rsc" /var/log/messages
                                            /root: Permission denied.
                                            [2.5.2-RELEASE][admin@pfSense.home.arpa]/root:
                                            
                                            
                                            m0njiM 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.