Modify

Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#7231 closed defect (worksforme)

QoS Scripts Produces RTNETLINK Errors; QoS Not Working

Reported by: ledwards@… Owned by: nbd
Priority: normal Milestone: Backfire 10.03.1
Component: packages Version: Backfire 10.03
Keywords: QoS RTNETLINK tc Cc:

Description

Running Backfire r21113. Using the default QoS configuration, starting QoS produces the following errors:

RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
RTNETLINK answers: Invalid argument
We have an error talking to the kernel

QoS doesn't appear to be working as expected. The WAN is not limited to the specified bandwidth.

See attached files.

Attachments (3)

qos_error (7.6 KB) - added by ledwards@… 8 years ago.
QoS Errors at Start-up
qos_config (3.1 KB) - added by ledwards@… 8 years ago.
QoS UCI Configuration
packages (4.0 KB) - added by ledwards@… 8 years ago.
installed packages (opkg list-installed)

Download all attachments as: .zip

Change History (18)

Changed 8 years ago by ledwards@…

QoS Errors at Start-up

Changed 8 years ago by ledwards@…

QoS UCI Configuration

Changed 8 years ago by ledwards@…

installed packages (opkg list-installed)

comment:1 Changed 8 years ago by thepeople

  • Owner changed from developers to nbd
  • Status changed from new to assigned

comment:2 Changed 8 years ago by anonymous

This issue is also in trunk on ixp4xx.

comment:3 Changed 8 years ago by ledwards@…

The following is Backfire r21346 on AR71XX:

