Skip to content
  • Apollon Oikonomopoulos's avatar
    KVM: set IFF_ONE_QUEUE on created tap interfaces · b8168679
    Apollon Oikonomopoulos authored
    
    
    The IFF_ONE_QUEUE flag directs the kernel to only queue tap packets once
    (as opposed to queueing them twice, once for the device, and once for the
    qdisc), possibly avoiding interface stalls when one of the queues overruns.
    
    This is the default behaviour of the kernel tun/tap driver in Linux
    >= 3.8. Also, qemu >= 1.5.0 sets this flag when opening the tap device
    itself (but not for tap interfaces inherited via fds), according to this
    commit:
    
      commit d26e445c80fddcc7483b83f3115e5067fef28fe6
      Author: Peter Lieven <pl@dlhnet.de>
      Date:   Mon Feb 25 10:17:08 2013 +0100
    
          tap: set IFF_ONE_QUEUE per default
    
          historically the kernel queues packets two times. once
          at the device and second in qdisc. this is believed to cause
          interface stalls if one of these queues overruns.
    
          setting IFF_ONE_QUEUE is the default in kernels >= 3.8. the
          flag is ignored since then. see kernel commit
          5d097109257c03a71845729f8db6b5770c4bbedc
    
    Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
    Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    
    Since we handle tap creation ourselves, we duplicate this behavior in
    _OpenTap. IFF_ONE_QUEUE has been there as far back as the kernel's git
    history goes (2.6.12), so it is safe to add the flag unconditionally.
    Also the flag is invisible to the guest and will not break migrations of
    already running instances.
    
    Signed-off-by: default avatarApollon Oikonomopoulos <apoikos@gmail.com>
    Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
    b8168679