• Michael S. Tsirkin's avatar
    tun: add VNET_LE flag · e999d6ea
    Michael S. Tsirkin authored
    virtio 1.0 modified virtio net header format,
    making all fields little endian.
    
    Users can tweak header format before submitting it to tun,
    but this means more data copies where none were necessary.
    And if the iovec is in RO memory, this means we might
    need to split iovec also means we might in theory overflow
    iovec max size.
    
    This patch adds a simpler way for applications to handle this,
    using new "little endian" flag in tun.
    As a result, tun simply byte-swaps header fields as appropriate.
    This is a NOP on LE architectures.
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    
    
    
    e999d6ea
if_tun.h 3.4 KB