Message ID | 1447225043-15404-1-git-send-email-xiaobo.chi@nokia.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 5491E8DAF; Wed, 11 Nov 2015 07:57:29 +0100 (CET) Received: from demumfd002.nsn-inter.net (demumfd002.nsn-inter.net [93.183.12.31]) by dpdk.org (Postfix) with ESMTP id 9E8FE8DA6 for <dev@dpdk.org>; Wed, 11 Nov 2015 07:57:27 +0100 (CET) Received: from demuprx016.emea.nsn-intra.net ([10.150.129.55]) by demumfd002.nsn-inter.net (8.15.2/8.15.2) with ESMTPS id tAB6vQ97016525 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Nov 2015 06:57:26 GMT Received: from localhost ([10.140.176.240]) by demuprx016.emea.nsn-intra.net (8.12.11.20060308/8.12.11) with ESMTP id tAB6vNGB007184; Wed, 11 Nov 2015 07:57:24 +0100 From: Xiaobo Chi <xiaobo.chi@nokia.com> To: dev@dpdk.org Date: Wed, 11 Nov 2015 14:57:23 +0800 Message-Id: <1447225043-15404-1-git-send-email-xiaobo.chi@nokia.com> X-Mailer: git-send-email 1.9.4.msysgit.2 In-Reply-To: <1446789877-11656-1-git-send-email-xiaobo.chi@nokia.com> References: <1446789877-11656-1-git-send-email-xiaobo.chi@nokia.com> X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 1595 X-purgate-ID: 151667::1447225047-00007A48-99CBB666/0/0 Cc: Xiaobo Chi <xiaobo.chi@nokia.com> Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
chixiaobo
Nov. 11, 2015, 6:57 a.m. UTC
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 <xiaobo.chi@nokia.com>
---
lib/librte_vhost/eventfd_link/eventfd_link.c | 1 +
1 file changed, 1 insertion(+)
Comments
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> --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 <xiaobo.chi@nokia.com> > --- > 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
> > 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 <xiaobo.chi@nokia.com> > Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Applied, thanks
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, };