* Re: [PATCH net-next] sunvnet: call unregister_netdev() exactly once per device
[not found] <20140708161827.GO19954@sowmini.varadhan@oracle.com>
@ 2014-07-09 3:42 ` David Miller
2014-07-09 11:27 ` Sowmini Varadhan
0 siblings, 1 reply; 2+ messages in thread
From: David Miller @ 2014-07-09 3:42 UTC (permalink / raw)
To: sowmini.varadhan; +Cc: netdev, dave.kleikamp, dan.carpenter
From: sowmini.varadhan@oracle.com
Date: Tue, 8 Jul 2014 12:18:27 -0400
> unregister_netdev the parent net_device only after
> the last port in the port_list of a `struct vnet'
> is removed when the vnet is dismantled. Moreover,
> this should only be done if the net_device was
> successfully registered.
>
> Without this fix, 'modprobe -r sunvnet' could
> trigger the following in rollback_registered_many()
> 5693 BUG_ON(dev->reg_state != NETREG_REGISTERED);
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
> Acked-by: Dave Kleikamp <dave.kleikamp@oracle.com>
> Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
This is definitely not the right fix, you're just removing a symptom
of a much larger problem.
And that problem is that nothing cleans up the objects created by
vnet_new(), they are completely leaked.
vnet_exit(), after doing the vio_unregister_driver(), should call a
helper function that iterates over vnet_list and cleans up those
objects.
That's where the unregister_netdevice() belongs, not in vnet_port_remove().
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] sunvnet: call unregister_netdev() exactly once per device
2014-07-09 3:42 ` [PATCH net-next] sunvnet: call unregister_netdev() exactly once per device David Miller
@ 2014-07-09 11:27 ` Sowmini Varadhan
0 siblings, 0 replies; 2+ messages in thread
From: Sowmini Varadhan @ 2014-07-09 11:27 UTC (permalink / raw)
To: David Miller; +Cc: netdev, dave.kleikamp, dan.carpenter
On 07/08/2014 11:42 PM, David Miller wrote:
>
> This is definitely not the right fix, you're just removing a symptom
> of a much larger problem.
>
> And that problem is that nothing cleans up the objects created by
> vnet_new(), they are completely leaked.
the bug(s) in modprobe -r is one manifestation of the problem
and should certainly be fixed, I can look into the suggestions
you have below.
But this is actually a bit worse. Whenever a node goes
away, it triggers a vio_port_remove() on all the peering nodes,
and blows away their networking. IOW this can happen without
involving vnet_exit() at all. Thus it might be necessary
for vio_port_remove() itself to check if its the last port
before doing the unregister?
BTW, for some odd reason I did not see my original patch submission
show up in the list. I'm not sure why.
>
> vnet_exit(), after doing the vio_unregister_driver(), should call a
> helper function that iterates over vnet_list and cleans up those
> objects.
>
> That's where the unregister_netdevice() belongs, not in vnet_port_remove().
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-09 11:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20140708161827.GO19954@sowmini.varadhan@oracle.com>
2014-07-09 3:42 ` [PATCH net-next] sunvnet: call unregister_netdev() exactly once per device David Miller
2014-07-09 11:27 ` Sowmini Varadhan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).