[dpdk-dev] Bug fix in module_init and module_exit

Message ID 1472436734-5538-1-git-send-email-guopengfei160@163.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Commit Message

郭鹏飞 Aug. 29, 2016, 2:12 a.m. UTC
  Fix pernet calls when HAVE_SIMPLIFIED_PERNET_OPERATIONS is not set.

Signed-off-by: Vincent Guo <guopengfei160@163.com>
---
 lib/librte_eal/linuxapp/kni/kni_misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ferruh Yigit Aug. 29, 2016, 9:36 a.m. UTC | #1
Hi Vincent,

On 8/29/2016 3:12 AM, Vincent Guo wrote:
> Fix pernet calls when HAVE_SIMPLIFIED_PERNET_OPERATIONS is not set.
> 
> Signed-off-by: Vincent Guo <guopengfei160@163.com>
> ---

Thank you for the update, patch applies well this time.

A few more small details:

- Patch subject should start with a label/tag, that shows the
corresponding subsystem. For this patch it is "kni:".

- In patch subject, after label, sentences starts with lowercase, so
patch subject becomes:

kni: bug fix in module_init and module_exit


- "Fixes:" tag is a line in commit log, to reference the commit that
generated the error. For this patch it is:

Fixes: e6734d21b4e1 ("kni: fix build with kernel 2.6.32")

This line should go above "Signed-off-by", with an empty line between.

- Replying to previous mail thread help others to see the history of the
patch. the option --in-reply-to of the "git send-email" can be used for
this.

It is possible to get Message ID of the mail that you want to reply via
patchwork or from mail client. For example for this patch, you can see
the message id from: http://dpdk.org/dev/patchwork/patch/15506/

- Adding version number to the patch helps following history. Each
updated patch increases the version number. "-vN" option of the "git
format-patch" is useful for this.

- When a new version of the patch sent, the status of the previous
version should be updated in patchwork as "Superseded". For this case
previous version is: http://dpdk.org/dev/patchwork/patch/15506/


Thanks,
ferruh
  
Ferruh Yigit Aug. 29, 2016, 9:38 a.m. UTC | #2
On 8/29/2016 10:36 AM, Ferruh Yigit wrote:
> Hi Vincent,
> 
> On 8/29/2016 3:12 AM, Vincent Guo wrote:
>> Fix pernet calls when HAVE_SIMPLIFIED_PERNET_OPERATIONS is not set.
>>
>> Signed-off-by: Vincent Guo <guopengfei160@163.com>
>> ---
> 
> Thank you for the update, patch applies well this time.
> 
> A few more small details:
> 
> - Patch subject should start with a label/tag, that shows the
> corresponding subsystem. For this patch it is "kni:".
> 
> - In patch subject, after label, sentences starts with lowercase, so
> patch subject becomes:
> 
> kni: bug fix in module_init and module_exit
> 
> 
> - "Fixes:" tag is a line in commit log, to reference the commit that
> generated the error. For this patch it is:
> 
> Fixes: e6734d21b4e1 ("kni: fix build with kernel 2.6.32")
> 
> This line should go above "Signed-off-by", with an empty line between.
> 
> - Replying to previous mail thread help others to see the history of the
> patch. the option --in-reply-to of the "git send-email" can be used for
> this.
> 
> It is possible to get Message ID of the mail that you want to reply via
> patchwork or from mail client. For example for this patch, you can see
> the message id from: http://dpdk.org/dev/patchwork/patch/15506/
> 
> - Adding version number to the patch helps following history. Each
> updated patch increases the version number. "-vN" option of the "git
> format-patch" is useful for this.
> 
> - When a new version of the patch sent, the status of the previous
> version should be updated in patchwork as "Superseded". For this case
> previous version is: http://dpdk.org/dev/patchwork/patch/15506/

Correction: http://dpdk.org/dev/patchwork/patch/15315/

> 
> 
> Thanks,
> ferruh
>
  

Patch

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");
 }