root@OpenWrt:/usr/lib/qos# /usr/lib/qos/generate.sh all | sh -x
+ modprobe -r imq                                              
+ modprobe imq numdevs=1                                       
+ modprobe cls_fw                                              
+ modprobe sch_hfsc                                            
+ modprobe sch_sfq                                             
+ modprobe sch_red                                             
+ ifconfig eth1 up txqueuelen 5                                
+ tc qdisc del dev eth1 root                                   
+ tc qdisc add dev eth1 root handle 1: hfsc default 30         
RTNETLINK answers: No such file or directory                   
+ tc class add dev eth1 parent 1: classid 1:1 hfsc sc rate 110kbit ul rate 110kbit
RTNETLINK answers: No such file or directory                                      
+ tc class add dev eth1 parent 1:1 classid 1:10 hfsc rt m1 64kbit d 7102us m2 11kbit ls m1 64kbit d 7102us m2 61kbit ul rate 110kbit
RTNETLINK answers: No such file or directory                                                                                        
+ tc class add dev eth1 parent 1:1 classid 1:20 hfsc rt m1 58kbit d 17755us m2 55kbit ls m1 58kbit d 17755us m2 30kbit ul rate 110kbit
RTNETLINK answers: No such file or directory                                                                                          
+ tc class add dev eth1 parent 1:1 classid 1:30 hfsc ls m1 0kbit d 100000us m2 15kbit ul rate 110kbit                                 
RTNETLINK answers: No such file or directory                                                                                          
+ tc class add dev eth1 parent 1:1 classid 1:40 hfsc ls m1 0kbit d 200000us m2 3kbit ul rate 110kbit                                  
RTNETLINK answers: No such file or directory                                                                                          
+ tc qdisc add dev eth1 parent 1:10 handle 100: sfq perturb 2 limit 36000                                                             
RTNETLINK answers: No such file or directory                                                                                          
+ tc qdisc add dev eth1 parent 1:20 handle 200: sfq perturb 2 limit 36000                                                             
RTNETLINK answers: No such file or directory                                                                                          
+ tc qdisc add dev eth1 parent 1:30 handle 300: red min 3000 max 9000 burst 3 avpkt 1500 limit 36000 probability 0.12 ecn             
RTNETLINK answers: No such file or directory                                                                                          
+ tc qdisc add dev eth1 parent 1:40 handle 400: red min 3000 max 9000 burst 3 avpkt 1500 limit 36000 probability 0.12 ecn             
RTNETLINK answers: No such file or directory                                                                                          
+ tc filter add dev eth1 parent 1: prio 1 protocol ip handle 1 fw flowid 1:10                                                         
RTNETLINK answers: Invalid argument                                                                                                   
We have an error talking to the kernel                                                                                                
+ tc filter add dev eth1 parent 1: prio 2 protocol ip handle 2 fw flowid 1:20                                                         
RTNETLINK answers: Invalid argument                                                                                                   
We have an error talking to the kernel                                                                                                
+ tc filter add dev eth1 parent 1: prio 3 protocol ip handle 3 fw flowid 1:30                                                         
RTNETLINK answers: Invalid argument                                                                                                   
We have an error talking to the kernel                                                                                                
+ tc filter add dev eth1 parent 1: prio 4 protocol ip handle 4 fw flowid 1:40                                                         
RTNETLINK answers: Invalid argument                                                                                                   
We have an error talking to the kernel                                                                                                
+ ifconfig imq0 up txqueuelen 5                                                                                                       
+ tc qdisc del dev imq0 root                                                                                                          
+ tc qdisc add dev imq0 root handle 1: hfsc default 30                                                                                
RTNETLINK answers: No such file or directory                                                                                          
+ tc class add dev imq0 parent 1: classid 1:1 hfsc sc rate 923kbit ul rate 923kbit                                                    
RTNETLINK answers: No such file or directory                                                                                          
+ tc class add dev imq0 parent 1:1 classid 1:10 hfsc rt m1 209kbit d 2116us m2 92kbit ls m1 209kbit d 2116us m2 512kbit ul rate 923kbit
RTNETLINK answers: No such file or directory                                                                                           
+ tc class add dev imq0 parent 1:1 classid 1:20 hfsc rt m1 480kbit d 2116us m2 461kbit ls m1 480kbit d 2116us m2 256kbit ul rate 923kbit
RTNETLINK answers: No such file or directory                                                                                            
+ tc class add dev imq0 parent 1:1 classid 1:30 hfsc ls m1 0kbit d 100000us m2 128kbit ul rate 923kbit                                  
RTNETLINK answers: No such file or directory                                                                                            
+ tc class add dev imq0 parent 1:1 classid 1:40 hfsc ls m1 0kbit d 200000us m2 25kbit ul rate 923kbit                                   
RTNETLINK answers: No such file or directory                                                                                            
+ tc qdisc add dev imq0 parent 1:10 handle 100: sfq perturb 2 limit 70884                                                               
RTNETLINK answers: No such file or directory                                                                                            
+ tc qdisc add dev imq0 parent 1:20 handle 200: sfq perturb 2 limit 70884                                                               
RTNETLINK answers: No such file or directory                                                                                            
+ tc qdisc add dev imq0 parent 1:30 handle 300: red min 5907 max 17721 burst 6 avpkt 1500 limit 70884 probability 0.12 ecn              
RTNETLINK answers: No such file or directory                                                                                            
+ tc qdisc add dev imq0 parent 1:40 handle 400: red min 5907 max 17721 burst 6 avpkt 1500 limit 70884 probability 0.12 ecn              
RTNETLINK answers: No such file or directory                                                                                            
+ tc filter add dev imq0 parent 1: prio 1 protocol ip handle 1 fw flowid 1:10                                                           
RTNETLINK answers: Invalid argument                                                                                                     
We have an error talking to the kernel                                                                                                  
+ tc filter add dev imq0 parent 1: prio 2 protocol ip handle 2 fw flowid 1:20
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
+ tc filter add dev imq0 parent 1: prio 3 protocol ip handle 3 fw flowid 1:30
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
+ tc filter add dev imq0 parent 1: prio 4 protocol ip handle 4 fw flowid 1:40
RTNETLINK answers: Invalid argument
We have an error talking to the kernel
+ iptables -t mangle -F
+ iptables -t mangle -X
+ modprobe ipt_multiport
+ modprobe ipt_CONNMARK
+ modprobe ipt_layer7
+ modprobe xt_layer7
+ modprobe ipt_length
+ modprobe ipt_IMQ
+ iptables -t mangle -N Default
+ iptables -t mangle -N Default_ct
+ iptables -t mangle -A Default_ct -m mark --mark 0 -m layer7 --l7proto edonkey -j MARK --set-mark 4
+ iptables -t mangle -A Default_ct -m mark --mark 0 -m layer7 --l7proto bittorrent -j MARK --set-mark 4
+ iptables -t mangle -A Default_ct -m mark --mark 0 -m tcp -p tcp -m multiport --ports 22,53 -j MARK --set-mark 1
+ iptables -t mangle -A Default_ct -m mark --mark 0 -p udp -m udp -m multiport --ports 22,53 -j MARK --set-mark 1
+ iptables -t mangle -A Default_ct -m mark --mark 0 -p tcp -m tcp -m multiport --ports 20,21,25,80,110,443,993,995 -j MARK --set-mark 3
+ iptables -t mangle -A Default_ct -m mark --mark 0 -m tcp -p tcp -m multiport --ports 5190 -j MARK --set-mark 2
+ iptables -t mangle -A Default_ct -m mark --mark 0 -p udp -m udp -m multiport --ports 5190 -j MARK --set-mark 2
+ iptables -t mangle -A Default_ct -j CONNMARK --save-mark
+ iptables -t mangle -A Default -j CONNMARK --restore-mark
+ iptables -t mangle -A Default -m mark --mark 0 -j Default_ct
+ iptables -t mangle -A Default -m mark --mark 1 -m length --length 400: -j MARK --set-mark 0
+ iptables -t mangle -A Default -m mark --mark 2 -m length --length 800: -j MARK --set-mark 0
+ iptables -t mangle -A Default -m mark --mark 0 -p udp -m length --length :500 -j MARK --set-mark 2
+ iptables -t mangle -A Default -p icmp -j MARK --set-mark 1
+ iptables -t mangle -A Default -m mark --mark 0 -m tcp -p tcp --sport 1024:65535 --dport 1024:65535 -j MARK --set-mark 4
+ iptables -t mangle -A Default -m mark --mark 0 -p udp -m udp --sport 1024:65535 --dport 1024:65535 -j MARK --set-mark 4
+ iptables -t mangle -A Default -p tcp -m length --length :128 -m mark ! --mark 4 -m tcp --tcp-flags ALL SYN -j MARK --set-mark 1
+ iptables -t mangle -A Default -p tcp -m length --length :128 -m mark ! --mark 4 -m tcp --tcp-flags ALL ACK -j MARK --set-mark 1
+ iptables -t mangle -A OUTPUT -o eth1 -j Default
+ iptables -t mangle -A FORWARD -o eth1 -j Default
+ iptables -t mangle -A POSTROUTING -o eth1 -j Default
+ iptables -t mangle -A PREROUTING -i eth1 -j Default
+ iptables -t mangle -A PREROUTING -i eth1 -j IMQ --todev 0
root@OpenWrt:/usr/lib/qos#

