From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AE41A1DB1 for ; Wed, 31 Aug 2016 15:24:13 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 31 Aug 2016 06:24:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,262,1470726000"; d="scan'208";a="1033608999" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.221.13]) ([10.237.221.13]) by fmsmga001.fm.intel.com with ESMTP; 31 Aug 2016 06:24:12 -0700 To: =?UTF-8?B?5ZGo5p2o6LaF?= , dev@dpdk.org References: <57A87193.3010302@intel.com> From: Ferruh Yigit Message-ID: <57C6DA7B.9010408@intel.com> Date: Wed, 31 Aug 2016 14:24:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <57A87193.3010302@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] kni: error release device list head could cause a kernel crash. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2016 13:24:14 -0000 On 8/8/2016 12:48 PM, Ferruh Yigit wrote: > Hi, > > On 8/6/2016 12:19 PM, 周杨超 wrote: >> From 3edca1e3194959ba26a6c36143f8423009661b11 Mon Sep 17 00:00:00 2001 >> From: zhouyangchao >> Date: Sat, 6 Aug 2016 19:14:51 +0800 >> Subject: [PATCH] kni: error release device list head could cause a kernel crash. >> >> Signed-off-by: zhouyangchao >> --- >> lib/librte_eal/linuxapp/kni/kni_misc.c | 4 ++-- >> 1 file 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 ae8133f..a49924b 100644 >> --- a/lib/librte_eal/linuxapp/kni/kni_misc.c >> +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c >> @@ -276,8 +276,8 @@ kni_release(struct inode *inode, struct file *file) >> #ifdef RTE_KNI_VHOST >> kni_vhost_backend_release(dev); >> #endif >> - kni_dev_remove(dev); >> list_del(&dev->list); >> + kni_dev_remove(dev); >> } >> up_write(&knet->kni_list_lock); >> >> @@ -613,8 +613,8 @@ kni_ioctl_release(struct net *net, >> #ifdef RTE_KNI_VHOST >> kni_vhost_backend_release(dev); >> #endif >> - kni_dev_remove(dev); >> list_del(&dev->list); >> + kni_dev_remove(dev); >> ret = 0; >> break; >> } >> -- >> > > Can you please describe how crash can occur? > And if you have a crash log, can you include it? > > Access to device via list, removing device from list and adding device > to list all are protected by lock (kni_list_lock), so as far as I can > see the order of removing device and removing it from list shouldn't be > a problem. I have sent a patch to fix a crash in remove path, if you are working on master branch this can be same issue, can you please check following patch: http://dpdk.org/dev/patchwork/patch/15571/ Regards, ferruh