Thread (18 messages) 18 messages, 8 authors, 2013-03-30

Re: [PATCH] net: add a synchronize_net() in netdev_rx_handler_unregister()

From: Ivan Vecera <ivecera@redhat.com>
Date: 2013-03-29 15:12:34
Also in: lkml

On 03/29/2013 02:01 PM, Eric Dumazet wrote:
quoted
CPU0 will see rx_handler set and yet, rx_handler_data nulled. Write
quoted
barrier in rcu_assign_pointer() might prevent this reorder from happening.
Therefore I suggest:
diff --git a/net/core/dev.c b/net/core/dev.c
index 0caa38e..c16b829 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3332,8 +3332,8 @@ void netdev_rx_handler_unregister(struct net_device *dev)
 {

 	ASSERT_RTNL();
-	RCU_INIT_POINTER(dev->rx_handler, NULL);
-	RCU_INIT_POINTER(dev->rx_handler_data, NULL);
+	rcu_assign_pointer(dev->rx_handler, NULL);
+	rcu_assign_pointer(dev->rx_handler_data, NULL);
 }
 EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
Nope this changes nothing at all.
Erik, why doesn't help the write barrier between the assignments. It 
should guarantee their orders... or not?

Thanks,
Ivan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help