[PATCH] kni: bug fix in module_init and module_exit

Subsystems: library code, the rest

STALE3700d

2 messages, 2 authors, 2016-08-25 · open the first message on its own page

[PATCH] kni: bug fix in module_init and module_exit

From: 郭鹏飞 <hidden>
Date: 2016-08-25 11:45:40

From 932e33f33cf2a19ac5fa4295535b6b0e20c61890 Mon Sep 17 00:00:00 2001
From: Vincent Guo <redacted>
Date: Thu, 25 Aug 2016 17:50:10 +0800
Subject: [PATCH] kni: bug fix in module_init and module_exit
 unregister_XXX should be called when module exits or error occurs
 during module init, but register_XXX is called in case that
 HAVE_SIMPLIFIED_PERNET_OPERATIONS is not set.


---
 lib/librte_eal/linuxapp/kni/kni_misc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c
index 67e9b7d..d7850be 100644
--- a/lib/librte_eal/linuxapp/kni/kni_misc.c
+++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
@@ -194,7 +194,7 @@ out:
 #ifdef HAVE_SIMPLIFIED_PERNET_OPERATIONS
 unregister_pernet_subsys(&kni_net_ops);
 #else
-register_pernet_gen_subsys(&kni_net_id, &kni_net_ops);
+unregister_pernet_gen_subsys(kni_net_id, &kni_net_ops);
 #endif
 return rc;
 }
@@ -206,7 +206,7 @@ kni_exit(void)
 #ifdef HAVE_SIMPLIFIED_PERNET_OPERATIONS
 unregister_pernet_subsys(&kni_net_ops);
 #else
-register_pernet_gen_subsys(&kni_net_id, &kni_net_ops);
+unregister_pernet_gen_subsys(kni_net_id, &kni_net_ops);
 #endif
 KNI_PRINT("####### DPDK kni module unloaded  #######\n");
 }
-- 
1.7.1

Re: [PATCH] kni: bug fix in module_init and module_exit

From: Ferruh Yigit <hidden>
Date: 2016-08-25 16:19:22

Hi Vincent,

On 8/25/2016 12:45 PM, 郭鹏飞 wrote:
From 932e33f33cf2a19ac5fa4295535b6b0e20c61890 Mon Sep 17 00:00:00 2001
From: Vincent Guo <redacted>
Date: Thu, 25 Aug 2016 17:50:10 +0800
Subject: [PATCH] kni: bug fix in module_init and module_exit
 unregister_XXX should be called when module exits or error occurs
 during module init, but register_XXX is called in case that
 HAVE_SIMPLIFIED_PERNET_OPERATIONS is not set.
Patch content is good, thanks for the fix, but patch doesn't apply
cleanly (leading spaces are missing)
Also in commit log, Signed-off-by and Fixes tags are missing.

And commit log can be simpler, something like:
"Fix pernet calls when HAVE_SIMPLIFIED_PERNET_OPERATIONS is not set."

Would you mind sending a new version of the patch?

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