netdev: Remove netdev from global shash when the user is changing interface configura...
authorRyan Wilson <wryan@nicira.com>
Fri, 16 May 2014 09:17:58 +0000 (02:17 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 16 May 2014 18:35:38 +0000 (11:35 -0700)
commitfe83f81df9779ba4fa74111a09764d3153651dac
tree70829a338641f71264a47d9f050a71e7b55d3954
parentfe99c36086aa755a077be609d21870c3d0874944
netdev: Remove netdev from global shash when the user is changing interface configuration.

When the user changes port type (i.e. changing p0 from type 'internal' to
'gre'), the netdev must first be deleted, then re-created with the new type.
Deleting the netdev requires there exist no more references to the netdev.
However, the xlate cache holds references to netdevs and the cache is only
invalidated by revalidator threads. Thus, if cache is not invalidated prior to
the netdev being re-created, the netdev will not be able to be re-created and
the configuration change will fail.

This patch always removes the netdev from the global netdev shash when the
user changes port type. This ensures that the new netdev can always be created
while handler and revalidator threads can retain references to the old netdev
until they are finished.

Signed-off-by: Ryan Wilson <wryan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS
lib/netdev.c
lib/netdev.h
vswitchd/bridge.c