[ovs-dev] [PATCH] netdev: Remove netdev from global shash when the user is changing interface configuration.
Ryan Wilson 76511
wryan at vmware.com
Fri May 16 15:16:27 UTC 2014
In netdev_remove, the netdev is unreffed after being removed from the global shash. If the ref count is 0, the netdev is destroyed.
I'll re-submit with a more accurate comment for netdev_remove (it unrefs rather than destroys the netdev) and also adding a comment with netdev_remove in iface_destroy__ (which Alex recommended).
----- Original Message -----
From: "Ben Pfaff" <blp at nicira.com>
To: "Ryan Wilson" <wryan at nicira.com>
Cc: dev at openvswitch.org
Sent: Friday, May 16, 2014 7:52:19 AM
Subject: Re: [ovs-dev] [PATCH] netdev: Remove netdev from global shash when the user is changing interface configuration.
On Thu, May 15, 2014 at 03:01:19AM -0700, Ryan Wilson wrote:
> 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.
I think that the comment on netdev_remove() is not entirely correct: I
don't see anything in the function that "destroys 'netdev' if possible."
Acked-by: Ben Pfaff <blp at nicira.com>
More information about the dev