From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DDEB08DA6 for ; Wed, 11 Nov 2015 08:03:28 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 10 Nov 2015 23:03:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,274,1444719600"; d="scan'208";a="598111228" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by FMSMGA003.fm.intel.com with ESMTP; 10 Nov 2015 23:03:27 -0800 Date: Wed, 11 Nov 2015 15:07:21 +0800 From: Yuanhan Liu To: Xiaobo Chi Message-ID: <20151111070721.GX2326@yliu-dev.sh.intel.com> References: <1446789877-11656-1-git-send-email-xiaobo.chi@nokia.com> <1447225043-15404-1-git-send-email-xiaobo.chi@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447225043-15404-1-git-send-email-xiaobo.chi@nokia.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] vhost: fix eventfd_link.ko insertion failure problem 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, 11 Nov 2015 07:03:29 -0000 Acked-by: Yuanhan Liu --yliu On Wed, Nov 11, 2015 at 02:57:23PM +0800, Xiaobo Chi wrote: > Problem:if I firstly insert my kmod_test.ko, then insert eventfd_link.ko, > error will happen with hint " Device or resource busy". This is because > the default minor device number, 0, has been occupied by my kmod_test.ko . > > root@distro:~/test$ lsmod > Module Size Used by > kmod_test 927 0 > vboxsf 35930 4 > vboxguest 222130 1 vboxsf > microcode 10315 0 > autofs4 25051 0 > root@distro:~/test$ insmod ./eventfd_link.ko > insmod: ERROR: could not insert module ./eventfd_link.ko: Device or > resource busy > > Explanation: For miscdevices, the major device_no is same, so the minor > device_no should be set to ditinguish different misc devices; if not set > the minor, it may fail while insmod due to the default minor value, 0, has > been used by other miscdevice. MISC_DYNAMIC_MINOR means to let Linux > kernel dynamically assign one minor devide number while loading. > > Signed-off-by: Xiaobo Chi > --- > lib/librte_vhost/eventfd_link/eventfd_link.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib/librte_vhost/eventfd_link/eventfd_link.c > index c54a938..4b05b5a 100644 > --- a/lib/librte_vhost/eventfd_link/eventfd_link.c > +++ b/lib/librte_vhost/eventfd_link/eventfd_link.c > @@ -249,6 +249,7 @@ static const struct file_operations eventfd_link_fops = { > > > static struct miscdevice eventfd_link_misc = { > + .minor = MISC_DYNAMIC_MINOR, > .name = "eventfd-link", > .fops = &eventfd_link_fops, > }; > -- > 1.9.4.msysgit.2