comment:4 Changed 8 years ago by sergiori@…

I have experienced the same bug on a dir-825 using openwrt-ar71xx-dir-825-b1-jffs2-backup-loader.bin on backfire 10.03, but using different qos software this bug happens using wshaper, and other qos software such as S98astshape. I believe it is in tc which is part of iptools2, maybe it was compiled without the patches on http://luxik.cdi.cz/~devik/qos/htb/ file htb3.6-020525.tgz which is for the htb code used in tc. Maybe the patches are not needed, but maybe they are.

I believe this bug also exist for other routers using backfire 10.03 since it also happens on a wrt54gl version 1.1.

the bug can be checked by executing this line of code
tc qdisc add dev wlan0 root handle 1: htb default 20
where wlan0 is the wan interface.

when the bug exists you get
RTNETLINK answers: No such file or directory

comment:5 follow-up: Changed 8 years ago by anonymous

It seems to me that the kernel modules are missing.

When I tried

modprobe sch_hfsc

I get an error about missing modules.dep .

When I manually load all the required modules with insmod the errors disappear.

I'm using a self-compiled version from trunk.

comment:6 in reply to: ↑ 5 Changed 8 years ago by ledwards@…

Replying to anonymous:

It seems to me that the kernel modules are missing.

When I tried

modprobe sch_hfsc

I get an error about missing modules.dep .

When I manually load all the required modules with insmod the errors disappear.

I'm using a self-compiled version from trunk.

Thanks, that worked for me. Yes, it looks like the required modules are not loaded. QoS works as expected when I manually load the modules as follows:

insmod cls_fw                                              
insmod sch_hfsc                                            
insmod sch_sfq                                             
insmod sch_red 

So why aren't these modules loaded by the QoS init script when QoS is started? Could this have anything to do with the configuration settings for busybox?

Base system --> busybox --> Configuration --> Linux Module Utilities

