]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
macvtap: Fix the minor device number allocation
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 20 Oct 2011 04:29:24 +0000 (04:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Oct 2011 06:53:07 +0000 (02:53 -0400)
commite09eff7fc1c6f011f7bdb304e10d2ceef08c88ab
tree170603217dedb0434244f4ef35928e6267cd5105
parent9bf1907f4293d61d5a283d18c4ad28d048261797
macvtap: Fix the minor device number allocation

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: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvtap.c
include/linux/if_macvlan.h