TX/RX offloading on tap interface

Discussion in 'Proxmox VE: Installation and configuration' started by Marathon, Apr 12, 2019.

  1. Marathon

    Marathon Member

    Joined:
    Apr 7, 2019
    Messages:
    40
    Likes Received:
    0
    HI All,

    Is there a way to enable offloading on a tap interface while the VM is starting ?

    Code:
    /sbin/ethtool -K tap101i0 rx off tx off
    I have been busy with startup scripts and such but didn't succeed.

    What I do see is that on start of the VM the offloading is actually there but after some seconds it's enabled and I cannot see where.

    Any ideas how to accomplish this ?
     
  2. Marathon

    Marathon Member

    Joined:
    Apr 7, 2019
    Messages:
    40
    Likes Received:
    0
    Anyone a clue how to accomplish this ?
     
  3. BobhWasatch

    BobhWasatch Member

    Joined:
    Mar 16, 2019
    Messages:
    56
    Likes Received:
    7
    I'm not making sense of your question. A tap interface is a software thing. To what hardware would it offload?
     
  4. Marathon

    Marathon Member

    Joined:
    Apr 7, 2019
    Messages:
    40
    Likes Received:
    0
    It's an interface, virtual indeed, that is why you want to turn off Hardware Offloading, it's on by default.
     
  5. BobhWasatch

    BobhWasatch Member

    Joined:
    Mar 16, 2019
    Messages:
    56
    Likes Received:
    7
    I'm thinking that many of the values ethtool returns for such an interface are meaningless.

    ETA: Recall that a for a tap interface the "hardware" is a user-space program that reads/writes raw Ethernet frames to the /dev/tap character device. It is always responsible for calculating checksums. So changing the setting with ethtool would be useless.
     
    #5 BobhWasatch, Apr 17, 2019
    Last edited: Apr 17, 2019
  6. Marathon

    Marathon Member

    Joined:
    Apr 7, 2019
    Messages:
    40
    Likes Received:
    0
    You might think it's useless but if I run VyOS with DHCP relay on it the DHCP relay only works when I offload on tap-interface on the hypervisor.

    It's a known KVM thing, even oVIrt has an option to disable it on KVM level for a Host/VM.
     
  7. spirit

    spirit Well-Known Member

    Joined:
    Apr 2, 2010
    Messages:
    3,349
    Likes Received:
    138
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Marathon

    Marathon Member

    Joined:
    Apr 7, 2019
    Messages:
    40
    Likes Received:
    0
    HI,

    Thanks I will look into the hooks (again).

    I think an option would be best as you actually hack that in anyways using a hook script.

    Would that be a lot of work ?

    Thanks again!
     
  9. BobhWasatch

    BobhWasatch Member

    Joined:
    Mar 16, 2019
    Messages:
    56
    Likes Received:
    7
    Interesting issue. I have no solution but want to make sure my understanding of the problem is correct.

    Apparently qemu net drivers do checksum offload by simply not calculating or validating checksums, there being no hardware to offload to. For guests with offload disabled qemu fixes any bad checksums on oncoming packets.

    For traffic between guests on the same host this is almost always fine. Corruption/loss should never happen and very few apps look at the IP headers. For outside packets the host IP stack and net drivers will do the work. Problem comes if a guest looks at the raw ethernet frame and finds a bad checksum. DHCP is one of those cases. So you want to disable offloading for DHCP servers that serve other guests on the same host.

    Is that about right?
     
    #9 BobhWasatch, Apr 18, 2019
    Last edited: Apr 18, 2019
  10. Marathon

    Marathon Member

    Joined:
    Apr 7, 2019
    Messages:
    40
    Likes Received:
    0
    You are not completely right there, I see a change in traffic when I disable rx/rx offload on tap interface and yes, DHCP traffic. If I don't, it doesn't work in the VM, so the one being DHCP relay.

    I think the same happens for firewalls, check oVirt it has an option to disable it on KVM with a reason.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice