public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [patch net-next] vrf: add exit function and allow module unload
@ 2016-05-04 10:20 Jiri Pirko
  2016-05-04 10:23 ` Hannes Frederic Sowa
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Pirko @ 2016-05-04 10:20 UTC (permalink / raw)
  To: netdev; +Cc: davem, idosch, eladr, yotamg, dsa, shm

From: Jiri Pirko <jiri@mellanox.com>

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/vrf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 8a8f1e5..b217c2d 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -839,7 +839,14 @@ error:
 	return rc;
 }
 
+static void __exit vrf_exit_module(void)
+{
+	rtnl_link_unregister(&vrf_link_ops);
+	unregister_netdevice_notifier(&vrf_notifier_block);
+}
+
 module_init(vrf_init_module);
+module_exit(vrf_exit_module);
 MODULE_AUTHOR("Shrijeet Mukherjee, David Ahern");
 MODULE_DESCRIPTION("Device driver to instantiate VRF domains");
 MODULE_LICENSE("GPL");
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [patch net-next] vrf: add exit function and allow module unload
  2016-05-04 10:20 [patch net-next] vrf: add exit function and allow module unload Jiri Pirko
@ 2016-05-04 10:23 ` Hannes Frederic Sowa
  2016-05-04 10:24   ` Jiri Pirko
  2016-05-04 16:05   ` David Ahern
  0 siblings, 2 replies; 5+ messages in thread
From: Hannes Frederic Sowa @ 2016-05-04 10:23 UTC (permalink / raw)
  To: Jiri Pirko, netdev; +Cc: davem, idosch, eladr, yotamg, dsa, shm

Hello Jiri,

On Wed, May 4, 2016, at 12:20, Jiri Pirko wrote:
>  drivers/net/vrf.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
> index 8a8f1e5..b217c2d 100644
> --- a/drivers/net/vrf.c
> +++ b/drivers/net/vrf.c
> @@ -839,7 +839,14 @@ error:
>  	return rc;
>  }
>  
> +static void __exit vrf_exit_module(void)
> +{
> +       rtnl_link_unregister(&vrf_link_ops);
> +       unregister_netdevice_notifier(&vrf_notifier_block);
> +}
> +
>  module_init(vrf_init_module);
> +module_exit(vrf_exit_module);

The dst_entries created by vrf don't carry a reference to THIS_MODULE
but have a code dependency to the vrf module (e.g. via
vrf_output/vrf_output6) that gets published. This is exactly the same
why ipv6 cannot be unloaded.

Bye,
Hannes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch net-next] vrf: add exit function and allow module unload
  2016-05-04 10:23 ` Hannes Frederic Sowa
@ 2016-05-04 10:24   ` Jiri Pirko
  2016-05-04 15:59     ` David Miller
  2016-05-04 16:05   ` David Ahern
  1 sibling, 1 reply; 5+ messages in thread
From: Jiri Pirko @ 2016-05-04 10:24 UTC (permalink / raw)
  To: Hannes Frederic Sowa; +Cc: netdev, davem, idosch, eladr, yotamg, dsa, shm

Wed, May 04, 2016 at 12:23:42PM CEST, hannes@stressinduktion.org wrote:
>Hello Jiri,
>
>On Wed, May 4, 2016, at 12:20, Jiri Pirko wrote:
>>  drivers/net/vrf.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>> 
>> diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
>> index 8a8f1e5..b217c2d 100644
>> --- a/drivers/net/vrf.c
>> +++ b/drivers/net/vrf.c
>> @@ -839,7 +839,14 @@ error:
>>  	return rc;
>>  }
>>  
>> +static void __exit vrf_exit_module(void)
>> +{
>> +       rtnl_link_unregister(&vrf_link_ops);
>> +       unregister_netdevice_notifier(&vrf_notifier_block);
>> +}
>> +
>>  module_init(vrf_init_module);
>> +module_exit(vrf_exit_module);
>
>The dst_entries created by vrf don't carry a reference to THIS_MODULE
>but have a code dependency to the vrf module (e.g. via
>vrf_output/vrf_output6) that gets published. This is exactly the same
>why ipv6 cannot be unloaded.

