Skip to content
  • Jason Wang's avatar
    tuntap: RCUify dereferencing between tun_struct and tun_file · 6e914fc7
    Jason Wang authored
    
    
    RCU were introduced in this patch to synchronize the dereferences between
    tun_struct and tun_file. All tun_{get|put} were replaced with RCU, the
    dereference from one to other must be done under rtnl lock or rcu read critical
    region.
    
    This is needed for the following patches since the one of the goal of multiqueue
    tuntap is to allow adding or removing queues during workload. Without RCU,
    control path would hold tx locks when adding or removing queues (which may cause
    sme delay) and it's hard to change the number of queues without stopping the net
    device. With the help of rcu, there's also no need for tun_file hold an refcnt
    to tun_struct.
    
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6e914fc7