DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] kni: unregister an unregisterd net_device could cause a kernel crash
@ 2016-09-09  2:42 zhouyangchao
  2016-09-08 16:47 ` Stephen Hemminger
  0 siblings, 1 reply; 12+ messages in thread
From: zhouyangchao @ 2016-09-09  2:42 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, zhouyangchao

Signed-off-by: zhouyangchao <zhouyates@gmail.com>
---
 lib/librte_eal/linuxapp/kni/kni_misc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c
index 67e9b7d..17b6d7a 100644
--- a/lib/librte_eal/linuxapp/kni/kni_misc.c
+++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
@@ -361,6 +361,9 @@ kni_dev_remove(struct kni_dev *dev)
 		igb_kni_remove(dev->pci_dev);
 
 	if (dev->net_dev) {
+		if (dev->net_dev->state == NETREG_REGISTERED) {
+			unregister_netdev(dev->net_dev);
+		}
 		unregister_netdev(dev->net_dev);
 		free_netdev(dev->net_dev);
 	}
-- 
1.7.1

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH] kni: unregister an unregisterd net_device could cause a kernel crash
@ 2016-09-09  2:46 zhouyangchao
  2016-09-08 16:44 ` Stephen Hemminger
  2016-09-08 17:07 ` Ferruh Yigit
  0 siblings, 2 replies; 12+ messages in thread
From: zhouyangchao @ 2016-09-09  2:46 UTC (permalink / raw)
  To: ferruh.yigit; +Cc: dev, zhouyangchao

Signed-off-by: zhouyangchao <zhouyates@gmail.com>
---
 lib/librte_eal/linuxapp/kni/kni_misc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c
index 67e9b7d..ad4e603 100644
--- a/lib/librte_eal/linuxapp/kni/kni_misc.c
+++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
@@ -361,7 +361,9 @@ kni_dev_remove(struct kni_dev *dev)
 		igb_kni_remove(dev->pci_dev);
 
 	if (dev->net_dev) {
-		unregister_netdev(dev->net_dev);
+		if (dev->netdev->reg_state == NETREG_REGISTERED){
+			unregister_netdev(dev->net_dev);
+		}
 		free_netdev(dev->net_dev);
 	}
 
-- 
1.7.1

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

end of thread, other threads:[~2016-09-21 16:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09  2:42 [dpdk-dev] [PATCH] kni: unregister an unregisterd net_device could cause a kernel crash zhouyangchao
2016-09-08 16:47 ` Stephen Hemminger
2016-09-09  2:46 zhouyangchao
2016-09-08 16:44 ` Stephen Hemminger
2016-09-08 17:15   ` Ferruh Yigit
2016-09-09 12:40     ` Thomas Monjalon
2016-09-09 14:33       ` Mcnamara, John
2016-09-10  7:57         ` Thomas Monjalon
2016-09-08 17:07 ` Ferruh Yigit
2016-09-11  9:59   ` zhouyangchao
2016-09-13 13:13     ` Ferruh Yigit
2016-09-21 16:41       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).