Oh. Okay. Thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch net-next] vrf: add exit function and allow module unload
  2016-05-04 10:24   ` Jiri Pirko
@ 2016-05-04 15:59     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-05-04 15:59 UTC (permalink / raw)
  To: jiri; +Cc: hannes, netdev, idosch, eladr, yotamg, dsa, shm

From: Jiri Pirko <jiri@resnulli.us>
Date: Wed, 4 May 2016 12:24:55 +0200

> Wed, May 04, 2016 at 12:23:42PM CEST, hannes@stressinduktion.org wrote:
>>Hello Jiri,
>>
>>On Wed, May 4, 2016, at 12:20, Jiri Pirko wrote:
>>>  drivers/net/vrf.c | 7 +++++++
>>>  1 file changed, 7 insertions(+)
>>> 
>>> diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
>>> index 8a8f1e5..b217c2d 100644
>>> --- a/drivers/net/vrf.c
>>> +++ b/drivers/net/vrf.c
>>> @@ -839,7 +839,14 @@ error:
>>>  	return rc;
>>>  }
>>>  
>>> +static void __exit vrf_exit_module(void)
>>> +{
>>> +       rtnl_link_unregister(&vrf_link_ops);
>>> +       unregister_netdevice_notifier(&vrf_notifier_block);
>>> +}
>>> +
>>>  module_init(vrf_init_module);
>>> +module_exit(vrf_exit_module);
>>
>>The dst_entries created by vrf don't carry a reference to THIS_MODULE
>>but have a code dependency to the vrf module (e.g. via
>>vrf_output/vrf_output6) that gets published. This is exactly the same
>>why ipv6 cannot be unloaded.
> 
> Oh. Okay. Thanks!

So I'm dropping this.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch net-next] vrf: add exit function and allow module unload
  2016-05-04 10:23 ` Hannes Frederic Sowa
  2016-05-04 10:24   ` Jiri Pirko
@ 2016-05-04 16:05   ` David Ahern
  1 sibling, 0 replies; 5+ messages in thread
From: David Ahern @ 2016-05-04 16:05 UTC (permalink / raw)
  To: Hannes Frederic Sowa, Jiri Pirko, netdev
  Cc: davem, idosch, eladr, yotamg, shm

On 5/4/16 4:23 AM, Hannes Frederic Sowa wrote:
> Hello Jiri,
>
> On Wed, May 4, 2016, at 12:20, Jiri Pirko wrote:
>>   drivers/net/vrf.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
>> index 8a8f1e5..b217c2d 100644
>> --- a/drivers/net/vrf.c
>> +++ b/drivers/net/vrf.c
>> @@ -839,7 +839,14 @@ error:
>>   	return rc;
>>   }
>>
>> +static void __exit vrf_exit_module(void)
>> +{
>> +       rtnl_link_unregister(&vrf_link_ops);
>> +       unregister_netdevice_notifier(&vrf_notifier_block);
>> +}
>> +
>>   module_init(vrf_init_module);
>> +module_exit(vrf_exit_module);
>
> The dst_entries created by vrf don't carry a reference to THIS_MODULE
> but have a code dependency to the vrf module (e.g. via
> vrf_output/vrf_output6) that gets published. This is exactly the same
> why ipv6 cannot be unloaded.

exactly. The module exit was removed recently by 9ab179d83b4e ("net: 
vrf: Fix dst reference counting")

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-04 16:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 10:20 [patch net-next] vrf: add exit function and allow module unload Jiri Pirko
2016-05-04 10:23 ` Hannes Frederic Sowa
2016-05-04 10:24   ` Jiri Pirko
2016-05-04 15:59     ` David Miller
2016-05-04 16:05   ` David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox