dev_change_net_namespace() and synchronize_net()

Previous thread: [PATCH] fec: use dma_alloc_coherent for descriptor ring by y on Tuesday, January 27, 2009 - 3:24 am. (5 messages)

Next thread: FEC Patches by Sascha Hauer on Tuesday, January 27, 2009 - 3:39 am. (11 messages)
From: Nicolas Dichtel
Date: Tuesday, January 27, 2009 - 3:23 am

Hi folks,

I'm asking me philosophical questions about synchronize_net(). In my 
understanding, it is used to ensure that processing of current packets are finished.

In function dev_change_net_namespace(), synchronize_net() is called twice:

One time, between dev_close() and dev_shutdown(). I don't understand why it's 
needed here:
  - if interface is down, no packet can be processed by it
  - if interface is up, dev_close() will call dev_deactivate() which will call 
synchronize_rcu() (equivalent to synchronize_net()).

Second time, synchronize_net() is called just before exiting. Is it really 
necessary?


Thank you for your answers,
Nicolas
--

Previous thread: [PATCH] fec: use dma_alloc_coherent for descriptor ring by y on Tuesday, January 27, 2009 - 3:24 am. (5 messages)

Next thread: FEC Patches by Sascha Hauer on Tuesday, January 27, 2009 - 3:39 am. (11 messages)