All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: vrf: fix remove vrf module error when there's no reference
@ 2019-03-02 12:31 linmiaohe
  2019-03-02 20:15 ` David Ahern
  2019-03-04  8:40 ` kbuild test robot
  0 siblings, 2 replies; 4+ messages in thread
From: linmiaohe @ 2019-03-02 12:31 UTC (permalink / raw)
  To: David Ahern, Shrijeet Mukherjee, netdev; +Cc: Mingfangsen

From: Miaohe Lin <linmiaohe@huawei.com>

If we insmod vrf.ko, there is no way to remove it because of lack of module_exit.
I think we may need it.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 drivers/net/vrf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 7c1430ed0244..0e93690482d4 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -1462,7 +1462,15 @@ static int __init vrf_init_module(void)
 	return rc;
 }

+static void __exit vrf_fini_module(void)
+{
+	rtnl_link_unregister(&vrf_link_ops);
+	unregister_pernet_subsys(&vrf_net_ops);
+	unregister_netdevice_notifier(&vrf_notifier_block);
+}
+
 module_init(vrf_init_module);
+module_exit(vrf_fini_module);
 MODULE_AUTHOR("Shrijeet Mukherjee, David Ahern");
 MODULE_DESCRIPTION("Device driver to instantiate VRF domains");
 MODULE_LICENSE("GPL");
-- 
2.16.2




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

* Re: [PATCH net] net: vrf: fix remove vrf module error when there's no reference
  2019-03-02 12:31 [PATCH net] net: vrf: fix remove vrf module error when there's no reference linmiaohe
@ 2019-03-02 20:15 ` David Ahern
  2019-03-04  1:53   ` linmiaohe
  2019-03-04  8:40 ` kbuild test robot
  1 sibling, 1 reply; 4+ messages in thread
From: David Ahern @ 2019-03-02 20:15 UTC (permalink / raw)
  To: linmiaohe, Shrijeet Mukherjee, netdev; +Cc: Mingfangsen

On 3/2/19 5:31 AM, linmiaohe wrote:
> From: Miaohe Lin <linmiaohe@huawei.com>
> 
> If we insmod vrf.ko, there is no way to remove it because of lack of module_exit.
> I think we may need it.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  drivers/net/vrf.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

The ability to unload the vrf driver was removed by
9ab179d83b4e31ea277a123492e419067c2f129a.


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

* Re: [PATCH net] net: vrf: fix remove vrf module error when there's no reference
  2019-03-02 20:15 ` David Ahern
@ 2019-03-04  1:53   ` linmiaohe
  0 siblings, 0 replies; 4+ messages in thread
From: linmiaohe @ 2019-03-04  1:53 UTC (permalink / raw)
  To: David Ahern, Shrijeet Mukherjee, netdev; +Cc: Mingfangsen

On 2019/3/3 4:15, David Ahern wrote:
> On 3/2/19 5:31 AM, linmiaohe wrote:
>> From: Miaohe Lin <linmiaohe@huawei.com>
>>
>> If we insmod vrf.ko, there is no way to remove it because of lack of module_exit.
>> I think we may need it.
>>
>> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>> ---
>>  drivers/net/vrf.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
> 
> The ability to unload the vrf driver was removed by
> 9ab179d83b4e31ea277a123492e419067c2f129a.
> 
> 
> 
I think I should git blame the vrf more carefully next time.
Thank you very much for your replay.


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

* Re: [PATCH net] net: vrf: fix remove vrf module error when there's no reference
  2019-03-02 12:31 [PATCH net] net: vrf: fix remove vrf module error when there's no reference linmiaohe
  2019-03-02 20:15 ` David Ahern
@ 2019-03-04  8:40 ` kbuild test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2019-03-04  8:40 UTC (permalink / raw)
  To: linmiaohe
  Cc: kbuild-all, David Ahern, Shrijeet Mukherjee, netdev, Mingfangsen

[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]

Hi Miaohe,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net/master]

url:    https://github.com/0day-ci/linux/commits/linmiaohe/net-vrf-fix-remove-vrf-module-error-when-there-s-no-reference/20190303-082433
config: x86_64-randconfig-u0-03041013 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

>> WARNING: drivers/net/vrf.o(.exit.text+0x14): Section mismatch in reference from the function cleanup_module() to the variable .init.data:vrf_net_ops
   The function __exit cleanup_module() references
   a variable __initdata vrf_net_ops.
   This is often seen when error handling in the exit function
   uses functionality in the init path.
   The fix is often to remove the __initdata annotation of
   vrf_net_ops so it may be used outside an init section.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 39279 bytes --]

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

end of thread, other threads:[~2019-03-04  8:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-02 12:31 [PATCH net] net: vrf: fix remove vrf module error when there's no reference linmiaohe
2019-03-02 20:15 ` David Ahern
2019-03-04  1:53   ` linmiaohe
2019-03-04  8:40 ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.