PDA

View Full Version : Apparent ifconfig error on networked HDVR2


gpontis
05-02-2005, 06:39 PM
System: HDVR2 with USB200M
USB drivers: usbobj2.4.27-20050104.tar.bz2
Kernel: 2.4.18
App: 4.0.1b-02-2-240

It appears that something is off by 1, causing the ifconfig output to be incorrect. The TX packets output shows no packets being transfered but millions of errors:

bash-2.02# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Bcast:0.0.0.0 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:160 dropped:2 overruns:0 carrier:0 coll:0

eth0 Link encap:Ethernet HWaddr 00:10:60:24:5C:7E
inet addr:192.168.1.122 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:659843 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:1380514338 dropped:987937 overruns:0 carrier:0 coll:0

--------------------
I could believe 1.38 billion packets and 987937 errors, but not 0 TX packets and a billion errors. After a netperf test, the number of packets has stayed at 0 but the errors went up. That is bogus since the netperf test showed reasonable throughput :
--------------------

bash-2.02# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Bcast:0.0.0.0 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:160 dropped:2 overruns:0 carrier:0 coll:0

eth0 Link encap:Ethernet HWaddr 00:10:60:24:5C:7E
inet addr:192.168.1.122 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:677754 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:1449531840 dropped:1035798 overruns:0 carrier:0 coll:0

------------------------------------------------------------
Netprf results, PC -> HDVR2

/tmp >> netperf -t TCP_STREAM -H 192.168.1.122 -l 60
TCP STREAM TEST to 192.168.1.122
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec

87380 16384 16384 60.01 13.61
------------------------------------------------------------
Netperf results, HDVR2 -> PC

bash-2.02# netperf -t TCP_STREAM -H 192.168.1.2 -l 60
TCP STREAM TEST to 192.168.1.2
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec

16384 16384 16384 60.16 8.76

Jamie
05-02-2005, 06:59 PM
It appears that something is off by 1, causing the ifconfig output to be incorrect. The TX packets output shows no packets being transfered but millions of errors:This is a well know issue with the ifconfig shipped by tivo. Use the ifconfig that came in the usbobj2.4.27-20050104.tar.bz2 package and you should be good.

Incidently, your netperf performance doesn't look very good for 100Mb ethernet with usb2. I'd expect to see ~30Mbps.

gpontis
05-02-2005, 07:45 PM
Sorry I didn't find that with a quick search on google. I like the output of the replacement ifconfig much better:

bash-2.02# ifconfig
eth0 Link encap:Ethernet HWaddr 00:10:60:24:5C:7E
inet addr:192.168.1.122 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:682022 errors:0 dropped:0 overruns:0 frame:0
TX packets:1038614 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:437441004 (417.1 Mb) TX bytes:1450007754 (1382.8 Mb)


With regard to the low throughput, any suggestion where to look ? The performance does seem pathetic and not much better than I got with a Belkin USB 1.1 adapter. The USB200M is connected directly to a gigabit switch and I tested against a capable Unix machine. On a different HDVR2 with different USB200M I saw a number only slightly higher, 16Mb/sec for PC to HDVR2.

From test.conf:

/sbin/insmod /lib/modules/usbcore.o log2_irq_thresh=4
/sbin/insmod /lib/modules/usbnet.o
/sbin/insmod /lib/modules/usb-ohci.o

Jamie
05-02-2005, 07:49 PM
With regard to the low throughput, any suggestion where to look ? The performance does seem pathetic and not much better than I got with a Belkin USB 1.1 adapter. The USB200M is connected directly to a gigabit switch and I tested against a capable Unix machine. On a different HDVR2 with different USB200M I saw a number only slightly higher, 16Mb/sec for PC to HDVR2.
Is there any load on the tivo? Run top on the tivo during the netperf transfer and look at what seems to be getting all the cpu. Generally these network bandwidth tests will be cpu bound on the tivo, and if anything else is getting a big chunk of cpu time, that's likely the problem. The 4.x/5.x vwait issue is one possibility, if you haven't patched for it and are running tivosh programs that use vwait (mfs_ftp,TWP,...).

gpontis
05-02-2005, 10:37 PM
I had previously used NutKase's 7.0 patch which didn't have the vwait patch. Now I backed that out and used his 7.1 version. It gets netperf CPU much higher but throughput is not that much improved.

---
Top output, NutKase superpatch0.7.0:
---
Mem: 42348K used, 1232K free, 0K shrd, 1188K buff, 29228K cached
Load average: 3.93, 2.76, 2.43 (State: S=sleeping R=running, W=waiting)