I have 'modprobe' and 'depmod' included in my build (which aren't selected by default).

comment:7 Changed 8 years ago by ledwards@…

I've got it figured out and QoS is working fine now. I changed my busybox configuration to not install modprobe. Now when I start QoS, it uses insmod instead of modprobe which doesn't produce the errors and everything works.

root@OpenWrt:/# /usr/lib/qos/generate.sh all | sh -x
+ insmod cls_fw                                     
+ insmod sch_hfsc                                   
+ insmod sch_sfq                                    
+ insmod sch_red                                    
+ ifconfig eth1 up txqueuelen 5                     
+ tc qdisc del dev eth1 root                        
+ tc qdisc add dev eth1 root handle 1: hfsc default 30
+ tc class add dev eth1 parent 1: classid 1:1 hfsc sc rate 110kbit ul rate 110kbit

...

So apparently the QoS Scripts use modprobe if available, otherwise defaulting to insmod. The question here is why was my modprobe failing to load the modules? Do I need to manually run depmod to generate the modules.dep for modprobe to work?

I'm not sure what solution should be implemented for this (if any). It's either user error (i.e. I don't know how to use modprobe) or a modprobe bug or just misconfiguration for QoS. Either way, if you install modprobe, QoS won't work out of the box.

comment:8 follow-up: Changed 8 years ago by sergiori@…

The problem is not modprobe, I do not have modprobe installed, and insmod load the modules fine.
The problem seems to be on tc since me and others have had problem on the following line when running QoS.

tc qdisc add dev wlan0 root handle 1: htb default 20

This generates an error even if the modules are loaded.
What happens if you use the luci gui you will never see any errors and could think QoS is working, but when running some QoS scripts from the command line the error can be seen, when executing the above line should not return an error when tc is working fine.

comment:9 in reply to: ↑ 8 Changed 8 years ago by ledwards@…

Replying to sergiori@…:

The problem is not modprobe, I do not have modprobe installed, and insmod load the modules fine.
The problem seems to be on tc since me and others have had problem on the following line when running QoS.

tc qdisc add dev wlan0 root handle 1: htb default 20

This generates an error even if the modules are loaded.
What happens if you use the luci gui you will never see any errors and could think QoS is working, but when running some QoS scripts from the command line the error can be seen, when executing the above line should not return an error when tc is working fine.

I think we are experiencing different problems, as my problem was related to the required modules not being loaded. Now that the modules are being loaded properly, QoS works as expected. As to why the modules didn't load properly with modprobe installed, I don't know.

I executed your command as follows:
"tc qdisc add dev wlan0 root handle 1: htb default 20".
This did produce the RTNETLINK error, however I believe it is because I don't have the HTB module installed. Therefore, the error is expected and has the same result as when I didn't have the sch_hfsc, sch_sfq and sch_red modules loaded (because of my modprobe issue).

comment:10 Changed 8 years ago by nbd

  • Resolution set to invalid
  • Status changed from assigned to closed

comment:11 Changed 7 years ago by a6y@…

  • Resolution invalid deleted
  • Status changed from closed to reopened

I have same problem. When im trying

tc qdisc add dev eth0 root handle 1: htb default 12

i have an error

RTNETLINK answers: No such file or directory 


using this one

insmod cls_fw                                     
insmod sch_hfsc                                   
insmod sch_sfq                                    
insmod sch_red
insmod sch_htb
......

after that

tc qdisc add dev eth0 root handle 1: htb default 12

network is going down and device rebooting
Other diciplines gives the same result

tc qdisc add dev eth0 root handle 1: hfsc default 12
....

My system:
Linux OpenWrt 2.6.32.27 #2 Thu Apr 21 11:49:43 MSD 2011 mips GNU/Linux
Backfire (10.03.1-RC5, r26741)
Any ideas??

comment:12 Changed 7 years ago by jow

  • Resolution set to worksforme
  • Status changed from reopened to closed

If your network goes down after adding the above rules then you probably have ip_queue loaded, or incompatible kmods. I cannot observe such errors on RC5.

comment:13 Changed 6 years ago by andz2k@…

  • Resolution worksforme deleted
  • Status changed from closed to reopened

This is still happening to rc5 with my ar2315 board. Even tc qdisc del dev eth0 root sends out this error

comment:14 Changed 6 years ago by jow

  • Resolution set to worksforme
  • Status changed from reopened to closed

It works for me with rc5. The error on "tc qdisc del dev eth0 root" is normal as you need to specify what to delete:

root@OpenWrt:/# tc qdisc add dev eth0 root handle 1: htb default 12
RTNETLINK answers: No such file or directory
root@OpenWrt:/# insmod sch_htb
root@OpenWrt:/# tc qdisc add dev eth0 root handle 1: htb default 12
root@OpenWrt:/# tc qdisc del dev eth0
RTNETLINK answers: No such file or directory
root@OpenWrt:/# tc qdisc del dev eth0 root handle 1:
root@OpenWrt:/# tc qdisc del dev eth0 root handle 1:
RTNETLINK answers: Invalid argument
root@OpenWrt:/#  

comment:15 Changed 6 years ago by anonymous

I know this is a bit old but I came accross this cause I had the same errors with modprobe not working with qos so at first I tried insmod as one of the posters suggested but then I relised all I had to do was run depmod to create a modules.dep file and now moprobe works fine with anything I am using a self build recent trunk build 30010 I think

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.