• Jason Wang's avatar
    tun: switch to new type of msg_control · fe8dd45b
    Jason Wang authored
    This patch introduces to a new tun/tap specific msg_control:
    
    #define TUN_MSG_UBUF 1
    #define TUN_MSG_PTR  2
    struct tun_msg_ctl {
           int type;
           void *ptr;
    };
    
    This allows us to pass different kinds of msg_control through
    sendmsg(). The first supported type is ubuf (TUN_MSG_UBUF) which will
    be used by the existed vhost_net zerocopy code. The second is XDP
    buff, which allows vhost_net to pass XDP buff to TUN. This could be
    used to implement accepting an array of XDP buffs from vhost_net in
    the following patches.
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    fe8dd45b
net.c 39 KB