PID USER STATUS RSS PPID %CPU %MEM COMMAND
602 0 R 3716 1 22.6 8.5 tivosh
236 0 R 2064 1 22.5 4.7 mfs_ftp.tcl
168 0 R 4840 164 22.0 11.1 ApgManager
878 0 R 588 803 21.0 1.3 netperf
877 0 R 864 876 6.5 1.9 top
...

---
Top output, NutKase superpatch 0.7.1:
---
Mem: 42032K used, 1548K free, 0K shrd, 948K buff, 25500K cached
Load average: 1.60, 1.60, 0.95 (State: S=sleeping R=running, W=waiting)

PID USER STATUS RSS PPID %CPU %MEM COMMAND
248 0 R 588 243 52.1 1.3 netperf
168 0 S 6580 164 18.7 15.0 ApgManager
169 0 S 6580 164 12.9 15.0 ApgManager
245 0 R 864 244 9.2 1.9 top
182 0 S 1312 47 1.3 3.0 dssapp
...

---
Netperf (hdvr2->pc) results with NutKase 0.7.1:
---
bash-2.02# netperf -t TCP_STREAM -H 192.168.1.2 -l 60
TCP STREAM TEST to 192.168.1.2
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec

16384 16384 16384 60.01 14.44

Conclusion: 8.76 to 14.44 is a nice improvement. In the other direction it is only up from 13.6 to about 16.2. But these numbers are still far short of the 30Mbps rate. Did I get the wrong patch or miss something else ?

Jamie
05-02-2005, 10:57 PM
Did I get the wrong patch or miss something else ?netperf is still only using half the cpu. In my experience, the tivo networking is cpu limited, and you'll only see full speed if netperf is able to get 100% of the cpu. The AgpManagers are doing something there -- maybe recording to the live buffer? Tuning both tuners to a channel you don't receive and/or pulling the access card may help reduce cpu load.

The other trick is to run a custom kernel with CONFIG_NET_FILTER turned off. That disables the iptables firewalling code in the kernel which reduces the work the cpu has to do on each packet. That can gain an extra 25-30%. I know there is a custom 2.4.18 kernel I posted in the S2_unscramble thread. The trick here is that you need to chainload/monte to a custom kernel. You might feel that is more work than it's worth for 25-30%.

You could also try the usbnet/usbcore posted at the end of the usb2 2.4.27 backport thread. That's what I am using.

bgreen
05-03-2005, 12:16 AM
The other trick is to run a custom kernel with CONFIG_NET_FILTER turned off. That disables the iptables firewalling code in the kernel which reduces the work the cpu has to do on each packet. That can gain an extra 25-30%. I know there is a custom 2.4.18 kernel I posted in the S2_unscramble thread. The trick here is that you need to chainload/monte to a custom kernel. You might feel that is more work than it's worth for 25-30%.

Jamie, you're at 999 posts so I want to give you an opportunity to round off that number with my question. :) I would like to do preceisely what you've mentioned above. First, I'm running 7.1a software with a killhdinitrd'd 3.1.5 kernel which seems slow. (I used to get 3+MB/sec TSERVER downloads with Sleeper/4.01b. Now I get about 2.6MB/sec with killhdinitrd/7.1a.) I'd like to boot the killhdinitrd'd 3.1.1c and then monte in to another 2.4.20 kernel, the most stable config as I understand. Are you aware of a kernel posted here that has config_netfilter disabled but is LBA48 enabled and compatible with 7.1a? I've seen the 2.4.18 kernel you mentioned but I don't think that works with 7.1a, let alone has LBA48 support. I've thought about firing up a Linux station and getting a cross compiler up and running but then it seems like more work than worth 25-30%.

Second, have you done this yourself and did you think the 25-30% was worth it because that's all I'm looking for myself.

gpontis
05-03-2005, 12:21 AM
I installed the usbdiff from the end of that thread and it makes another improvement. Now I am seeing about 20mbps for hdvr2->pc at 85-90% CPU, and 25mbps in the other direction at about 30% cpu. All in all these changes add up to a big improvement. Thanks so much for the pointers and all your contributions to make USB networking really go.

Jamie
05-03-2005, 12:42 AM
...Are you aware of a kernel posted here that has config_netfilter disabled but is LBA48 enabled and compatible with 7.1a?

Second, have you done this yourself and did you think the 25-30% was worth it because that's all I'm looking for myself.The kernel in AlphaWolf's 62init package here (http://www.dealdatabase.com/forum/showthread.php?p=216711#post216711) is a kernel I build from the 7.1 sources with CONFIG_NET_FILTER turned off. That's the one I use.

Yeah, I think it is worth it. Some people like to keep it simple and avoid chainloading unless it is really needed, but I'm not in that camp.