• E
    macvtap: Fix the minor device number allocation · e09eff7f
    Eric W. Biederman 提交于
    On systems that create and delete lots of dynamic devices the
    31bit linux ifindex fails to fit in the 16bit macvtap minor,
    resulting in unusable macvtap devices.  I have systems running
    automated tests that that hit this condition in just a few days.
    
    Use a linux idr allocator to track which mavtap minor numbers
    are available and and to track the association between macvtap
    minor numbers and macvtap network devices.
    
    Remove the unnecessary unneccessary check to see if the network
    device we have found is indeed a macvtap device.  With macvtap
    specific data structures it is impossible to find any other
    kind of networking device.
    
    Increase the macvtap minor range from 65536 to the full 20 bits
    that is supported by linux device numbers.  It doesn't solve the
    original problem but there is no penalty for a larger minor
    device range.
    Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    e09eff7f
macvtap.c 26.2 KB