* [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified @ 2015-11-06 6:04 Xiaobo Chi 2015-11-09 4:22 ` Yuanhan Liu 2015-11-11 6:57 ` [dpdk-dev] [PATCH v2] vhost: fix eventfd_link.ko insertion failure problem Xiaobo Chi 0 siblings, 2 replies; 9+ messages in thread From: Xiaobo Chi @ 2015-11-06 6:04 UTC (permalink / raw) To: dev; +Cc: Xiaobo Chi, changchun.ouyang eventfd_link_misc's minor number shall be MISC_DYNAMIC_MINOR to let Linux kernel dynamically assign one 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified 2015-11-06 6:04 [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified Xiaobo Chi @ 2015-11-09 4:22 ` Yuanhan Liu 2015-11-09 10:03 ` Chi, Xiaobo (Nokia - CN/Hangzhou) 2015-11-11 6:57 ` [dpdk-dev] [PATCH v2] vhost: fix eventfd_link.ko insertion failure problem Xiaobo Chi 1 sibling, 1 reply; 9+ messages in thread From: Yuanhan Liu @ 2015-11-09 4:22 UTC (permalink / raw) To: Xiaobo Chi; +Cc: dev, changchun.ouyang On Fri, Nov 06, 2015 at 02:04:37PM +0800, Xiaobo Chi wrote: > eventfd_link_misc's minor number shall be MISC_DYNAMIC_MINOR to let Linux kernel dynamically assign one while loading. For such (fix) patch, I'd like to see what exact issue your patch fixes. And if it fixes an issue, you'd better title your patch with something like "vhost: fix ...", so that it's likely Thomas will put it into high priority. --yliu > > 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified 2015-11-09 4:22 ` Yuanhan Liu @ 2015-11-09 10:03 ` Chi, Xiaobo (Nokia - CN/Hangzhou) 2015-11-09 10:19 ` Chi, Xiaobo (Nokia - CN/Hangzhou) 0 siblings, 1 reply; 9+ messages in thread From: Chi, Xiaobo (Nokia - CN/Hangzhou) @ 2015-11-09 10:03 UTC (permalink / raw) To: EXT Yuanhan Liu; +Cc: dev, changchun.ouyang Hi, 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. You can refer to the kni_misc.c Brgs, Chi Xiaobo -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of EXT Yuanhan Liu Sent: Monday, November 09, 2015 12:23 PM To: Chi, Xiaobo (Nokia - CN/Hangzhou) Cc: dev@dpdk.org; changchun.ouyang@intel.com Subject: Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified On Fri, Nov 06, 2015 at 02:04:37PM +0800, Xiaobo Chi wrote: > eventfd_link_misc's minor number shall be MISC_DYNAMIC_MINOR to let Linux kernel dynamically assign one while loading. For such (fix) patch, I'd like to see what exact issue your patch fixes. And if it fixes an issue, you'd better title your patch with something like "vhost: fix ...", so that it's likely Thomas will put it into high priority. --yliu > > 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified 2015-11-09 10:03 ` Chi, Xiaobo (Nokia - CN/Hangzhou) @ 2015-11-09 10:19 ` Chi, Xiaobo (Nokia - CN/Hangzhou) 2015-11-09 12:58 ` Yuanhan Liu 0 siblings, 1 reply; 9+ messages in thread From: Chi, Xiaobo (Nokia - CN/Hangzhou) @ 2015-11-09 10:19 UTC (permalink / raw) To: Chi, Xiaobo (Nokia - CN/Hangzhou), EXT Yuanhan Liu; +Cc: dev, changchun.ouyang Hi, And following is a test by me, we can see that 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$ modinfo kmod_test modinfo: ERROR: Module kmod_test not found. root@distro:~/test$ modinfo kmod_test.ko filename: /root/test/kmod_test.ko alias: devname:test description: my test author: Xiaobo Chi license: GPL v2 version: 0.0.1 srcversion: C2BDEBC81A17F8197C7C44A depends: vermagic: 3.18.9-pc64-distro.git-v1.7 SMP mod_unload root@distro:~/test$ dmesg -c root@distro:~/test$ ls eventfd_link.ko kmod_test.ko kmod_test.mod.o main Makefile Module.symvers kmod_test.c kmod_test.mod.c kmod_test.o main.c modules.order root@distro:~/test$ insmod ./eventfd_link.ko insmod: ERROR: could not insert module ./eventfd_link.ko: Device or resource busy root@distro:~/test$ dmesg -c brgs, Xiaobo Chi -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of EXT Chi, Xiaobo (Nokia - CN/Hangzhou) Sent: Monday, November 09, 2015 6:03 PM To: EXT Yuanhan Liu Cc: dev@dpdk.org; changchun.ouyang@intel.com Subject: Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified Hi, 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. You can refer to the kni_misc.c Brgs, Chi Xiaobo -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of EXT Yuanhan Liu Sent: Monday, November 09, 2015 12:23 PM To: Chi, Xiaobo (Nokia - CN/Hangzhou) Cc: dev@dpdk.org; changchun.ouyang@intel.com Subject: Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified On Fri, Nov 06, 2015 at 02:04:37PM +0800, Xiaobo Chi wrote: > eventfd_link_misc's minor number shall be MISC_DYNAMIC_MINOR to let Linux kernel dynamically assign one while loading. For such (fix) patch, I'd like to see what exact issue your patch fixes. And if it fixes an issue, you'd better title your patch with something like "vhost: fix ...", so that it's likely Thomas will put it into high priority. --yliu > > 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified 2015-11-09 10:19 ` Chi, Xiaobo (Nokia - CN/Hangzhou) @ 2015-11-09 12:58 ` Yuanhan Liu 2015-11-10 2:24 ` Chi, Xiaobo (Nokia - CN/Hangzhou) 0 siblings, 1 reply; 9+ messages in thread From: Yuanhan Liu @ 2015-11-09 12:58 UTC (permalink / raw) To: Chi, Xiaobo (Nokia - CN/Hangzhou); +Cc: dev On Mon, Nov 09, 2015 at 10:19:54AM +0000, Chi, Xiaobo (Nokia - CN/Hangzhou) wrote: > Hi, > > And following is a test by me, we can see that 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 . Good to know and thanks for the explanation. It's well explained, and you should put them (including below example) to commit log. With the detailed issue explanation, and steps to reproduce, it just gives your patch more chance to get reviewed (and merged). And, don't forget to title your patch with "vhost: fix ..." preifx. FYI, there is another custom for a fix patch in DPDK community: adding an extra line like following to indicate the latest commit introduces such bug: Fixes: 62dbd2ffea9a ("ethdev: add more flow director modes") Which is generated with following git alias (check http://dpdk.org/dev for more information): [alias] fixline = log -1 --abbrev=12 --format='Fixes: %h (\"%s\")' So, would you please send v2? --yliu > > 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$ modinfo kmod_test > modinfo: ERROR: Module kmod_test not found. > root@distro:~/test$ modinfo kmod_test.ko > filename: /root/test/kmod_test.ko > alias: devname:test > description: my test > author: Xiaobo Chi > license: GPL v2 > version: 0.0.1 > srcversion: C2BDEBC81A17F8197C7C44A > depends: > vermagic: 3.18.9-pc64-distro.git-v1.7 SMP mod_unload > root@distro:~/test$ dmesg -c > root@distro:~/test$ ls > eventfd_link.ko kmod_test.ko kmod_test.mod.o main Makefile Module.symvers > kmod_test.c kmod_test.mod.c kmod_test.o main.c modules.order > root@distro:~/test$ insmod ./eventfd_link.ko > insmod: ERROR: could not insert module ./eventfd_link.ko: Device or resource busy > root@distro:~/test$ dmesg -c > > brgs, > Xiaobo Chi > > > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of EXT Chi, Xiaobo (Nokia - CN/Hangzhou) > Sent: Monday, November 09, 2015 6:03 PM > To: EXT Yuanhan Liu > Cc: dev@dpdk.org; changchun.ouyang@intel.com > Subject: Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified > > Hi, > 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. > You can refer to the kni_misc.c > > Brgs, > Chi Xiaobo > > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of EXT Yuanhan Liu > Sent: Monday, November 09, 2015 12:23 PM > To: Chi, Xiaobo (Nokia - CN/Hangzhou) > Cc: dev@dpdk.org; changchun.ouyang@intel.com > Subject: Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified > > On Fri, Nov 06, 2015 at 02:04:37PM +0800, Xiaobo Chi wrote: > > eventfd_link_misc's minor number shall be MISC_DYNAMIC_MINOR to let Linux kernel dynamically assign one while loading. > > For such (fix) patch, I'd like to see what exact issue your patch fixes. > > And if it fixes an issue, you'd better title your patch with something > like "vhost: fix ...", so that it's likely Thomas will put it into > high priority. > > --yliu > > > > > 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified 2015-11-09 12:58 ` Yuanhan Liu @ 2015-11-10 2:24 ` Chi, Xiaobo (Nokia - CN/Hangzhou) 0 siblings, 0 replies; 9+ messages in thread From: Chi, Xiaobo (Nokia - CN/Hangzhou) @ 2015-11-10 2:24 UTC (permalink / raw) To: EXT Yuanhan Liu; +Cc: dev Hi, Liu, thanks for your comments and guide. I will send a v2 soon. Brgs, Xiaobo Chi -----Original Message----- From: EXT Yuanhan Liu [mailto:yuanhan.liu@linux.intel.com] Sent: Monday, November 09, 2015 8:58 PM To: Chi, Xiaobo (Nokia - CN/Hangzhou) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified On Mon, Nov 09, 2015 at 10:19:54AM +0000, Chi, Xiaobo (Nokia - CN/Hangzhou) wrote: > Hi, > > And following is a test by me, we can see that 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 . Good to know and thanks for the explanation. It's well explained, and you should put them (including below example) to commit log. With the detailed issue explanation, and steps to reproduce, it just gives your patch more chance to get reviewed (and merged). And, don't forget to title your patch with "vhost: fix ..." preifx. FYI, there is another custom for a fix patch in DPDK community: adding an extra line like following to indicate the latest commit introduces such bug: Fixes: 62dbd2ffea9a ("ethdev: add more flow director modes") Which is generated with following git alias (check http://dpdk.org/dev for more information): [alias] fixline = log -1 --abbrev=12 --format='Fixes: %h (\"%s\")' So, would you please send v2? --yliu > > 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$ modinfo kmod_test > modinfo: ERROR: Module kmod_test not found. > root@distro:~/test$ modinfo kmod_test.ko > filename: /root/test/kmod_test.ko > alias: devname:test > description: my test > author: Xiaobo Chi > license: GPL v2 > version: 0.0.1 > srcversion: C2BDEBC81A17F8197C7C44A > depends: > vermagic: 3.18.9-pc64-distro.git-v1.7 SMP mod_unload > root@distro:~/test$ dmesg -c > root@distro:~/test$ ls > eventfd_link.ko kmod_test.ko kmod_test.mod.o main Makefile Module.symvers > kmod_test.c kmod_test.mod.c kmod_test.o main.c modules.order > root@distro:~/test$ insmod ./eventfd_link.ko > insmod: ERROR: could not insert module ./eventfd_link.ko: Device or resource busy > root@distro:~/test$ dmesg -c > > brgs, > Xiaobo Chi > > > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of EXT Chi, Xiaobo (Nokia - CN/Hangzhou) > Sent: Monday, November 09, 2015 6:03 PM > To: EXT Yuanhan Liu > Cc: dev@dpdk.org; changchun.ouyang@intel.com > Subject: Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified > > Hi, > 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. > You can refer to the kni_misc.c > > Brgs, > Chi Xiaobo > > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of EXT Yuanhan Liu > Sent: Monday, November 09, 2015 12:23 PM > To: Chi, Xiaobo (Nokia - CN/Hangzhou) > Cc: dev@dpdk.org; changchun.ouyang@intel.com > Subject: Re: [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified > > On Fri, Nov 06, 2015 at 02:04:37PM +0800, Xiaobo Chi wrote: > > eventfd_link_misc's minor number shall be MISC_DYNAMIC_MINOR to let Linux kernel dynamically assign one while loading. > > For such (fix) patch, I'd like to see what exact issue your patch fixes. > > And if it fixes an issue, you'd better title your patch with something > like "vhost: fix ...", so that it's likely Thomas will put it into > high priority. > > --yliu > > > > > 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH v2] vhost: fix eventfd_link.ko insertion failure problem 2015-11-06 6:04 [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified Xiaobo Chi 2015-11-09 4:22 ` Yuanhan Liu @ 2015-11-11 6:57 ` Xiaobo Chi 2015-11-11 7:07 ` Yuanhan Liu 1 sibling, 1 reply; 9+ messages in thread From: Xiaobo Chi @ 2015-11-11 6:57 UTC (permalink / raw) To: dev; +Cc: Xiaobo Chi 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH v2] vhost: fix eventfd_link.ko insertion failure problem 2015-11-11 6:57 ` [dpdk-dev] [PATCH v2] vhost: fix eventfd_link.ko insertion failure problem Xiaobo Chi @ 2015-11-11 7:07 ` Yuanhan Liu 2015-11-24 18:05 ` Thomas Monjalon 0 siblings, 1 reply; 9+ messages in thread From: Yuanhan Liu @ 2015-11-11 7:07 UTC (permalink / raw) To: Xiaobo Chi; +Cc: dev 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH v2] vhost: fix eventfd_link.ko insertion failure problem 2015-11-11 7:07 ` Yuanhan Liu @ 2015-11-24 18:05 ` Thomas Monjalon 0 siblings, 0 replies; 9+ messages in thread From: Thomas Monjalon @ 2015-11-24 18:05 UTC (permalink / raw) To: Xiaobo Chi; +Cc: dev > > 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-11-24 18:07 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-11-06 6:04 [dpdk-dev] [PATCH] vhost: eventfd_link's minor number shall be specified Xiaobo Chi 2015-11-09 4:22 ` Yuanhan Liu 2015-11-09 10:03 ` Chi, Xiaobo (Nokia - CN/Hangzhou) 2015-11-09 10:19 ` Chi, Xiaobo (Nokia - CN/Hangzhou) 2015-11-09 12:58 ` Yuanhan Liu 2015-11-10 2:24 ` Chi, Xiaobo (Nokia - CN/Hangzhou) 2015-11-11 6:57 ` [dpdk-dev] [PATCH v2] vhost: fix eventfd_link.ko insertion failure problem Xiaobo Chi 2015-11-11 7:07 ` Yuanhan Liu 2015-11-24 18:05 ` 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).