George P Nychis
2006-Apr-11 01:44 UTC
created new q_disc, inserted module, tc tells me unknown qdisc
Hi, I am trying to install a proprietary qdisc made for research, it is not publically released yet, however its been used several times so i know it works. The files included are: q_xcp.c: static int xcp_parse_opt() static int xcp_print_opt() static int xcp_print_xstats() struct qdisc_util xcp_util = { "NULL", "xcp" ..... }; sch_xcp.c: static int xcp_enqueue() static int xcp_requeue() static struct sk_buff * xcp_dequeue() .... .... struct Qdisc_ops xcp_qdisc_ops ={ NULL,NULL,"xcp",.... }; printk(KERN_INFO "XCP qdisc module loaded.\n"); return register_qdisc(&xcp_qdisc_ops); So, i make everything successfully, it creates q_xcp.so and copies it to /usr/lib and sch_xcp.o which it copies to /lib/modules/... so then I "insmod sch_xcp" and i see in dmesg: "XCP qdisc module loaded." I then try: "tc qdisc add dev eth0 root xcp capacity 10Mbit limit 500" and get: "Unknown qdisc "xcp", hence option "capacity" is unparsable" So then I read the INSTALL further to find some sort of solution and it mentions: This again assumes "tc" version is 2.4.7. If your "tc" is a different version, download the iproute2 source code, and edit Makefile to point "TC_INCLUDE" to "-I..../iproute2/include -I..../iproute2/tc" So, i did that, and i recompiled the q_xcp.so: lanthanum-ini src-1.0.1 # make q_xcp.so cc -O2 -fPIC -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/include/ -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/tc_include -o q_xcp.o -c q_xcp.c ld -shared -o q_xcp.so q_xcp.o rm -f q_xcp.o But i still get the same error.... so then my very final last effort was to move q_xcp.c to my iproute2 source code tc/ directory and added this to the makefile: TCMODULES += q_xcp.o Then I compiled tc, and i check tc to see if the xcp qdisc functions were loaded: lanthanum-ini tc # nm tc | grep xcp 080531ec t xcp_parse_opt 080533e0 t xcp_print_opt 08053426 t xcp_print_xstats 08070cc0 D xcp_util And finally: lanthanum-ini tc # ./tc qdisc add dev ath0 root xcp capacity 54Mbit limit 500 Unknown qdisc "xcp", hence option "capacity" is unparsable I have no clue :( I figured that putting the .so into /usr/lib would have been enough. Sorry for the long e-mail, I hope someone can help, and thank you for your time even if you don''t know the solution but read this :) - George
Tim Shepard
2006-Apr-11 04:27 UTC
Re: created new q_disc, inserted module, tc tells me unknown qdisc
To debug this you''ll probably want to have a look at the get_qdisc_kind() routine in tc/tc.c in the iproute sources and understand how it uses dlopen() to find the routines to parse the arguments to the various different qdisc implementations.. I hope this helps. Is your xcp-implementing qdisc code available anywhere yet? Are you using the same packet format as the folks at ISI are using in their FreeBSD implementation? (They wrote a internet draft describing the XCP packet format a year or two ago.) -Tim Shepard shep@alum.mit.edu
George Nychis
2006-Apr-11 04:33 UTC
Re: created new q_disc, inserted module, tc tells me unknown qdisc
Hey Tim, I will take a look at that routine, it just seems no matter what I do I cannot seem to find out why it determines it does not have xcp qdisc support. I will look deeper into it. I am not sure if it has been released to the public yet. I am using Yongguang Zhang and Tom Henderson''s Linux implementation. I am also not sure it is the same packet formated as the ISI FreeBSD implementation. Tom pre-released it to me for my research on the topic, I think I will ask him if it is public yet, because if so I think I could find help a lot easier :) I will get back to you with what I find. Thanks! George Tim Shepard wrote:> To debug this you''ll probably want to have a look at the > get_qdisc_kind() routine in tc/tc.c in the iproute sources and > understand how it uses dlopen() to find the routines to parse the > arguments to the various different qdisc implementations.. > > I hope this helps. > > > Is your xcp-implementing qdisc code available anywhere yet? Are you > using the same packet format as the folks at ISI are using in their > FreeBSD implementation? (They wrote a internet draft describing the > XCP packet format a year or two ago.) > > -Tim Shepard > shep@alum.mit.edu >
Stephen Hemminger
2006-Apr-11 18:16 UTC
Re: created new q_disc, inserted module, tc tells me unknown qdisc
On Mon, 10 Apr 2006 21:41:39 -0400 (EDT) "George P Nychis" <gnychis@cmu.edu> wrote:> Hi, > > I am trying to install a proprietary qdisc made for research, it is not publically released yet, however its been used several times so i know it works. > > The files included are: > q_xcp.c: > static int xcp_parse_opt() > static int xcp_print_opt() > static int xcp_print_xstats() > struct qdisc_util xcp_util = { "NULL", "xcp" ..... }; > > sch_xcp.c: > static int xcp_enqueue() > static int xcp_requeue() > static struct sk_buff * xcp_dequeue() > .... > .... > struct Qdisc_ops xcp_qdisc_ops ={ NULL,NULL,"xcp",.... }; > > printk(KERN_INFO "XCP qdisc module loaded.\n"); > return register_qdisc(&xcp_qdisc_ops); > > > So, i make everything successfully, it creates q_xcp.so and copies it to /usr/lib and sch_xcp.o which it copies to /lib/modules/... so then I "insmod sch_xcp" and i see in dmesg: > "XCP qdisc module loaded." > > I then try: > "tc qdisc add dev eth0 root xcp capacity 10Mbit limit 500" and get: > "Unknown qdisc "xcp", hence option "capacity" is unparsable" > > So then I read the INSTALL further to find some sort of solution and it mentions: > This again assumes "tc" version is 2.4.7. If your "tc" is a different > version, download the iproute2 source code, and edit Makefile to > point "TC_INCLUDE" to "-I..../iproute2/include -I..../iproute2/tc" > > So, i did that, and i recompiled the q_xcp.so: > lanthanum-ini src-1.0.1 # make q_xcp.so > cc -O2 -fPIC -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/include/ -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/tc_include -o q_xcp.o -c q_xcp.c > ld -shared -o q_xcp.so q_xcp.o > rm -f q_xcp.o > > But i still get the same error.... so then my very final last effort was to move q_xcp.c to my iproute2 source code tc/ directory and added this to the makefile: > TCMODULES += q_xcp.o > > Then I compiled tc, and i check tc to see if the xcp qdisc functions were loaded: > lanthanum-ini tc # nm tc | grep xcp > 080531ec t xcp_parse_opt > 080533e0 t xcp_print_opt > 08053426 t xcp_print_xstats > 08070cc0 D xcp_util > > And finally: > lanthanum-ini tc # ./tc qdisc add dev ath0 root xcp capacity 54Mbit limit 500 > Unknown qdisc "xcp", hence option "capacity" is unparsable > > > I have no clue :( I figured that putting the .so into /usr/lib would have been enough. Sorry for the long e-mail, I hope someone can help, and thank you for your time even if you don''t know the solution but read this :) > > - George >The .so needs to go in /usr/lib/tc (assuming you are running relatively recent version of iproute2 tools). Read source to tc.c where it calls dlopen.
George P Nychis
2006-Apr-11 19:26 UTC
Re: created new q_disc, inserted module, tc tells me unknown qdisc
> On Mon, 10 Apr 2006 21:41:39 -0400 (EDT) "George P Nychis" > <gnychis@cmu.edu> wrote: > >> Hi, >> >> I am trying to install a proprietary qdisc made for research, it is not >> publically released yet, however its been used several times so i know >> it works. >> >> The files included are: q_xcp.c: static int xcp_parse_opt() static int >> xcp_print_opt() static int xcp_print_xstats() struct qdisc_util xcp_util >> = { "NULL", "xcp" ..... }; >> >> sch_xcp.c: static int xcp_enqueue() static int xcp_requeue() static struct >> sk_buff * xcp_dequeue() .... .... struct Qdisc_ops xcp_qdisc_ops ={ >> NULL,NULL,"xcp",.... }; >> >> printk(KERN_INFO "XCP qdisc module loaded.\n"); return >> register_qdisc(&xcp_qdisc_ops); >> >> >> So, i make everything successfully, it creates q_xcp.so and copies it >> to /usr/lib and sch_xcp.o which it copies to /lib/modules/... so then I >> "insmod sch_xcp" and i see in dmesg: "XCP qdisc module loaded." >> >> I then try: "tc qdisc add dev eth0 root xcp capacity 10Mbit limit 500" >> and get: "Unknown qdisc "xcp", hence option "capacity" is unparsable" >> >> So then I read the INSTALL further to find some sort of solution and it >> mentions: This again assumes "tc" version is 2.4.7. If your "tc" is a >> different version, download the iproute2 source code, and edit Makefile >> to point "TC_INCLUDE" to "-I..../iproute2/include -I..../iproute2/tc" >> >> So, i did that, and i recompiled the q_xcp.so: lanthanum-ini src-1.0.1 # >> make q_xcp.so cc -O2 -fPIC >> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/inc >> lude/ >> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/tc_ >> include -o q_xcp.o -c q_xcp.c ld -shared -o q_xcp.so q_xcp.o rm -f >> q_xcp.o >> >> But i still get the same error.... so then my very final last effort >> was to move q_xcp.c to my iproute2 source code tc/ directory and added >> this to the makefile: TCMODULES += q_xcp.o >> >> Then I compiled tc, and i check tc to see if the xcp qdisc functions >> were loaded: lanthanum-ini tc # nm tc | grep xcp 080531ec t xcp_parse_opt >> 080533e0 t xcp_print_opt 08053426 t xcp_print_xstats 08070cc0 D xcp_util >> >> >> And finally: lanthanum-ini tc # ./tc qdisc add dev ath0 root xcp >> capacity 54Mbit limit 500 Unknown qdisc "xcp", hence option "capacity" >> is unparsable >> >> >> I have no clue :( I figured that putting the .so into /usr/lib would >> have been enough. Sorry for the long e-mail, I hope someone can help, >> and thank you for your time even if you don''t know the solution but >> read this :) >> >> - George >> > > The .so needs to go in /usr/lib/tc (assuming you are running relatively > recent version of iproute2 tools). > > Read source to tc.c where it calls dlopen. > >Still didn''t seem to solve the problem :\ In my tc.c i have: snprintf(buf, sizeof(buf), "/usr/lib/tc/q_%s.so", str); Also: lanthanum-ini tc # ls /usr/lib/tc experimental.dist normal.dist pareto.dist paretonormal.dist q_netem.so q_xcp.so And finally: lanthanum-ini tc # tc qdisc add dev ath0 root xcp capacity 54Mbit limit 500 Unknown qdisc "xcp", hence option "capacity" is unparsable Maybe i should add debugging in tc.c and see if it sees the .so and fails to load it or something. Any other suggestions? Thanks for all the responses, George
George P Nychis
2006-Apr-11 19:53 UTC
Re: Re: created new q_disc, inserted module, tc tells me unknown qdisc
I am getting closer... I added debugging, and noticed that it looks for: snprintf(buf, sizeof(buf), "%s_qdisc_util", str); However in q_xcp.c it had: struct qdisc_util xcp_util = { so I changed that to xcp_qdisc_util, and now i run tc: lanthanum-ini tc # tc qdisc add dev ath0 root xcp capacity 54Mbit limit 100 Segmentation fault This happens on this line: q = dlsym(dlh, buf); Since this is very hard for people to help me without the source code, i did ask the author if it has been release publically and am waiting for a response. In the meantime, it seems as though maybe instead of trying to get this to work with a newer version of tc, i should install an old version of tc that the module was original made for. Though if anyone else has ideas let me know. Thanks for all the help - George>> On Mon, 10 Apr 2006 21:41:39 -0400 (EDT) "George P Nychis" >> <gnychis@cmu.edu> wrote: >> >>> Hi, >>> >>> I am trying to install a proprietary qdisc made for research, it is >>> not publically released yet, however its been used several times so i >>> know it works. >>> >>> The files included are: q_xcp.c: static int xcp_parse_opt() static >>> int xcp_print_opt() static int xcp_print_xstats() struct qdisc_util >>> xcp_util = { "NULL", "xcp" ..... }; >>> >>> sch_xcp.c: static int xcp_enqueue() static int xcp_requeue() static >>> struct sk_buff * xcp_dequeue() .... .... struct Qdisc_ops >>> xcp_qdisc_ops ={ NULL,NULL,"xcp",.... }; >>> >>> printk(KERN_INFO "XCP qdisc module loaded.\n"); return >>> register_qdisc(&xcp_qdisc_ops); >>> >>> >>> So, i make everything successfully, it creates q_xcp.so and copies it >>> to /usr/lib and sch_xcp.o which it copies to /lib/modules/... so >>> then I "insmod sch_xcp" and i see in dmesg: "XCP qdisc module loaded." >>> >>> >>> I then try: "tc qdisc add dev eth0 root xcp capacity 10Mbit limit >>> 500" and get: "Unknown qdisc "xcp", hence option "capacity" is >>> unparsable" >>> >>> So then I read the INSTALL further to find some sort of solution and >>> it mentions: This again assumes "tc" version is 2.4.7. If your "tc" >>> is a different version, download the iproute2 source code, and edit >>> Makefile to point "TC_INCLUDE" to "-I..../iproute2/include >>> -I..../iproute2/tc" >>> >>> So, i did that, and i recompiled the q_xcp.so: lanthanum-ini >>> src-1.0.1 # make q_xcp.so cc -O2 -fPIC >>> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/i >>> nc lude/ >>> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/t >>> c_ include -o q_xcp.o -c q_xcp.c ld -shared -o q_xcp.so q_xcp.o rm -f >>> q_xcp.o >>> >>> But i still get the same error.... so then my very final last effort >>> was to move q_xcp.c to my iproute2 source code tc/ directory and >>> added this to the makefile: TCMODULES += q_xcp.o >>> >>> Then I compiled tc, and i check tc to see if the xcp qdisc functions >>> were loaded: lanthanum-ini tc # nm tc | grep xcp 080531ec t >>> xcp_parse_opt 080533e0 t xcp_print_opt 08053426 t xcp_print_xstats >>> 08070cc0 D xcp_util >>> >>> >>> And finally: lanthanum-ini tc # ./tc qdisc add dev ath0 root xcp >>> capacity 54Mbit limit 500 Unknown qdisc "xcp", hence option >>> "capacity" is unparsable >>> >>> >>> I have no clue :( I figured that putting the .so into /usr/lib would >>> have been enough. Sorry for the long e-mail, I hope someone can >>> help, and thank you for your time even if you don''t know the solution >>> but read this :) >>> >>> - George >>> >> >> The .so needs to go in /usr/lib/tc (assuming you are running relatively >> recent version of iproute2 tools). >> >> Read source to tc.c where it calls dlopen. >> >> > > Still didn''t seem to solve the problem :\ > > In my tc.c i have: snprintf(buf, sizeof(buf), "/usr/lib/tc/q_%s.so", str); > > > Also: lanthanum-ini tc # ls /usr/lib/tc experimental.dist normal.dist > pareto.dist paretonormal.dist q_netem.so q_xcp.so > > And finally: lanthanum-ini tc # tc qdisc add dev ath0 root xcp capacity > 54Mbit limit 500 Unknown qdisc "xcp", hence option "capacity" is > unparsable > > Maybe i should add debugging in tc.c and see if it sees the .so and fails > to load it or something. > > Any other suggestions? > > Thanks for all the responses, George > > _______________________________________________ LARTC mailing list > LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc > >--
Tim Shepard
2006-Apr-11 20:29 UTC
Re: Re: created new q_disc, inserted module, tc tells me unknown qdisc
> Maybe i should add debugging in tc.c and see if it sees the .so and fails to load it or something.Yes. I would do that next. Compile tc with -g and then run it under gdb and step through that part to see what happens. -Tim Shepard shep@alum.mit.edu
gypsy
2006-Apr-12 01:10 UTC
Re: created new q_disc, inserted module, tc tells me unknown qdisc
George P Nychis wrote:> > Hi, > > I am trying to install a proprietary qdisc made for research, it is not publically released yet, however its been used several times so i know it works. > > The files included are: > q_xcp.c: > static int xcp_parse_opt() > static int xcp_print_opt() > static int xcp_print_xstats() > struct qdisc_util xcp_util = { "NULL", "xcp" ..... }; > > sch_xcp.c: > static int xcp_enqueue() > static int xcp_requeue() > static struct sk_buff * xcp_dequeue() > .... > .... > struct Qdisc_ops xcp_qdisc_ops ={ NULL,NULL,"xcp",.... }; > > printk(KERN_INFO "XCP qdisc module loaded.\n"); > return register_qdisc(&xcp_qdisc_ops); > > So, i make everything successfully, it creates q_xcp.so and copies it to /usr/lib and sch_xcp.o which it copies to /lib/modules/... so then I "insmod sch_xcp" and i see in dmesg: > "XCP qdisc module loaded." > > I then try: > "tc qdisc add dev eth0 root xcp capacity 10Mbit limit 500" and get: > "Unknown qdisc "xcp", hence option "capacity" is unparsable" > > So then I read the INSTALL further to find some sort of solution and it mentions: > This again assumes "tc" version is 2.4.7. If your "tc" is a different > version, download the iproute2 source code, and edit Makefile to > point "TC_INCLUDE" to "-I..../iproute2/include -I..../iproute2/tc" > > So, i did that, and i recompiled the q_xcp.so: > lanthanum-ini src-1.0.1 # make q_xcp.so > cc -O2 -fPIC -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/include/ -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/tc_include -o q_xcp.o -c q_xcp.c > ld -shared -o q_xcp.so q_xcp.o > rm -f q_xcp.o > > But i still get the same error.... so then my very final last effort was to move q_xcp.c to my iproute2 source code tc/ directory and added this to the makefile: > TCMODULES += q_xcp.o > > Then I compiled tc, and i check tc to see if the xcp qdisc functions were loaded: > lanthanum-ini tc # nm tc | grep xcp > 080531ec t xcp_parse_opt > 080533e0 t xcp_print_opt > 08053426 t xcp_print_xstats > 08070cc0 D xcp_util > > And finally: > lanthanum-ini tc # ./tc qdisc add dev ath0 root xcp capacity 54Mbit limit 500 > Unknown qdisc "xcp", hence option "capacity" is unparsable > > I have no clue :( I figured that putting the .so into /usr/lib would have been enough. Sorry for the long e-mail, I hope someone can help, and thank you for your time even if you don''t know the solution but read this :) > > - GeorgeGeorge, Please show us iproute/include/linux/pkt_sched.h There shouldn''t be anything there the author wishes to keep private. -- gypsy
George P Nychis
2006-Apr-12 01:41 UTC
Re: created new q_disc, inserted module, tc tells me unknown qdisc
> George P Nychis wrote: >> >> Hi, >> >> I am trying to install a proprietary qdisc made for research, it is not >> publically released yet, however its been used several times so i know >> it works. >> >> The files included are: q_xcp.c: static int xcp_parse_opt() static int >> xcp_print_opt() static int xcp_print_xstats() struct qdisc_util xcp_util >> = { "NULL", "xcp" ..... }; >> >> sch_xcp.c: static int xcp_enqueue() static int xcp_requeue() static struct >> sk_buff * xcp_dequeue() .... .... struct Qdisc_ops xcp_qdisc_ops ={ >> NULL,NULL,"xcp",.... }; >> >> printk(KERN_INFO "XCP qdisc module loaded.\n"); return >> register_qdisc(&xcp_qdisc_ops); >> >> So, i make everything successfully, it creates q_xcp.so and copies it >> to /usr/lib and sch_xcp.o which it copies to /lib/modules/... so then I >> "insmod sch_xcp" and i see in dmesg: "XCP qdisc module loaded." >> >> I then try: "tc qdisc add dev eth0 root xcp capacity 10Mbit limit 500" >> and get: "Unknown qdisc "xcp", hence option "capacity" is unparsable" >> >> So then I read the INSTALL further to find some sort of solution and it >> mentions: This again assumes "tc" version is 2.4.7. If your "tc" is a >> different version, download the iproute2 source code, and edit Makefile >> to point "TC_INCLUDE" to "-I..../iproute2/include -I..../iproute2/tc" >> >> So, i did that, and i recompiled the q_xcp.so: lanthanum-ini src-1.0.1 # >> make q_xcp.so cc -O2 -fPIC >> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/inc >> lude/ >> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/tc_ >> include -o q_xcp.o -c q_xcp.c ld -shared -o q_xcp.so q_xcp.o rm -f >> q_xcp.o >> >> But i still get the same error.... so then my very final last effort >> was to move q_xcp.c to my iproute2 source code tc/ directory and added >> this to the makefile: TCMODULES += q_xcp.o >> >> Then I compiled tc, and i check tc to see if the xcp qdisc functions >> were loaded: lanthanum-ini tc # nm tc | grep xcp 080531ec t xcp_parse_opt >> 080533e0 t xcp_print_opt 08053426 t xcp_print_xstats 08070cc0 D xcp_util >> >> >> And finally: lanthanum-ini tc # ./tc qdisc add dev ath0 root xcp >> capacity 54Mbit limit 500 Unknown qdisc "xcp", hence option "capacity" >> is unparsable >> >> I have no clue :( I figured that putting the .so into /usr/lib would >> have been enough. Sorry for the long e-mail, I hope someone can help, >> and thank you for your time even if you don''t know the solution but >> read this :) >> >> - George > > George, > > Please show us iproute/include/linux/pkt_sched.h > > There shouldn''t be anything there the author wishes to keep private. -- > gypsy > >They did not include the iproute source code that they used... they only included the q_xcp.c to create the q_xcp.so ... therefore my pkt_sched.h i am using is from this build: iproute2-2.6.11.20050310-r1 I can certainly post it if you need, just let me know
gypsy
2006-Apr-12 15:02 UTC
Re: created new q_disc, inserted module, tc tells me unknown qdisc
George P Nychis wrote:> > > George P Nychis wrote: > >> > >> Hi, > >> > >> I am trying to install a proprietary qdisc made for research, it is not > >> publically released yet, however its been used several times so i know > >> it works. > >> > >> The files included are: q_xcp.c: static int xcp_parse_opt() static int > >> xcp_print_opt() static int xcp_print_xstats() struct qdisc_util xcp_util > >> = { "NULL", "xcp" ..... }; > >> > >> sch_xcp.c: static int xcp_enqueue() static int xcp_requeue() static struct > >> sk_buff * xcp_dequeue() .... .... struct Qdisc_ops xcp_qdisc_ops ={ > >> NULL,NULL,"xcp",.... }; > >> > >> printk(KERN_INFO "XCP qdisc module loaded.\n"); return > >> register_qdisc(&xcp_qdisc_ops); > >> > >> So, i make everything successfully, it creates q_xcp.so and copies it > >> to /usr/lib and sch_xcp.o which it copies to /lib/modules/... so then I > >> "insmod sch_xcp" and i see in dmesg: "XCP qdisc module loaded." > >> > >> I then try: "tc qdisc add dev eth0 root xcp capacity 10Mbit limit 500" > >> and get: "Unknown qdisc "xcp", hence option "capacity" is unparsable" > >> > >> So then I read the INSTALL further to find some sort of solution and it > >> mentions: This again assumes "tc" version is 2.4.7. If your "tc" is a > >> different version, download the iproute2 source code, and edit Makefile > >> to point "TC_INCLUDE" to "-I..../iproute2/include -I..../iproute2/tc" > >> > >> So, i did that, and i recompiled the q_xcp.so: lanthanum-ini src-1.0.1 # > >> make q_xcp.so cc -O2 -fPIC > >> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/inc > >> lude/ > >> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11/tc_ > >> include -o q_xcp.o -c q_xcp.c ld -shared -o q_xcp.so q_xcp.o rm -f > >> q_xcp.o > >> > >> But i still get the same error.... so then my very final last effort > >> was to move q_xcp.c to my iproute2 source code tc/ directory and added > >> this to the makefile: TCMODULES += q_xcp.o > >> > >> Then I compiled tc, and i check tc to see if the xcp qdisc functions > >> were loaded: lanthanum-ini tc # nm tc | grep xcp 080531ec t xcp_parse_opt > >> 080533e0 t xcp_print_opt 08053426 t xcp_print_xstats 08070cc0 D xcp_util > >> > >> > >> And finally: lanthanum-ini tc # ./tc qdisc add dev ath0 root xcp > >> capacity 54Mbit limit 500 Unknown qdisc "xcp", hence option "capacity" > >> is unparsable > >> > >> I have no clue :( I figured that putting the .so into /usr/lib would > >> have been enough. Sorry for the long e-mail, I hope someone can help, > >> and thank you for your time even if you don''t know the solution but > >> read this :) > >> > >> - George > > > > George, > > > > Please show us iproute/include/linux/pkt_sched.h > > > > There shouldn''t be anything there the author wishes to keep private. -- > > gypsy > > > > > > They did not include the iproute source code that they used... they only included the q_xcp.c to create the q_xcp.so ... therefore my pkt_sched.h i am using is from this build: iproute2-2.6.11.20050310-r1 > > I can certainly post it if you need, just let me knowGeorge, Then you probably need to revert to an iproute2 source that included xcp. In pkt_sched.h you need a struct that defines the parameters xcp can accept: enum { TCA_XCP_PARM1, TCA_XCP_PARM2, TCA_XCP_PARM3, }; and in ~/tc/Makefile you need TCMODULES += q_xcp.o -- gypsy
George P Nychis
2006-Apr-13 05:42 UTC
Re: created new q_disc, inserted module, tc tells me unknown qdisc
> George P Nychis wrote: >> >>> George P Nychis wrote: >>>> >>>> Hi, >>>> >>>> I am trying to install a proprietary qdisc made for research, it is >>>> not publically released yet, however its been used several times so >>>> i know it works. >>>> >>>> The files included are: q_xcp.c: static int xcp_parse_opt() static >>>> int xcp_print_opt() static int xcp_print_xstats() struct qdisc_util >>>> xcp_util = { "NULL", "xcp" ..... }; >>>> >>>> sch_xcp.c: static int xcp_enqueue() static int xcp_requeue() static >>>> struct sk_buff * xcp_dequeue() .... .... struct Qdisc_ops >>>> xcp_qdisc_ops ={ NULL,NULL,"xcp",.... }; >>>> >>>> printk(KERN_INFO "XCP qdisc module loaded.\n"); return >>>> register_qdisc(&xcp_qdisc_ops); >>>> >>>> So, i make everything successfully, it creates q_xcp.so and copies >>>> it to /usr/lib and sch_xcp.o which it copies to /lib/modules/... so >>>> then I "insmod sch_xcp" and i see in dmesg: "XCP qdisc module >>>> loaded." >>>> >>>> I then try: "tc qdisc add dev eth0 root xcp capacity 10Mbit limit >>>> 500" and get: "Unknown qdisc "xcp", hence option "capacity" is >>>> unparsable" >>>> >>>> So then I read the INSTALL further to find some sort of solution >>>> and it mentions: This again assumes "tc" version is 2.4.7. If your >>>> "tc" is a different version, download the iproute2 source code, and >>>> edit Makefile to point "TC_INCLUDE" to "-I..../iproute2/include >>>> -I..../iproute2/tc" >>>> >>>> So, i did that, and i recompiled the q_xcp.so: lanthanum-ini >>>> src-1.0.1 # make q_xcp.so cc -O2 -fPIC >>>> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11 >>>> /inc lude/ >>>> -I/var/tmp/portage/iproute2-2.6.11.20050310-r1/work/iproute2-2.6.11 >>>> /tc_ include -o q_xcp.o -c q_xcp.c ld -shared -o q_xcp.so q_xcp.o rm >>>> -f q_xcp.o >>>> >>>> But i still get the same error.... so then my very final last >>>> effort was to move q_xcp.c to my iproute2 source code tc/ directory >>>> and added this to the makefile: TCMODULES += q_xcp.o >>>> >>>> Then I compiled tc, and i check tc to see if the xcp qdisc >>>> functions were loaded: lanthanum-ini tc # nm tc | grep xcp 080531ec >>>> t xcp_parse_opt 080533e0 t xcp_print_opt 08053426 t xcp_print_xstats >>>> 08070cc0 D xcp_util >>>> >>>> >>>> And finally: lanthanum-ini tc # ./tc qdisc add dev ath0 root xcp >>>> capacity 54Mbit limit 500 Unknown qdisc "xcp", hence option >>>> "capacity" is unparsable >>>> >>>> I have no clue :( I figured that putting the .so into /usr/lib >>>> would have been enough. Sorry for the long e-mail, I hope someone >>>> can help, and thank you for your time even if you don''t know the >>>> solution but read this :) >>>> >>>> - George >>> >>> George, >>> >>> Please show us iproute/include/linux/pkt_sched.h >>> >>> There shouldn''t be anything there the author wishes to keep private. >>> -- gypsy >>> >>> >> >> They did not include the iproute source code that they used... they >> only included the q_xcp.c to create the q_xcp.so ... therefore my >> pkt_sched.h i am using is from this build: iproute2-2.6.11.20050310-r1 >> >> I can certainly post it if you need, just let me know > > George, > > Then you probably need to revert to an iproute2 source that included xcp. > In pkt_sched.h you need a struct that defines the parameters xcp can > accept: > > enum { TCA_XCP_PARM1, TCA_XCP_PARM2, TCA_XCP_PARM3, }; > > and in ~/tc/Makefile you need TCMODULES += q_xcp.o -- gypsy > >I think what I''m most confused about this pkt_sched.h thing is that the code works with version 2.4.7 of iproute2 ... in 2.4.7 of iproute2 there is no pkt_sched.h anywhere to be found in the source code. However in the newest version of iproute2 which I am trying to get this functionality to work in, there is a pkt_sched.h My last observation, is that in q_xcp.h it includes pkt_sched_xcp.h which has: struct tc_xcp_qopt { __u32 first_param; __u32 second_param; }; So I am assuming i need to add something like the enum thing to pkt_sched.h in the new iproute2 source... however what are the proper names I need to use in the enum? I don''t expect you to know the names, however, what do i match them with? Thanks! George --