linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: sis190
@ 2005-06-14 14:14 Pascal CHAPPERON
  2005-06-14 20:04 ` sis190 Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-06-14 14:14 UTC (permalink / raw)
  To: Francois Romieu; +Cc: Andrew Hutchings, linux-kernel, vinay kumar, jgarzik

> Can you give a try at:
> http://www.fr.zoreil.com/people/francois/misc/20050613-2.6.12-rc-sis190-test.patch

> dmesg + ifconfig + tcpdump (please add a -e option) will be welcome as usual.

> If the driver starts to behave in an usually better way, please issue
> differently sized ping packets to cover the whole allowed range.

> --
> Ueimor

I tried it : 
- false mode detection
- as you expected, ping -s 157 was OK, ping -s 158 failed.

Nice, it begins to work!

BTW, i made a small typo in my diff yesterday :
line 833 : { LPA_100HALF,  0x0901, "100 Mbps Half Duplex" },
must be
line 833 : { LPA_100HALF,  0x0801, "100 Mbps Half Duplex" },
to match the old driver.

Results =>
# cat /var/log/messages
[...]
Jun 14 15:24:02 local kernel: sis190 Gigabit Ethernet driver 1.2 loaded
Jun 14 15:24:02 local kernel: ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
Jun 14 15:24:02 local kernel: 0000:00:04.0: sis190 at ffffc20000004c00 (IRQ: 11), 00:11:2f:e9:42:70
Jun 14 15:24:02 local kernel: eth0: Enabling Auto-negotiation.
Jun 14 15:24:02 local kernel: eth0: status = 63000000
Jun 14 15:24:02 local kernel: eth0: status = 20000000
Jun 14 15:24:03 local last message repeated 116 times
Jun 14 15:24:03 local kernel: eth0: status = 22000000
Jun 14 15:24:03 local kernel: eth0: status = 20000000
Jun 14 15:24:04 local last message repeated 44 times
Jun 14 15:24:04 local network: Bringing up interface eth0:  succeeded
Jun 14 15:24:04 local kernel: eth0: status = 20000000
Jun 14 15:24:12 local last message repeated 604 times
Jun 14 15:24:12 local kernel: eth0: mii 0x1f = 0000.
Jun 14 15:24:12 local kernel: eth0: mii lpa = 45e1.
Jun 14 15:24:12 local kernel: eth0: Link on 1000 Mbps Full Duplex mode.
Jun 14 15:24:12 local kernel: eth0: status = 20000000
Jun 14 15:24:43 local last message repeated 2360 times
Jun 14 15:25:13 local last message repeated 2285 times
Jun 14 15:25:13 local kernel: eth0: Promiscuous mode enabled.
[...]
Jun 14 15:26:00 local kernel: eth0: Rx status = 400c0040
Jun 14 15:26:00 local kernel: eth0: Rx PSize = 01010040
Jun 14 15:26:00 local kernel: sk_buff[0]->tail = ffff810007acb812
Jun 14 15:26:00 local kernel: eth0: Rx status = c0000000
Jun 14 15:26:00 local kernel: eth0: status = 0000000c
Jun 14 15:26:00 local kernel: eth0: status = 20000040
Jun 14 15:26:00 local kernel: eth0: Rx status = 640c0040
Jun 14 15:26:00 local kernel: eth0: Rx PSize = 01010066
Jun 14 15:26:00 local kernel: sk_buff[0]->tail = ffff810006a3e012
Jun 14 15:26:00 local kernel: eth0: Rx status = c0000000
Jun 14 15:26:00 local kernel: eth0: status = 20000000
Jun 14 15:26:01 local last message repeated 75 times
Jun 14 15:26:01 local kernel: eth0: status = 2000000c
Jun 14 15:26:01 local kernel: eth0: status = 20000040
Jun 14 15:26:01 local kernel: eth0: Rx status = 640c0040
Jun 14 15:26:01 local kernel: eth0: Rx PSize = 01010066
[...]
Jun 14 15:26:01 local kernel: eth0: Rx status = 640c0040
Jun 14 15:26:01 local kernel: eth0: Rx PSize = 01010066
Jun 14 15:26:01 local kernel: sk_buff[0]->tail = ffff810006a3e812
Jun 14 15:26:01 local kernel: eth0: Rx status = c0000000
Jun 14 15:26:01 local kernel: eth0: status = 20000000
Jun 14 15:26:05 local last message repeated 319 times
Jun 14 15:26:05 local kernel: eth0: status = 20000040
Jun 14 15:26:05 local kernel: eth0: Rx status = 400c0040
Jun 14 15:26:05 local kernel: eth0: Rx PSize = 01010040
Jun 14 15:26:05 local kernel: sk_buff[0]->tail = ffff810007205012
Jun 14 15:26:05 local kernel: eth0: Rx status = c0000000
[...]

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet addr:10.169.21.20  Bcast:10.169.23.255  Mask:255.255.252.0
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:512 (512.0 b)  TX bytes:476 (476.0 b)
          Interrupt:11 Base address:0xdead

# ping -c 2 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 56(84) bytes of data.
64 bytes from 10.169.21.1: icmp_seq=0 ttl=64 time=1.55 ms
64 bytes from 10.169.21.1: icmp_seq=1 ttl=64 time=0.416 ms

--- 10.169.21.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms

=> tcpdump -enx
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
15:34:22.083935 00:11:2f:e9:42:70 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
15:34:22.084201 00:30:4f:06:48:6e > 00:11:2f:e9:42:70, ethertype ARP (0x0806), length 60: arp reply 10.169.21.1 is-at 00:30:4f:06:48:6e
        0x0000:  0001 0800 0604 0002 0030 4f06 486e 0aa9  .........0O.Hn..
        0x0010:  1501 0011 2fe9 4270 0aa9 1514 0000 0000  ..../.Bp........
        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............
15:34:22.084216 00:11:2f:e9:42:70 > 00:30:4f:06:48:6e, ethertype IPv4 (0x0800), length 98: IP 10.169.21.20 > 10.169.21.1: icmp 64: echo request seq 0
        0x0000:  4500 0054 0000 4000 4001 fb42 0aa9 1514  E..T..@.@..B....
        0x0010:  0aa9 1501 0800 7dab 1a1b 0000 dedc ae42  ......}........B
        0x0020:  0000 0000 1347 0100 0000 0000 1011 1213  .....G..........
        0x0030:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
        0x0040:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
        0x0050:  3435                                     45
15:34:22.084604 00:30:4f:06:48:6e > 00:11:2f:e9:42:70, ethertype IPv4 (0x0800), length 98: IP 10.169.21.1 > 10.169.21.20: icmp 64: echo reply seq 0
        0x0000:  4500 0054 c523 0000 4001 761f 0aa9 1501  E..T.#..@.v.....
        0x0010:  0aa9 1514 0000 85ab 1a1b 0000 dedc ae42  ...............B
        0x0020:  0000 0000 1347 0100 0000 0000 1011 1213  .....G..........
        0x0030:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
        0x0040:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
        0x0050:  3435                                     45
15:34:23.083813 00:11:2f:e9:42:70 > 00:30:4f:06:48:6e, ethertype IPv4 (0x0800), length 98: IP 10.169.21.20 > 10.169.21.1: icmp 64: echo request seq 1
        0x0000:  4500 0054 0001 4000 4001 fb41 0aa9 1514  E..T..@.@..A....
        0x0010:  0aa9 1501 0800 4baa 1a1b 0001 dfdc ae42  ......K........B
        0x0020:  0000 0000 4447 0100 0000 0000 1011 1213  ....DG..........
        0x0030:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
        0x0040:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
        0x0050:  3435                                     45
15:34:23.084199 00:30:4f:06:48:6e > 00:11:2f:e9:42:70, ethertype IPv4 (0x0800), length 98: IP 10.169.21.1 > 10.169.21.20: icmp 64: echo reply seq 1
        0x0000:  4500 0054 c524 0000 4001 761e 0aa9 1501  E..T.$..@.v.....
        0x0010:  0aa9 1514 0000 53aa 1a1b 0001 dfdc ae42  ......S........B
        0x0020:  0000 0000 4447 0100 0000 0000 1011 1213  ....DG..........
        0x0030:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
        0x0040:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
        0x0050:  3435                                     45
15:34:27.084058 00:30:4f:06:48:6e > 00:11:2f:e9:42:70, ethertype ARP (0x0806), length 60: arp who-has 10.169.21.20 tell 10.169.21.1
        0x0000:  0001 0800 0604 0001 0030 4f06 486e 0aa9  .........0O.Hn..
        0x0010:  1501 0000 0000 0000 0aa9 1514 0000 0000  ................
        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............
15:34:27.084078 00:11:2f:e9:42:70 > 00:30:4f:06:48:6e, ethertype ARP (0x0806), length 42: arp reply 10.169.21.20 is-at 00:11:2f:e9:42:70
        0x0000:  0001 0800 0604 0002 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0030 4f06 486e 0aa9 1501            ...0O.Hn....

# ping -c 1 -s 157 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 157(185) bytes of data.
165 bytes from 10.169.21.1: icmp_seq=0 ttl=64 time=0.481 ms

--- 10.169.21.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms

=> tcpdump (local)
15:39:06.194120 00:11:2f:e9:42:70 > 00:30:4f:06:48:6e, ethertype IPv4 (0x0800), length 199: IP 10.169.21.20 > 10.169.21.1: icmp 165: echo request seq 0
        0x0000:  4500 00b9 0000 4000 4001 fadd 0aa9 1514  E.....@.@.......
        0x0010:  0aa9 1501 0800 1832 231b 0000 fadd ae42  .......2#......B
        0x0020:  0000 0000 1ff6 0200 0000 0000 1011 1213  ................
        0x0030:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
        0x0040:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
        0x0050:  3435                                     45
15:39:06.194560 00:30:4f:06:48:6e > 00:11:2f:e9:42:70, ethertype IPv4 (0x0800), length 199: IP 10.169.21.1 > 10.169.21.20: icmp 165: echo reply seq 0
        0x0000:  4500 00b9 c52d 0000 4001 75b0 0aa9 1501  E....-..@.u.....
        0x0010:  0aa9 1514 0000 2032 231b 0000 fadd ae42  .......2#......B
        0x0020:  0000 0000 1ff6 0200 0000 0000 1011 1213  ................
        0x0030:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
        0x0040:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
        0x0050:  3435                                     45
15:39:11.192978 00:11:2f:e9:42:70 > 00:30:4f:06:48:6e, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
15:39:11.193170 00:30:4f:06:48:6e > 00:11:2f:e9:42:70, ethertype ARP (0x0806), length 60: arp reply 10.169.21.1 is-at 00:30:4f:06:48:6e
        0x0000:  0001 0800 0604 0002 0030 4f06 486e 0aa9  .........0O.Hn..
        0x0010:  1501 0011 2fe9 4270 0aa9 1514 0000 0000  ..../.Bp........
        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............

# ping -c 1 -s 158 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 158(186) bytes of data.

--- 10.169.21.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

=> tcpdump 
15:41:29.529515 00:11:2f:e9:42:70 > 00:30:4f:06:48:6e, ethertype IPv4 (0x0800), length 200: IP 10.169.21.20 > 10.169.21.1: icmp 166: echo request seq 0
        0x0000:  4500 00ba 0000 4000 4001 fadc 0aa9 1514  E.....@.@.......
        0x0010:  0aa9 1501 0800 5c76 261b 0000 89de ae42  ......\v&......B
        0x0020:  0000 0000 4314 0800 0000 0000 1011 1213  ....C...........
        0x0030:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
        0x0040:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
        0x0050:  3435                                     45
15:41:29.529940 4f:06:48:6e:08:00 > 2f:e9:42:70:00:30, ethertype Unknown (0x4500), length 200:
        0x0000:  00ba c52f 0000 4001 75ad 0aa9 1501 0aa9  .../..@.u.......
        0x0010:  1514 0000 6476 261b 0000 89de ae42 0000  ....dv&......B..
        0x0020:  0000 4314 0800 0000 0000 1011 1213 1415  ..C.............
        0x0030:  1617 1819 1a1b 1c1d 1e1f 2021 2223 2425  ...........!"#$%
        0x0040:  2627 2829 2a2b 2c2d 2e2f 3031 3233 3435  &'()*+,-./012345
        0x0050:  3637                                     67
15:41:34.528188 00:11:2f:e9:42:70 > 00:30:4f:06:48:6e, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
15:41:34.528396 00:30:4f:06:48:6e > 00:11:2f:e9:42:70, ethertype ARP (0x0806), length 60: arp reply 10.169.21.1 is-at 00:30:4f:06:48:6e
        0x0000:  0001 0800 0604 0002 0030 4f06 486e 0aa9  .........0O.Hn..
        0x0010:  1501 0011 2fe9 4270 0aa9 1514 0000 0000  ..../.Bp........
        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............

I could not make tcpdump on the server, as now i have only one monitor (the other is out of order since yesterday evening).


Regards
Pascal



^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-07-10 13:23 Pascal CHAPPERON
  0 siblings, 0 replies; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-07-10 13:23 UTC (permalink / raw)
  To: Francois Romieu
  Cc: Juha Laiho, Andrew Hutchings, linux-kernel, lars.vahlenberg,
	vinay kumar, jgarzik

> Message du 09/07/05 23:02
> De : "Francois Romieu" <romieu@fr.zoreil.com>
[...]
> Can you do the same test but send the traffic from the host which
> embeds the r8169 ?
> 
> The sis190 should not be responsive during the flow. I expect that it
> will happily return to a normal state once the traffic stops.
>
Yes, no responsive at all :i could do nothing on my box during 
the tests.
The second test (link partner r8169,packet_size 60, rx_copy_break 200)
froze definitly the box.
I repeated the test about 10 times after that (the station 
returned to a normal state each time) :
- link partner r8169 or 8139too
- rx_copy_break 60, packet size 70
- rx_copy_break 200, packet size 60 - 70 - 200

I could not reproduce the issue...

Here is one result :

# cat /proc/net/pktgen/eth2
Params: count 10000000  min_pkt_size: 60  max_pkt_size: 60
     frags: 0  delay: 0  clone_skb: 1000000  ifname: eth2
     flows: 0 flowlen: 0
     dst_min: 10.169.21.21  dst_max:
     src_min:   src_max:
     src_mac: 00:40:F4:A8:70:BC  dst_mac: 00:11:2F:E9:42:70
     udp_src_min: 9  udp_src_max: 9  udp_dst_min: 9  udp_dst_max: 9
     src_mac_count: 0  dst_mac_count: 0
     Flags:
Current:
     pkts-sofar: 10000000  errors: 9636478
     started: 1120986879778860us  stopped: 1120986948307262us idle: 14552142us
     seq_num: 10000011  cur_dst_mac_offset: 0  cur_src_mac_offset: 0
     cur_saddr: 0x115a90a  cur_daddr: 0x1515a90a
     cur_udp_dst: 9  cur_udp_src: 9
     flows: 0
Result: OK: 68528402(c53976260+d14552142) usec, 10000000 (60byte,0frags)
  145924pps 70Mb/sec (70043520bps) errors: 9636478

However, pktgen triggers (for all tests) thoses traces on the remote :
scheduling while atomic: pktgen.conf-1-1/0x00000001/5431
 [<c02a2827>] schedule+0x947/0xbb5
 [<c016ff2d>] notify_change+0x188/0x297
 [<c0122750>] __mod_timer+0x124/0x15c
 [<c02a3296>] schedule_timeout+0x6d/0xbb
 [<c01231d1>] process_timeout+0x0/0x9
 [<e0cb48f2>] count_trail_chars+0x18/0x40 [pktgen]
 [<e0cb6636>] proc_thread_write+0x24c/0x2d7 [pktgen]
 [<c0155b8c>] vfs_write+0xc8/0x12f
 [<c0155cb2>] sys_write+0x4b/0x74
 [<c0102595>] sysenter_past_esp+0x52/0x75

So i don't know if the results are significants.
(remote= P4 HT , 2.6.11.11 #3 SMP)

I also tried a ping flood from the remote :
remote # ping -q -l 256 -s 64 -f 10.169.21.21
PING 10.169.21.21 (10.169.21.21) 64(92) bytes of data.

--- 10.169.21.21 ping statistics ---
718599 packets transmitted, 718454 received, 0% packet loss, time 44313ms
rtt min/avg/max/mdev = 0.073/6.033/13.129/4.437 ms, pipe 256, ipg/ewma 0.061/7.247 ms

remote # ping -q -l 512 -s 64 -f 10.169.21.21
PING 10.169.21.21 (10.169.21.21) 64(92) bytes of data.

--- 10.169.21.21 ping statistics ---
2481376 packets transmitted, 1163044 received, 53% packet loss, time 52550ms
rtt min/avg/max/mdev = 0.065/6.945/18.312/3.045 ms, pipe 512, ipg/ewma0.021/9.369 ms

local # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet addr:10.169.21.21  Bcast:10.169.23.255  Mask:255.255.252.0
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3942816 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2624629 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:417940801 (398.5 MiB)  TX bytes:278208935 (265.3 MiB)
          Interrupt:11 Base address:0xdead


> One should expect some messages to appear in the log after you forced
> the link at 10Mb/s. Do you notice anything in dmesg ?
> 
Yes :
eth0: PHY reset until link up.
eth0: mii ext = 0000.
eth0: mii lpa = c1e1.
eth0: link on 100 Mbps Full Duplex mode.


> I would be interested to know if the attached patch makes a difference
> (the patch applies on top of the current driver).
> 
No difference for "ethtool speed 10 duplex half autoneg off"

> Can you issue a simple 'ethtool -s eth0 autoneg off' and report what
> happens ?
> 
# ethtool -s eth0 autoneg off
# ethtool eth0
[...]
        Advertised auto-negotiation: No
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off

ethtool returns the same informations as long as i don't use
"ethtool -s ...".

# ethtool -s eth0  speed 10 duplex half autoneg off
# ethtool eth0
[...]
        Advertised auto-negotiation: No
        Speed: 10Mb/s
        Duplex: Half
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
[...]
# ethtool eth0
[...]
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
[...]
#dmesg
[...]
eth0: PHY reset until link up.
eth0: mii ext = 0000.
eth0: mii lpa = c1e1.
eth0: link on 100 Mbps Full Duplex mode.
eth0: mii ext = 0000.
eth0: mii lpa = c1e1.
eth0: link on 100 Mbps Full Duplex mode.

---
Pascal




^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-07-09 13:25 Pascal CHAPPERON
  2005-07-09 20:57 ` sis190 Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-07-09 13:25 UTC (permalink / raw)
  To: Francois Romieu
  Cc: Juha Laiho, Andrew Hutchings, linux-kernel, lars.vahlenberg,
	vinay kumar, jgarzik

> Date: Wed, 6 Jul 2005 23:29:25 +0200
> From: Francois Romieu <romieu@fr.zoreil.com>
[...]
> The patchkit of the day should fix these issues:
> http://www.zoreil.com/~romieu/sis190/20050706-2.6.13-rc1/patches
[...]
> I'd appreciate if you could check the allowed frame size range, say
> ping -s 1468 ... ping -s 1473 to compare with Lars's results.
> 
> You can add something like a ping -q -l 48 -s 64 -f to your tests and
> increase the 48 and NUM_{RX/TX}_DESC but I am not sure that the remote
> 8139 will be able to go terribly far. If it performs well, pktgen
> could be useful too.

I don't receive Lars's results, but here are my results.
As far as i know, they seem pretty good...

# ping -s 1468 -c2 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 1468(1496) bytes of data.
1476 bytes from 10.169.21.1: icmp_seq=0 ttl=64 time=0.762 ms
1476 bytes from 10.169.21.1: icmp_seq=1 ttl=64 time=0.638 ms

--- 10.169.21.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.638/0.700/0.762/0.062 ms, pipe 2

# ping -s 1469 -c2 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 1469(1497) bytes of data.
1477 bytes from 10.169.21.1: icmp_seq=0 ttl=64 time=0.647 ms
1477 bytes from 10.169.21.1: icmp_seq=1 ttl=64 time=0.630 ms

--- 10.169.21.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.630/0.638/0.647/0.026 ms, pipe 2

# ping -s 1470 -c2 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 1470(1498) bytes of data.
1478 bytes from 10.169.21.1: icmp_seq=0 ttl=64 time=0.670 ms
1478 bytes from 10.169.21.1: icmp_seq=1 ttl=64 time=0.650 ms

--- 10.169.21.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.650/0.660/0.670/0.010 ms, pipe 2

# ping -s 1471 -c2 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 1471(1499) bytes of data.
1479 bytes from 10.169.21.1: icmp_seq=0 ttl=64 time=0.660 ms
1479 bytes from 10.169.21.1: icmp_seq=1 ttl=64 time=0.612 ms

--- 10.169.21.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.612/0.636/0.660/0.024 ms, pipe 2

# ping -s 1472 -c2 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 1472(1500) bytes of data.
1480 bytes from 10.169.21.1: icmp_seq=0 ttl=64 time=0.655 ms
1480 bytes from 10.169.21.1: icmp_seq=1 ttl=64 time=0.637 ms

--- 10.169.21.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.637/0.646/0.655/0.009 ms, pipe 2

# ping -s 1473 -c2 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 1473(1501) bytes of data.
1481 bytes from 10.169.21.1: icmp_seq=0 ttl=64 time=0.745 ms
1481 bytes from 10.169.21.1: icmp_seq=1 ttl=64 time=0.747 ms

--- 10.169.21.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.745/0.746/0.747/0.001 ms, pipe 2

# ping -s 1473 -c2 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 1473(1501) bytes of data.
1481 bytes from 10.169.21.1: icmp_seq=0 ttl=64 time=0.745 ms
1481 bytes from 10.169.21.1: icmp_seq=1 ttl=64 time=0.747 ms

--- 10.169.21.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.745/0.746/0.747/0.001 ms, pipe 2


NUM_TX_DESC=256
NUM_RX_DESC=256
link partner = r8169

# ping -q -l 256 -s 64 -f 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 64(92) bytes of data.

--- 10.169.21.1 ping statistics ---
2924162 packets transmitted, 2924162 received, 0% packet loss, time 143582ms
rtt min/avg/max/mdev = 0.050/3.922/116.174/10.601 ms, pipe 257, ipg/ewma 0.049/0.114 ms


# ping -q -l 512 -s 64 -f 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 64(92) bytes of data.

--- 10.169.21.1 ping statistics ---
1626523 packets transmitted, 1542700 received, 5% packet loss, time 65081ms
rtt min/avg/max/mdev = 0.050/1.167/56.088/5.896 ms, pipe 513, ipg/ewma 0.040/0.108 ms

# cat /proc/net/pktgen/eth0
Params: count 10000000  min_pkt_size: 60  max_pkt_size: 60
     frags: 0  delay: 0  clone_skb: 1000000  ifname: eth0
     flows: 0 flowlen: 0
     dst_min: 10.169.21.1  dst_max:
     src_min:   src_max:
     src_mac: 00:11:2F:E9:42:70  dst_mac: 00:40:F4:A8:70:BC
     udp_src_min: 9  udp_src_max: 9  udp_dst_min: 9  udp_dst_max: 9
     src_mac_count: 0  dst_mac_count: 0
     Flags: IPDST_RND
Current:
     pkts-sofar: 8699475  errors: 0
     started: 1120913419217947us  stopped: 1120913484497743us idle: 0us
     seq_num: 8699485  cur_dst_mac_offset: 0  cur_src_mac_offset: 0
     cur_saddr: 0x1515a90a  cur_daddr: 0x115a90a
     cur_udp_dst: 9  cur_udp_src: 9
     flows: 0
Result: OK: 65279796(c65279796+d0) usec, 8699475 (60byte,0frags)
  133264pps 63Mb/sec (63966720bps) errors: 0


"ethtool -s eth0 ..." does not freeze the station anymore, but
"autoneg off" does not work properly :

# ethtool -s eth0 speed 10 duplex half autoneg off
# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 10Mb/s
        Duplex: Half
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Current message level: 0x00000037 (55)
        Link detected: yes
# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Current message level: 0x00000037 (55)
        Link detected: yes

The values written in StationControl are probaly wrong,
but i really don't know what i can try...


> (on an unrelated note, something enabled the "send mail as html" checkbox
> in your mail user agent: you may consider removing it).

Sorry, but i must use Webmail, as my provider's smtp is open-relay, and i don't
how the webmail thing deals with my messages...


Regards
Pascal






^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-07-06 15:58 Pascal CHAPPERON
  2005-07-06 21:29 ` sis190 Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-07-06 15:58 UTC (permalink / raw)
  To: Francois Romieu
  Cc: Juha Laiho, Andrew Hutchings, linux-kernel, lars.vahlenberg,
	vinay kumar, jgarzik

> Message du 05/07/05 01:34
> De : "Francois Romieu" <romieu@fr.zoreil.com>
[...]
> Can you check if there is a regression in sis190-000.patch available at
> http://www.zoreil.com/~romieu/sis190/20050704-2.6.13-rc1/patches ?
> 

That one works perfectly; i tried it in the same conditions as
the previous patch, and i don't notice a regression.

[...]
> If it works and you want some entertainment, you can apply sis190-010.patch
> + sis190-020.patch and experience with ethtool/mii-tool. 
> 
[...]

sis190-010.patch does not compile properly :

# make clean;make;make install
rm -f *.o *.ko .*.cmd .*.flags *.mod.c
make -C /lib/modules/2.6.12.1/build SUBDIRS=/data/src/sis190  modules
make[1]: Entering directory `/usr/src/linux-2.6.12.1-custom'
  CC [M]  /data/src/sis190/sis190.o
/data/src/sis190/sis190.c: In function `sis190_init_one':
/data/src/sis190/sis190.c:1318: error: structure has no member named `poll_controller'

# diff -puN sis190-20050704-10.c sis190.c
--- sis190-20050704-10.c        2005-07-06 14:49:19.000000000 +0200
+++ sis190.c    2005-07-06 15:41:49.000000000 +0200

@@ -639,8 +640,6 @@ static void sis190_netpoll(struct net_de
        sis190_interrupt(pdev->irq, dev, NULL);
        enable_irq(pdev->irq);
 }
-#else
-#define sis190_netpoll         NULL
 #endif

 static void sis190_free_rx_skb(struct sis190_private *tp,
@@ -1314,7 +1313,9 @@ static int __devinit sis190_init_one(str
        dev->tx_timeout = sis190_tx_timeout;
        dev->watchdog_timeo = SIS190_TX_TIMEOUT;
        dev->hard_start_xmit = sis190_start_xmit;
+#ifdef CONFIG_NET_POLL_CONTROLLER
        dev->poll_controller = sis190_netpoll;
+#endif
        dev->set_multicast_list = sis190_set_rx_mode;
        SET_ETHTOOL_OPS(dev, &sis190_ethtool_ops);
        dev->irq = pdev->irq;

After that, it compiles and works as expected; i can use netconsole
and get local messages on the other box.


There is something wrong whith sis190-020.patch;
it works, i can use the link as usual, i can use
ethtool :

# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Current message level: 0x00000037 (55)
        Link detected: yes

But i get those traces in syslog, when the driver is
loaded and every time i use ethtool :

[...]
scheduling while atomic: mii-tool/0x00000001/4699

Call Trace:<ffffffff8030358a>{schedule+122} <ffffffff801ce6de>{avc_has_perm_noaudit+1134}
       <ffffffff80191290>{update_atime+64} <ffffffff80139109>{__mod_timer+425}
       <ffffffff803047fe>{schedule_timeout+158} <ffffffff80139b70>{process_timeout+0}
       <ffffffff80139f68>{msleep+56} <ffffffff880370c8>{:sis190:__mdio_cmd+24}
       <ffffffff8803712f>{:sis190:mdio_read+15} <ffffffff88034868>{:mii:generic_mii_ioctl+152}
       <ffffffff880387dd>{:sis190:sis190_ioctl+77} <ffffffff802a30db>{dev_ifsioc+971}
       <ffffffff802a33e5>{dev_ioctl+741} <ffffffff802e47da>{inet_ioctl+138}
       <ffffffff80297fdc>{sock_ioctl+572} <ffffffff8018967a>{do_ioctl+58}
       <ffffffff8018998d>{vfs_ioctl+685} <ffffffff80189a2a>{sys_ioctl+106}
       <ffffffff8010d866>{system_call+126}
[...]
scheduling while atomic: ethtool/0x00000001/4703

Call Trace:<ffffffff8030358a>{schedule+122} <ffffffff80139109>{__mod_timer+425}
       <ffffffff803047fe>{schedule_timeout+158} <ffffffff80139b70>{process_timeout+0}
       <ffffffff80139f68>{msleep+56} <ffffffff880370c8>{:sis190:__mdio_cmd+24}
       <ffffffff8803712f>{:sis190:mdio_read+15} <ffffffff880340df>{:mii:mii_ethtool_gset+223}
       <ffffffff880385de>{:sis190:sis190_get_settings+46} <ffffffff802a43d2>{dev_ethtool+290}
       <ffffffff80159862>{buffered_rmqueue+690} <ffffffff80159a32>{__alloc_pages+194}
       <ffffffff801ce6de>{avc_has_perm_noaudit+1134} <ffffffff801650f3>{do_no_page+483}
       <ffffffff8015be4a>{__do_page_cache_readahead+362} <ffffffff8018f5eb>{__d_lookup+363}
       <ffffffff801ce6de>{avc_has_perm_noaudit+1134} <ffffffff801ce6de>{avc_has_perm_noaudit+1134}
       <ffffffff80191290>{update_atime+64} <ffffffff801ce76a>{avc_has_perm+90}
       <ffffffff80159862>{buffered_rmqueue+690} <ffffffff801cf57a>{inode_has_perm+106}
       <ffffffff801561fa>{filemap_nopage+394} <ffffffff802a33b5>{dev_ioctl+693}
       <ffffffff802e47da>{inet_ioctl+138} <ffffffff80297fdc>{sock_ioctl+572}
       <ffffffff8018967a>{do_ioctl+58} <ffffffff8018998d>{vfs_ioctl+685}
       <ffffffff80189a2a>{sys_ioctl+106} <ffffffff8010d866>{system_call+126}
[...]


I also tried to set sis190 mode (eg: 10 full autoneg off), but the driver
froze the box.

As for now mii support seems unstable, i do not play further more with 
the media management.

Regards
Pascal



^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-07-02 10:52 Pascal CHAPPERON
  2005-07-02 11:33 ` sis190 Francois Romieu
  2005-07-04 23:30 ` sis190 Francois Romieu
  0 siblings, 2 replies; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-07-02 10:52 UTC (permalink / raw)
  To: Francois Romieu
  Cc: Juha Laiho, Andrew Hutchings, linux-kernel, vinay kumar, jgarzik

> Message du 01/07/05 01:39
> De : "Francois Romieu" <romieu@fr.zoreil.com>
[...]
> 
> There is an updated version at 
> http://www.zoreil.com/~romieu/sis190/20050630-2.6.13-rc1-sis190-test.patch
> 
> It would be nice to know how it behaves wrt preempt (no need to experiment
> with the media management), especially if you can describe the freeze more
> specifically.
> 
> --
> Ueimor
> 
> 
François, it's really incredible! 
A few lines diff, and now the driver is very stable with or 
without preempted kernel...

I'll be very happy if you can tell me where is the trick.

I tried it carefully : console, X11 (without nvidia), X11 (with nvidia),
IRQ sharing between sis190/nvidia, full load : it worked perfectly.

# uname -a
Linux local 2.6.12.1 #2 Thu Jun 23 11:05:57 CEST 2005 x86_64 x86_64 x86_64 GNU/Linux


# modinfo sis190
filename:       /lib/modules/2.6.12.1/kernel/drivers/net/sis190.ko
[...]
vermagic:       2.6.12.1 preempt gcc-3.4


# cat /proc/interrupts
           CPU0
  0:    4403978          XT-PIC  timer
  1:       4594          XT-PIC  i8042
  2:          0          XT-PIC  cascade
  3:          1          XT-PIC  ohci_hcd:usb3
  5:          1          XT-PIC  ohci_hcd:usb4
  7:          7          XT-PIC  ohci_hcd:usb2
  8:          0          XT-PIC  rtc
  9:          0          XT-PIC  acpi
 10:          1          XT-PIC  ehci_hcd:usb1
 11:   18607531          XT-PIC  SiS SI7012, nvidia, eth0
 12:     139167          XT-PIC  i8042
 14:     196392          XT-PIC  ide0
 15:      39224          XT-PIC  ide1
NMI:       2849
LOC:    4403221
ERR:          0
MIS:          0


I executed simultaneously :
- a loop within 2 TX 700MB and 1 RX 700MB
- a loop within /usr/src/linux/make clean;make
- an audio stream
- an openglx demo
- my usual tasks (mozilla, xemacs)

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet addr:10.169.21.21  Bcast:10.169.23.255  Mask:255.255.252.0
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9922052 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17974399 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8064017712 (7.5 GiB)  TX bytes:23410613404 (21.8 GiB)
          Interrupt:11 Base address:0xdead


The average speed of the transfers was about 10MB/s under full load
without hurting too much CPU resource.

I retried the previous patch in the same conditions : it frooze the
box after a few seconds, not only with X11 (no nvidia), but also
with an audio stream (at the console).

I also retried (last patch) 10Mb/full autoneg off on the r8169 link 
partner (it prevously froze the box) : it worked perfectly.

The TX performances are also improved (r8169 LP):
- 10 full autoneg off : 1,2 MB both directions
- 100 full autoneg off : 11.6MB/s both directions

It still remains a problem in half duplex modes.

Perhaps somebody else want to try the patch with different
link partners (switchs, 10Mb cards, ...)

I can not make other tries before Monday, but i'll take a
look at the media management after...

BTW, can you remove the following printks from the patch ?
The printks in interrupt functions make dmesg unusuable, 
and the stuff in sis190_get_drvinfo triggers a kernel oops
when the module is loaded (null pointer assignment).

# diff -puN sis190-20050630.c sis190.c
--- sis190-20050630.c   2005-07-02 09:07:19.000000000 +0200
+++ sis190.c    2005-07-02 10:49:52.000000000 +0200
@@ -456,8 +456,6 @@ static inline int sis190_try_rx_copy(str
                skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN);
                if (skb) {
                        skb_reserve(skb, NET_IP_ALIGN);
-                       printk(KERN_INFO "sk_buff[0]->tail = %p\n",
-                              sk_buff[0]->tail);
                        eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0);
                        *sk_buff = skb;
                        sis190_give_to_asic(desc, rx_buf_sz);
@@ -483,15 +481,12 @@ static int sis190_rx_interrupt(struct ne
                u32 status;

                rmb();
-               printk(KERN_INFO "%s: Rx status = %08x\n", dev->name,
-                      desc->status);

                if (desc->status & OWNbit)
                        break;

                status = le32_to_cpu(desc->PSize);

-               printk(KERN_INFO "%s: Rx PSize = %08x\n", dev->name, status);

                if (status & RxCRC) {
                        printk(KERN_INFO "%s: crc error. status = %08x\n",
@@ -638,7 +633,6 @@ static irqreturn_t sis190_interrupt(int

                SIS_W32(IntrStatus, status);

-               printk(KERN_INFO "%s: status = %08x\n", dev->name, status);

                if ((status & LinkChange) && netif_running(dev)) {
                        printk(KERN_INFO "%s: link change\n", dev->name);
@@ -1230,31 +1224,11 @@ static void sis190_get_drvinfo(struct ne
                               struct ethtool_drvinfo *info)
 {
        struct sis190_private *tp = netdev_priv(dev);
-       unsigned int i;
-       u32 *u;

        strcpy(info->driver, DRV_NAME);
        strcpy(info->version, DRV_VERSION);
        strcpy(info->bus_info, pci_name(tp->pci_dev));

-       printk(KERN_INFO "%s: dirty_rx=%ld cur_rx=%ld\n",
-              dev->name, tp->dirty_rx, tp->cur_rx);
-       u = (void *) tp->RxDescRing;
-       printk(KERN_INFO "   PSize    status   addr     size     PSize    status   addr     size\n");
-       for (i = 0; i < (NUM_RX_DESC / 2); i++) {
-               printk(KERN_INFO "%02d:%08x %08x %08x %08x %08x %08x %08x %08x\n",
-                      i, u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]);
-               u += 8;
-       }
-       printk(KERN_INFO "%s: dirty_tx=%ld cur_tx=%ld\n",
-              dev->name, tp->dirty_tx, tp->cur_tx);
-       u = (void *) tp->TxDescRing;
-       printk(KERN_INFO "   PSize    status   addr     size     PSize    status   addr     size\n");
-       for (i = 0; i < (NUM_TX_DESC / 2); i++) {
-               printk(KERN_INFO "%02d %08x %08x %08x %08x %08x %08x %08x %08x\n",
-                      i, u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]);
-               u += 8;
-       }
 }

 static struct ethtool_ops sis190_ethtool_ops = {


Regards
Pascal



^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-06-26 12:39 Pascal CHAPPERON
  2005-06-30 23:37 ` sis190 Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-06-26 12:39 UTC (permalink / raw)
  To: Francois Romieu
  Cc: Juha Laiho, Andrew Hutchings, linux-kernel, vinay kumar, jgarzik,
	pascal.chapperon

> Message du 22/06/05 01:02
> De : "Francois Romieu" <romieu@fr.zoreil.com>
[...]
> I have copied the sis190 patches at http://www.zoreil.com/~romieu/sis190
> if someone wants to hack them in the meantime.

1) sis190 freezes the box when kernel PREEMPT is enabled :

I made many tries, but i could not solve it;
- it does not occur while receiving huge files.
- it does not occur when only a few packets are
  transmitted (remote connection, ls, find)
- it occurs only while transmiting huge files AND
  trying to do someting else (open a new term,...)
- I could transfer a huge file (700MB) several times
  as i was at the console (and i could switch to another
console to perform find, ls,... during the transfer).

I managed the system so the sis190 had its own IRQ, but it
made no difference.

As i suspected nvidia driver, i switched to nv driver : no result.

It seems to me that a task inside the sis190_tx_interrupt() is 
not protected against preemption (and it is probably the same
on a SMP not prempted).

I tried to play with spinlocks, but with no result :
@@ -621,6 +621,7 @@ static irqreturn_t sis190_interrupt(int
        void __iomem *ioaddr = tp->mmio_addr;
        int handled = 0;
        int boguscnt;
+       unsigned long flags;

        for (boguscnt = max_interrupt_work; boguscnt > 0; boguscnt--) {
                u32 status = SIS_R32(IntrStatus);
@@ -651,9 +652,9 @@ static irqreturn_t sis190_interrupt(int
                        sis190_rx_interrupt(dev, tp, ioaddr);

                if (status & TxQ0Int) {
-                       spin_lock(&tp->lock);
+                       spin_lock_irqsave(&tp->lock, flags);
                        sis190_tx_interrupt(dev, tp, ioaddr);
-                       spin_unlock(&tp->lock);
+                       spin_unlock_irqrestore(&tp->lock, flags);
                }
        }


or :



@@ -581,6 +581,7 @@ static void sis190_tx_interrupt(struct n
                                struct sis190_private *tp, void __iomem *ioaddr)
 {
        unsigned int tx_left, dirty_tx = tp->dirty_tx;
+       unsigned long flags;

        for (tx_left = tp->cur_tx - dirty_tx; tx_left > 0; tx_left--) {
                unsigned int entry = dirty_tx % NUM_TX_DESC;
@@ -604,10 +605,12 @@ static void sis190_tx_interrupt(struct n
                dirty_tx++;
        }

+       spin_lock_irqsave(&tp->lock, flags);
        if (tp->dirty_tx != dirty_tx) {
                tp->dirty_tx = dirty_tx;
                netif_wake_queue(dev);
        }
+       spin_unlock_irqrestore(&tp->lock, flags);
 }

 /*
@@ -651,9 +654,7 @@ static irqreturn_t sis190_interrupt(int
                        sis190_rx_interrupt(dev, tp, ioaddr);

                if (status & TxQ0Int) {
-                       spin_lock(&tp->lock);
                        sis190_tx_interrupt(dev, tp, ioaddr);
-                       spin_unlock(&tp->lock);
                }
        }




In fact, i don't know where are the critical sections...

2) sis190 freezes the box when the link partner is
a r8169 forced in 10 full autoneg off (preempted or not
preempted kernel) :

it is probably for the same reason, as it occurs only when 
transmitting a big file.

3) poor TX performances when link partner is forced to 
autoneg off (not preempted kernel):

Once again it seems that something goes wrong with TX tasks...


Regards
Pascal



^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-06-19 10:17 Pascal CHAPPERON
  2005-06-21 23:02 ` sis190 Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-06-19 10:17 UTC (permalink / raw)
  To: Francois Romieu
  Cc: Juha Laiho, Andrew Hutchings, linux-kernel, vinay kumar, jgarzik

> Message du 17/06/05 20:23
> De : "Francois Romieu" <romieu@fr.zoreil.com>
[...]
> It should be fixed now. Please try the patch of the day:
> http://www.fr.zoreil.com/people/francois/misc/20050617-2.6.12-rc-sis190-test.patch
> 
[...]
Nice, it works :)
It is now usable, but it can freeze the box in some cases (see below).

First try : network (dhcp) initialized correctly, but the box froze
immediatly as i tried to transfer a 35MB file via scp 
(not really frozen, as the transfer achieved correctly).
I  had to switch power button...

i raised NUM_RX_DESC from 16 to 256 : i could achieve 2 transfers 
before i lost keyboard; as i was on the console, i could see that
 sis190 printks were still printed (very slowly), but nothing else
was working.

[...many tries...]

I disabled PREEMPT in the kernel : the driver worked correctly.

# modinfo sis190
[...]
alias:          pci:v00001039d00000190sv*sd*bc*sc*i*
depends:
vermagic:       2.6.12-rc6 gcc-3.4

# cat /var/log/messages
[...]
Jun 18 11:04:41 local kernel: eth0: Rx status = 76040040
Jun 18 11:04:41 local kernel: eth0: Rx PSize = 01010046
Jun 18 11:04:41 local kernel: sk_buff[0]->tail = ffff81000cc78810
Jun 18 11:04:41 local kernel: eth0: Rx status = c0000000
Jun 18 11:04:41 local kernel: eth0: status = 20000004
Jun 18 11:04:41 local kernel: eth0: status = 00000040
Jun 18 11:04:41 local kernel: eth0: dirty_rx=143 cur_rx=143
Jun 18 11:04:41 local kernel:    PSize    status   addr     size     PSize    status   addr     size
Jun 18 11:04:41 local kernel: 00:00000000 c0000000 1018c010 00000600 00000000 c0000000 040a6010 00000600
Jun 18 11:04:41 local kernel: 01:00000000 c0000000 03d64010 00000600 00000000 c0000000 1ce5a010 00000600
Jun 18 11:04:41 local kernel: 02:00000000 c0000000 1ce5a810 00000600 00000000 c0000000 1179e010 00000600
Jun 18 11:04:41 local kernel: 03:00000000 c0000000 1c28f810 00000600 00000000 c0000000 1c283010 00000600
Jun 18 11:04:41 local kernel: 04:00000000 c0000000 0c863010 00000600 00000000 c0000000 0eba9010 00000600
Jun 18 11:04:41 local kernel: 05:00000000 c0000000 0eba9810 00000600 00000000 c0000000 0a24a010 00000600
Jun 18 11:04:41 local kernel: 06:00000000 c0000000 03d62010 00000600 00000000 c0000000 0cc78010 00000600
Jun 18 11:04:41 local kernel: 07:00000000 c0000000 0cc78810 00000600 01010046 76040040 040a6810 80000600
Jun 18 11:04:41 local kernel: eth0: dirty_tx=174 cur_tx=174
[...]

I also tried :
1) to comment out sis190_make_unusable_by_asic() in sis190_rx_interrupt() :
			if (sis190_try_rx_copy(&skb, pkt_size, desc,
					       tp->rx_buf_sz)) {
				pci_action = pci_unmap_single;
				tp->Rx_skbuff[entry] = NULL;
				/* sis190_make_unusable_by_asic(desc); */
			}

No difference (it worked the same way).

2) to comment out the test "if (pkt_size < rx_copybreak)" in sis190_try_rx_copy() :
It worked with kernel PREEMPT.
The transfer speed was the same.
I imagine that rx_copybreak is better for large packets, but i still do not
understand why it is better :( (less upload ?)

> > I also tried to force 10H, 10F, 100H, 100F autoneg off on the other card.
[...] 
> Did the sis190 driver report a link change event ?
> 
> --
> Ueimor
> 
I made new tests with 2 differents boards on the remote (modes + transfer speed) : 
worked good in some cases, bad in another.
In one case (10 full with r8169) , it froze the box (see below).

I used your patch without modifications (I only remove printks to have real perfs).
NUM_TX_DESC     64
NUM_RX_DESC     256
Kernel was compiled without PREEMPT.

I transferred (twice for each test) a 35MB file in both directions.


1) local = sis190 remote = r8169
--------------------------------

remote # uname -a
Linux remote 2.6.11.11 #3 SMP Sat Jun 18 16:23:51 CEST 2005 i686 i686 i386 GNU/Linux
remote # ethtool -i eth2
driver: r8169
version: 2.2LK

remote # ethtool -s eth2 autoneg on
local  # dmesg
[...]
[ 2954.467733] sis190 Gigabit Ethernet driver 1.2 loaded
[ 2954.467958] ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11
[ 2954.467961] ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
[ 2954.467970] PCI: Setting latency timer of device 0000:00:04.0 to 64
[ 2954.475927] 0000:00:04.0: sis190 at ffffc20000004c00 (IRQ: 11), 00:11:2f:e9:42:70
[ 2954.475932] eth0: Enabling Auto-negotiation.
[ 2954.510049] eth0: link change
[ 2954.512912] eth0: mii 0x1f = 0000.
[ 2954.514038] eth0: mii lpa = 0000.
[ 2954.514041] eth0: Link on unknown mode.
[ 2960.061387] eth0: PHY reset until link up
[ 2960.097462] eth0: no IPv6 routers present
[ 2965.614860] eth0: PHY reset until link up
           [ i plug the wire ]
[ 2971.168332] eth0: PHY reset until link up
[ 2972.171635] eth0: link change
[ 2972.174572] eth0: mii 0x1f = 0000.
[ 2972.175683] eth0: mii lpa = c1e1.
[ 2972.175685] eth0: Link on 100 Mbps Full Duplex mode.
[...]

-> 35MB  11.6MB/s   00:03
<- 35MB  11.6MB/s   00:03

remote # ethtool -s eth2 speed 10 duplex half autoneg off
local  # dmesg
[...]
[ 3169.769898] eth0: link change
[ 3169.773250] eth0: mii 0x1f = 0000.
[ 3169.774364] eth0: mii lpa = 4021.
[ 3169.774366] eth0: Link on 10 Mbps Half Duplex mode.
       [ could not ping remote]

I had to reload sis190 (network restart was not sufficient).

->        35MB 334.2KB/s   01:47
<-   8% 2976KB  40.2KB/s   13:35 ETA

remote # ethtool -s eth2 speed 10 duplex full autoneg off
local  # dmesg
[...]
[ 3467.070750] eth0: pad error. status = 01000042
[ 3467.208669] eth0: pad error. status = 01000048
[ 3467.329894] eth0: pad error. status = 01000043
[ 3469.350736] eth0: pad error. status = 01000044
[ 3469.351500] eth0: pad error. status = 0100005a
[ 3487.685124] eth0: link change
[ 3487.687358] eth0: PHY reset until link up
[ 3488.846780] eth0: link change
[ 3488.850113] eth0: mii 0x1f = 0000.
[ 3488.851224] eth0: mii lpa = 4061.
[ 3488.851226] eth0: Link on 10 Mbps Full Duplex mode.

No need to restart network...

the transfer from local to remote froze immediatly the box.

It's always reproductible : box freshly started,
network restarted, sis190 reloaded...

-> do not try it!
<- 35MB   1.1MB/s   00:31

In the other direction (remote -> local), i could transfer
the file as many times as i wanted.


remote # ethtool -s eth2 speed 100 duplex half autoneg off
local  # dmesg
[...]
[  638.939950] eth0: link change
[  638.943171] eth0: mii 0x1f = 0000.
[  638.944282] eth0: mii lpa = 4081.
[  638.944284] eth0: Link on 100 Mbps Half Duplex mode.

No need to restart network...

-> 35MB   1.0MB/s   00:35
<- 35MB   2.9MB/s   00:12

remote # ethtool -s eth2 speed 100 duplex full autoneg off
local  # dmesg
[...]
[  281.822151] eth0: link change
[  281.825442] eth0: mii 0x1f = 0000.
[  281.826553] eth0: mii lpa = 4181.
[  281.826555] eth0: Link on 100 Mbps Full Duplex mode.

No need to restart network...

-> 35MB  11.6MB/s   00:03
<- 35MB  11.6MB/s   00:03



2) local = sis190 remote = 8139too
----------------------------------

remote # ethtool -i eth2
driver: 8139too
version: 0.9.27

remote # ethtool -s eth2 autoneg on
local  # dmesg
[...]
[ 1122.883216] eth0: link change
[ 1122.886164] eth0: mii 0x1f = 0000.
[ 1122.887275] eth0: mii lpa = 45e1.
[ 1122.887278] eth0: Link on 100 Mbps Full Duplex mode.

No need to restart network...

-> 35MB  11.6MB/s   00:03
<- 35MB  11.6MB/s   00:03

remote # ethtool -s eth2 speed 10 duplex half autoneg off
local  # dmesg
[...]
[ 1297.412384] eth0: link change
[ 1297.415299] eth0: mii 0x1f = 0000.
[ 1297.416410] eth0: mii lpa = 0021.
[ 1297.416412] eth0: Link on 10 Mbps Half Duplex mode.

No need to restart network...

->  3% 1296KB  61.8KB/s   09:17 ETA
<- 43%   15MB 336.1KB/s   00:59 ETA

remote # ethtool -s eth2 speed 10 duplex full autoneg off
local  # dmesg
[...]
[ 1396.959707] eth0: pad error. status = 01000048
[ 1396.961143] eth0: pad error. status = 0100004a
[ 1396.962580] eth0: pad error. status = 0100004a
[ 1396.964014] eth0: pad error. status = 01000042
[ 1396.965448] eth0: pad error. status = 01000042
[ 1396.966886] eth0: pad error. status = 0100004c
         [ i did not find mode report ]

No need to restart network...

-> 35MB 337.3KB/s   01:46
<- 35MB   1.1MB/s   00:31

I restarted network, but nothing worked anymore; so i
also reloaded sis190.

local  # dmesg
[...]
[ 1741.049314] eth0: Enabling Auto-negotiation.
[ 1746.626290] eth0: mii 0x1f = 0000.
[ 1746.627399] eth0: mii lpa = 0021.
[ 1746.627401] eth0: Link on 10 Mbps Half Duplex mode.
                    [false detection ^^^^]

-> 13% 4816KB 357.6KB/s   01:26 ETA
<-       35MB   1.1MB/s   00:32

remote # ethtool -s eth2 speed 100 duplex half autoneg off
local  # dmesg
[...]
[ 1990.441900] eth0: link change
[ 1990.445110] eth0: mii 0x1f = 0000.
[ 1990.446222] eth0: mii lpa = 0081.
[ 1990.446224] eth0: Link on 100 Mbps Half Duplex mode.

No need to restart network...

-> 35MB   1.1MB/s   00:33
<- 35MB   2.2MB/s   00:16

remote # ethtool -s eth2 speed 100 duplex full autoneg off
local  # dmesg
[...]
[ 2075.194365] eth0: pad error. statad error. status = 01000232
[...]
[ 2125.300416] eth0: pad error. status = 01000040
[ 2129.465137] eth0: pad error. status = 01000046
[ 2129.804272] eth0: pad error. status = 01000040
[ 2130.498300] eth0: pad error. status = 01000044
         [ i did not find mode report ]

-> 35MB   1.2MB/s   00:30
<- 35MB  11.6MB/s   00:03

I restarted network, it worked, but still pad errors.
So i reloaded sis190.

local  # dmesg
[...]
[ 2346.490911] eth0: Enabling Auto-negotiation.
[ 2352.068364] eth0: mii 0x1f = 0000.
[ 2352.069478] eth0: mii lpa = 0081.
[ 2352.069482] eth0: Link on 100 Mbps Half Duplex mode.
                     [false detection ^^^^]

-> 35MB   1.1MB/s   00:32
<- 35MB  11.6MB/s   00:03


As you can see, it always works fine with autoneg on, and
only 100 full with r8169 is OK with autoneg off.



Regards
Pascal



^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-06-17 11:14 Pascal CHAPPERON
  2005-06-17 18:22 ` sis190 Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-06-17 11:14 UTC (permalink / raw)
  To: Francois Romieu; +Cc: Andrew Hutchings, linux-kernel, vinay kumar, jgarzik

> Message du 17/06/05 00:36
> De : "Francois Romieu" <romieu@fr.zoreil.com>
> 
> Can you give a try at:
> http://www.fr.zoreil.com/people/francois/misc/20050616-2.6.12-rc-sis190-test.patch
> 
> Please issue a few packets, say 4 to 8, and check your log after an
> ethtool -i eth0. Then wait for the Rx process to get stuck and issue
> the same ethtool command. You can probably lower NUM_RX_DESC to 16 or
> 32 to minimize the output.
> 
> --
> Ueimor
> 
> 

I noticed that you remove NET_IP_ALIGN in sis190_alloc_rx_skb(), 
but not in sis190_try_rx_copy(); though the driver "worked" like
yesterday...


BTW, i had to put the printk about RxdescRing in sis190_interrupt(),
as i had Kernel Oops when in sis190_get_drvinfo().


# diff -puN sis190-20050616.c sis190.c
--- sis190-20050616.c   2005-06-17 11:56:46.000000000 +0200
+++ sis190.c    2005-06-17 12:12:20.000000000 +0200
@@ -76,8 +76,8 @@ static int multicast_filter_limit = 32;
 /* MAC address length */
 #define MAC_ADDR_LEN   6

-#define NUM_TX_DESC    64      /* Number of Tx descriptor registers */
-#define NUM_RX_DESC    64      /* Number of Rx descriptor registers */
+#define NUM_TX_DESC    16      /* Number of Tx descriptor registers */
+#define NUM_RX_DESC    16      /* Number of Rx descriptor registers */
 #define TX_RING_BYTES  (NUM_TX_DESC * sizeof(struct TxDesc))
 #define RX_RING_BYTES  (NUM_RX_DESC * sizeof(struct RxDesc))
 #define RX_BUF_SIZE    1536    /* Rx Buffer size */
@@ -621,6 +621,8 @@ static irqreturn_t sis190_interrupt(int
        void __iomem *ioaddr = tp->mmio_addr;
        int handled = 0;
        int boguscnt;
+       unsigned int i;
+       u32 *u;

        for (boguscnt = max_interrupt_work; boguscnt > 0; boguscnt--) {
                u32 status = SIS_R32(IntrStatus);
@@ -637,7 +639,8 @@ static irqreturn_t sis190_interrupt(int

                SIS_W32(IntrStatus, status);

-               printk(KERN_INFO "%s: status = %08x\n", dev->name, status);
+               if ( status != 0x20000000)
+                 printk(KERN_INFO "%s: status = %08x\n", dev->name, status);

                if ((status & LinkChange) && netif_running(dev)) {
                        printk(KERN_INFO "%s: link change\n", dev->name);
@@ -647,8 +650,29 @@ static irqreturn_t sis190_interrupt(int
                if ((status & (TxQ0Int | RxQInt)) == 0)
                        break;

-               if (status & (RxQInt))
-                       sis190_rx_interrupt(dev, tp, ioaddr);
+               if (status & (RxQInt)) {
+                 if ( tp->cur_rx > 29) {
+                   printk(KERN_INFO "%s: dirty_rx=%ld cur_rx=%ld\n",
+                          dev->name, tp->dirty_rx, tp->cur_rx);
+                   u = (void *) tp->RxDescRing;
+                   printk(KERN_INFO "   PSize    status   addr     size     PSize    status   addr     size\n");
+                   for (i = 0; i < (NUM_RX_DESC / 2); i++) {
+                     printk(KERN_INFO "%02d:%08x %08x %08x %08x %08x %08x %08x %08x\n",
+                            i, u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]);
+                     u += 8;
+                   }
+                   printk(KERN_INFO "%s: dirty_tx=%ld cur_tx=%ld\n",
+                          dev->name, tp->dirty_tx, tp->cur_tx);
+                   u = (void *) tp->TxDescRing;
+                   printk(KERN_INFO "   PSize    status   addr     size     PSize    status   addr     size\n");
+                   for (i = 0; i < (NUM_TX_DESC / 2); i++) {
+                     printk(KERN_INFO "%02d %08x %08x %08x %08x %08x %08x %08x %08x\n",
+                            i, u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]);
+                     u += 8;
+                   }
+                 }
+                 sis190_rx_interrupt(dev, tp, ioaddr);
+               }

                if (status & (TxQ0Int)) {
                        spin_lock(&tp->lock);
@@ -1233,31 +1257,11 @@ static void sis190_get_drvinfo(struct ne
                               struct ethtool_drvinfo *info)
 {
        struct sis190_private *tp = netdev_priv(dev);
-       unsigned int i;
-       u32 *u;

        strcpy(info->driver, DRV_NAME);
        strcpy(info->version, DRV_VERSION);
        strcpy(info->bus_info, pci_name(tp->pci_dev));

-       printk(KERN_INFO "%s: dirty_rx=%ld cur_rx=%ld\n",
-              dev->name, tp->dirty_rx, tp->cur_rx);
-       u = (void *) tp->RxDescRing;
-       printk(KERN_INFO "   PSize    status   addr     size     PSize    status   addr     size\n");
-       for (i = 0; i < (NUM_RX_DESC / 2); i++) {
-               printk(KERN_INFO "%02d:%08x %08x %08x %08x %08x %08x %08x %08x\n",
-                      i, u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]);
-               u += 8;
-       }
-       printk(KERN_INFO "%s: dirty_tx=%ld cur_tx=%ld\n",
-              dev->name, tp->dirty_tx, tp->cur_tx);
-       u = (void *) tp->TxDescRing;
-       printk(KERN_INFO "   PSize    status   addr     size     PSize    status   addr     size\n");
-       for (i = 0; i < (NUM_TX_DESC / 2); i++) {
-               printk(KERN_INFO "%02d %08x %08x %08x %08x %08x %08x %08x %08x\n",
-                      i, u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]);
-               u += 8;
-       }
 }

 static struct ethtool_ops sis190_ethtool_ops = {
@@ -1311,6 +1315,7 @@ static int __devinit sis190_init_one(str
        dev->open = sis190_open;
        dev->hard_start_xmit = sis190_start_xmit;
        dev->get_stats = sis190_get_stats;
+       SET_ETHTOOL_OPS(dev, &sis190_ethtool_ops);
        dev->stop = sis190_close;
        dev->tx_timeout = sis190_tx_timeout;
        dev->set_multicast_list = sis190_set_rx_mode;
 



# dmesg
[...]
sis190 Gigabit Ethernet driver 1.2 loaded
ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
PCI: Setting latency timer of device 0000:00:04.0 to 64
0000:00:04.0: sis190 at ffffc20000004c00 (IRQ: 11), 00:11:2f:e9:42:70
eth0: Enabling Auto-negotiation.
eth0: status = 22000000
eth0: mii 0x1f = 0000.
eth0: mii lpa = 4501.
eth0: Link on 1000 Mbps Full Duplex mode.
eth0: no IPv6 routers present
eth0: status = 0000000c
eth0: status = 00000040
eth0: Rx status = 40040040
eth0: Rx PSize = 01010040
sk_buff[0]->tail = ffff810013381010
eth0: Rx status = c0000000
[...]
eth0: status = 20000040
eth0: dirty_rx=30 cur_rx=30
   PSize    status   addr     size     PSize    status   addr     size
00:00000000 c0000000 13381010 00000600 00000000 c0000000 13847010 00000600
01:00000000 c0000000 1edcb810 00000600 00000000 c0000000 1b694810 00000600
02:00000000 c0000000 1b697010 00000600 00000000 c0000000 077c4810 00000600
03:00000000 c0000000 07e15010 00000600 00000000 c0000000 06e3e810 00000600
04:00000000 c0000000 1719e810 00000600 00000000 c0000000 1b69b810 00000600
05:00000000 c0000000 1b694010 00000600 00000000 c0000000 07741010 00000600
06:00000000 c0000000 065d8010 00000600 00000000 c0000000 07a84010 00000600
07:010100a6 76040040 13381810 00000600 00000000 c0000000 1f7c1010 00000600
eth0: dirty_tx=36 cur_tx=36
   PSize    status   addr     size     PSize    status   addr     size
00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
01 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
02 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
04 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
05 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
06 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
07 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
eth0: Rx status = 76040040
eth0: Rx PSize = 010100a6
sk_buff[0]->tail = ffff810013381810
eth0: Rx status = c0000000
eth0: status = 0000000c
eth0: status = 000000c0
eth0: dirty_rx=31 cur_rx=31
   PSize    status   addr     size     PSize    status   addr     size
00:00000000 c0000000 13381010 00000600 00000000 c0000000 13847010 00000600
01:00000000 c0000000 1edcb810 00000600 00000000 c0000000 1b694810 00000600
02:00000000 c0000000 1b697010 00000600 00000000 c0000000 077c4810 00000600
03:00000000 c0000000 07e15010 00000600 00000000 c0000000 06e3e810 00000600
04:00000000 c0000000 1719e810 00000600 00000000 c0000000 1b69b810 00000600
05:00000000 c0000000 1b694010 00000600 00000000 c0000000 07741010 00000600
06:00000000 c0000000 065d8010 00000600 00000000 c0000000 07a84010 00000600
07:00000000 c0000000 13381810 00000600 010100a6 76040040 1f7c1010 00000600
eth0: dirty_tx=37 cur_tx=37
   PSize    status   addr     size     PSize    status   addr     size
00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
01 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
02 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
04 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
05 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
06 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
07 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
eth0: Rx status = 76040040
eth0: Rx PSize = 010100a6
sk_buff[0]->tail = ffff81001f7c1010
eth0: Rx status = c0000000
eth0: status = 0000000c
eth0: status = 0000000c
eth0: status = 0000000c
eth0: status = 2000000c
eth0: status = 2000000c
eth0: status = 2000000c
eth0: status = 2000000c
eth0: status = 2000000c
eth0: status = 2000000c
eth0: status = 2000000c
eth0: status = 2000000c
[...]



No more traces about RxDescRing after that, as
status & (RxQInt) was always 0 in sis190_interrupt().




# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet addr:10.169.21.20  Bcast:10.169.23.255  Mask:255.255.252.0
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0
          TX packets:87 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4833 (4.7 KiB)  TX bytes:7364 (7.1 KiB)
          Interrupt:11 Base address:0xdead



After that, i made various tries (most of them stupids).


I noticed that whith the default packet size, ping could work 
as long as i wanted.


So i removed the test "if (pkt_size < rx_copybreak) {" in sis190_try_rx_copy().


The driver now works "correctly" (ping, ssh, scp) as long as i want,
but probably not in the way you want...


I don't understand how the Rx packets are managed when  pkt_size is
greater than rx_copybreak...


I also tried to force 10H, 10F, 100H, 100F autoneg off on the other card.
All modes were working, but obviously something was wrong :
- 10H  0,4Mo/s both directions
- 10F  1,2Mo/s  "     "
- 100H   5Mo/s  "     "
- 100F 1,2Mo/s and 0,3Mo/s 

For 100F, sis190 reported "100 Mbps Half Duplex" and the other card 100 Full.

Autoneg on gived 100 Full detected and 5Mo/s both directions...




# diff -puN sis190-20050616.c sis190.c
--- sis190-20050616.c   2005-06-17 11:56:46.000000000 +0200
+++ sis190.c    2005-06-17 12:59:08.000000000 +0200
@@ -450,7 +450,6 @@ static inline int sis190_try_rx_copy(str
 {
        int ret = -1;

-       if (pkt_size < rx_copybreak) {
                struct sk_buff *skb;

                skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN);
@@ -463,7 +462,6 @@ static inline int sis190_try_rx_copy(str
                        sis190_give_to_asic(desc, rx_buf_sz);
                        ret = 0;
                }
-       }
        return ret;
 }

@@ -637,7 +635,8 @@ static irqreturn_t sis190_interrupt(int

                SIS_W32(IntrStatus, status);

-               printk(KERN_INFO "%s: status = %08x\n", dev->name, status);
+               if ( status != 0x20000000)
+                 printk(KERN_INFO "%s: status = %08x\n", dev->name, status);

                if ((status & LinkChange) && netif_running(dev)) {
                        printk(KERN_INFO "%s: link change\n", dev->name);
@@ -647,8 +646,8 @@ static irqreturn_t sis190_interrupt(int
                if ((status & (TxQ0Int | RxQInt)) == 0)
                        break;

-               if (status & (RxQInt))
-                       sis190_rx_interrupt(dev, tp, ioaddr);
+               if (status & (RxQInt))
+                       sis190_rx_interrupt(dev, tp, ioaddr);

                if (status & (TxQ0Int)) {
                        spin_lock(&tp->lock);
@@ -845,7 +844,7 @@ static void sis190_phy_task(void * data)
                val = mdio_read(ioaddr, MII_LPA);
                printk(KERN_INFO "%s: mii lpa = %04x.\n", dev->name, val);
                for (p = reg31; p->ctl; p++) {
-                       if (val & p->val)
+                 if ((val & p->val) == p->val)
                                break;
                }
                if (p->ctl)
@@ -1233,31 +1232,11 @@ static void sis190_get_drvinfo(struct ne
                               struct ethtool_drvinfo *info)
 {
        struct sis190_private *tp = netdev_priv(dev);
-       unsigned int i;
-       u32 *u;

        strcpy(info->driver, DRV_NAME);
        strcpy(info->version, DRV_VERSION);
        strcpy(info->bus_info, pci_name(tp->pci_dev));

-       printk(KERN_INFO "%s: dirty_rx=%ld cur_rx=%ld\n",
-              dev->name, tp->dirty_rx, tp->cur_rx);
-       u = (void *) tp->RxDescRing;
-       printk(KERN_INFO "   PSize    status   addr     size     PSize    status   addr     size\n");
-       for (i = 0; i < (NUM_RX_DESC / 2); i++) {
-               printk(KERN_INFO "%02d:%08x %08x %08x %08x %08x %08x %08x %08x\n",
-                      i, u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]);
-               u += 8;
-       }
-       printk(KERN_INFO "%s: dirty_tx=%ld cur_tx=%ld\n",
-              dev->name, tp->dirty_tx, tp->cur_tx);
-       u = (void *) tp->TxDescRing;
-       printk(KERN_INFO "   PSize    status   addr     size     PSize    status   addr     size\n");
-       for (i = 0; i < (NUM_TX_DESC / 2); i++) {
-               printk(KERN_INFO "%02d %08x %08x %08x %08x %08x %08x %08x %08x\n",
-                      i, u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]);
-               u += 8;
-       }
 }

 static struct ethtool_ops sis190_ethtool_ops = {
@@ -1311,6 +1290,7 @@ static int __devinit sis190_init_one(str
        dev->open = sis190_open;
        dev->hard_start_xmit = sis190_start_xmit;
        dev->get_stats = sis190_get_stats;
+       SET_ETHTOOL_OPS(dev, &sis190_ethtool_ops);
        dev->stop = sis190_close;
        dev->tx_timeout = sis190_tx_timeout;
        dev->set_multicast_list = sis190_set_rx_mode;



Regards
Pascal


^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-06-15 15:22 Pascal CHAPPERON
  2005-06-16 22:34 ` sis190 Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-06-15 15:22 UTC (permalink / raw)
  To: Francois Romieu; +Cc: Andrew Hutchings, linux-kernel, vinay kumar, jgarzik

> Message du 14/06/05 22:06
> De : "Francois Romieu" <romieu@fr.zoreil.com>

> The patch of the day uses a 4 bytes aligned Rx buffer address (at least for
> the usual MTU) and copies the Rx data. Can you reproduce the usual testing
> and tell if it makes a difference ?
> 
> Patch available at:
> http://www.fr.zoreil.com/people/francois/misc/20050614-2.6.12-rc-sis190-test.patch
> 
> --
> Ueimor
> 

# cat /var/log/messages
[...]
Jun 15 15:24:37 local kernel: sis190 Gigabit Ethernet driver 1.2 loaded
Jun 15 15:24:37 local kernel: ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
Jun 15 15:24:37 local kernel: 0000:00:04.0: sis190 at ffffc20000004c00 (IRQ: 11), 00:11:2f:e9:42:70
Jun 15 15:24:37 local kernel: eth0: Enabling Auto-negotiation.
Jun 15 15:24:37 local kernel: eth0: status = 63000000
Jun 15 15:24:37 local kernel: eth0: status = 20000000
Jun 15 15:24:38 local last message repeated 109 times
Jun 15 15:24:38 local kernel: eth0: status = 22000000
Jun 15 15:24:39 local kernel: eth0: status = 20000000
Jun 15 15:24:39 local last message repeated 48 times
Jun 15 15:24:39 local network: Bringing up interface eth0:  succeeded
Jun 15 15:24:39 local kernel: eth0: status = 20000000
Jun 15 15:24:47 local last message repeated 606 times
Jun 15 15:24:47 local kernel: eth0: mii 0x1f = 0000.
Jun 15 15:24:47 local kernel: eth0: mii lpa = 45e1.
Jun 15 15:24:47 local kernel: eth0: Link on 1000 Mbps Full Duplex mode.
Jun 15 15:24:47 local kernel: eth0: status = 20000000
Jun 15 15:25:18 local last message repeated 2361 times
[...]
Jun 15 15:26:56 local kernel: eth0: Rx status = 400c0040
Jun 15 15:26:56 local kernel: eth0: Rx PSize = 01010040
Jun 15 15:26:56 local kernel: sk_buff[0]->tail = ffff81001f2bd814
Jun 15 15:26:56 local kernel: eth0: Rx status = c0000000
[...]
Jun 15 15:26:57 local kernel: eth0: Rx status = 400c0040
Jun 15 15:26:57 local kernel: eth0: Rx PSize = 01010040
Jun 15 15:26:57 local kernel: sk_buff[0]->tail = ffff81001ef4c014
Jun 15 15:26:57 local kernel: eth0: Rx status = c0000000
[...]

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet addr:10.169.21.20  Bcast:10.169.23.255  Mask:255.255.252.0
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:11 Base address:0xdead

# ping -c 1 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 56(84) bytes of data.
>From 10.169.21.20 icmp_seq=0 Destination Host Unreachable

--- 10.169.21.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

#tcpdump -enx [local]
15:30:56.690828 00:11:2f:e9:42:70 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
15:30:56.691065 48:6e:08:06:00:01 > 42:70:00:30:4f:06, ethertype IPv4 (0x0800), length 60: IP0 bad-len 2
        0x0000:  0604 0002 0030 4f06 486e 0aa9 1501 0011  .....0O.Hn......
        0x0010:  2fe9 4270 0aa9 1514 0000 0000 0000 0000  /.Bp............
        0x0020:  0000 0000 0000 0000 0000 0c15 4f3d       ............O=
15:30:57.690671 00:11:2f:e9:42:70 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
15:30:57.690840 48:6e:08:06:00:01 > 42:70:00:30:4f:06, ethertype IPv4 (0x0800), length 60: IP0 bad-len 2
        0x0000:  0604 0002 0030 4f06 486e 0aa9 1501 0011  .....0O.Hn......
        0x0010:  2fe9 4270 0aa9 1514 0000 0000 0000 0000  /.Bp............
        0x0020:  0000 0000 0000 0000 0000 0c15 4f3d       ............O=
15:30:58.690519 00:11:2f:e9:42:70 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
15:30:58.690691 48:6e:08:06:00:01 > 42:70:00:30:4f:06, ethertype IPv4 (0x0800), length 60: IP0 bad-len 2
        0x0000:  0604 0002 0030 4f06 486e 0aa9 1501 0011  .....0O.Hn......
        0x0010:  2fe9 4270 0aa9 1514 0000 0000 0000 0000  /.Bp............
        0x0020:  0000 0000 0000 0000 0000 0c15 4f3d       ............O=

# ping -c 1 -s 250 10.169.21.1
PING 10.169.21.1 (10.169.21.1) 250(278) bytes of data.
>From 10.169.21.20 icmp_seq=0 Destination Host Unreachable


--- 10.169.21.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

#tcpdump -enx [local]
15:32:44.705404 00:11:2f:e9:42:70 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
15:32:44.705641 48:6e:08:06:00:01 > 42:70:00:30:4f:06, ethertype IPv4 (0x0800), length 60: IP0 bad-len 2
        0x0000:  0604 0002 0030 4f06 486e 0aa9 1501 0011  .....0O.Hn......
        0x0010:  2fe9 4270 0aa9 1514 0000 0000 0000 0000  /.Bp............
        0x0020:  0000 0000 0000 0000 0000 0c15 4f3d       ............O=
15:32:45.705250 00:11:2f:e9:42:70 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
15:32:45.705442 48:6e:08:06:00:01 > 42:70:00:30:4f:06, ethertype IPv4 (0x0800), length 60: IP0 bad-len 2
        0x0000:  0604 0002 0030 4f06 486e 0aa9 1501 0011  .....0O.Hn......
        0x0010:  2fe9 4270 0aa9 1514 0000 0000 0000 0000  /.Bp............
        0x0020:  0000 0000 0000 0000 0000 0c15 4f3d       ............O=
15:32:46.705098 00:11:2f:e9:42:70 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
15:32:46.705325 48:6e:08:06:00:01 > 42:70:00:30:4f:06, ethertype IPv4 (0x0800), length 60: IP0 bad-len 2
        0x0000:  0604 0002 0030 4f06 486e 0aa9 1501 0011  .....0O.Hn......
        0x0010:  2fe9 4270 0aa9 1514 0000 0000 0000 0000  /.Bp............
        0x0020:  0000 0000 0000 0000 0000 0c15 4f3d       ............O=


# i tried to remove NET_IP_ALIGN :
# diff -puN sis190-20050614.c sis190.c
--- sis190-20050614.c   2005-06-15 16:39:08.000000000 +0200
+++ sis190.c    2005-06-15 16:41:28.000000000 +0200
@@ -405,11 +405,10 @@ static int sis190_alloc_rx_skb(struct pc
         * To be verified: the asic only DMA to a four bytes aligned address
         * -> the usual NET_IP_ALIGN margin must be increased by a 2x factor.
         */
-       skb = dev_alloc_skb(rx_buf_sz + 2*NET_IP_ALIGN);
+       skb = dev_alloc_skb(rx_buf_sz);
        if (!skb)
                goto err_out;

-       skb_reserve(skb, 2*NET_IP_ALIGN);
        *sk_buff = skb;

        mapping = pci_map_single(pdev, skb->tail, rx_buf_sz,
@@ -456,10 +455,8 @@ static inline int sis190_try_rx_copy(str

        if (pkt_size < rx_copybreak) {
                struct sk_buff *skb;
-
-               skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN);
+               skb = dev_alloc_skb(pkt_size);
                if (skb) {
-                       skb_reserve(skb, NET_IP_ALIGN);
                        printk(KERN_INFO "sk_buff[0]->tail = %p\n",
                               sk_buff[0]->tail);
                        eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0);
@@ -468,9 +465,6 @@ static inline int sis190_try_rx_copy(str
                        ret = 0;
                }
        }
-       /* Fix the IP align issue by hand. */
-       if (ret < 0)
-               sis190_align(sk_buff[0], pkt_size);
        return ret;
 }

 
It seemed to work :  ping, ping -s 1400, ping -s 10000.
I  could even connect (a short time) on the server via ssh and work on it.
But :
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet addr:10.169.21.20  Bcast:10.169.23.255  Mask:255.255.252.0
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:128 errors:0 dropped:0 overruns:0 frame:0
          TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:158305 (154.5 KiB)  TX bytes:7834 (7.6 KiB)
          Interrupt:11 Base address:0xdead

Everything failed after 128 packets were received.

I tried to increase NUM_RX_DESC from 64 to 256 :
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet addr:10.169.21.20  Bcast:10.169.23.255  Mask:255.255.252.0
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:512 errors:0 dropped:0 overruns:0 frame:0
          TX packets:271 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:709097 (692.4 KiB)  TX bytes:20284 (19.8 KiB)
          Interrupt:11 Base address:0xdead

Only 512 packets were received...

Nothing special in syslog after the failure, and tcpdump reported only Tx packets :
16:18:30.891922 00:11:2f:e9:42:70 > Broadcast, ethertype ARP (0x0806), length 42: arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............


I got a serious headache as i tried to understand how the RX ring works.
But it is quite too difficult for me now.

Regards
Pascal




^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-06-13  8:19 Pascal CHAPPERON
  2005-06-13 21:39 ` sis190 Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-06-13  8:19 UTC (permalink / raw)
  To: Francois Romieu; +Cc: Andrew Hutchings, linux-kernel, vinay kumar, jgarzik

> Message du 11/06/05 12:58
> De : "Francois Romieu" <romieu@fr.zoreil.com>
> Can you reproduce the tests (dhcp/no dhcp) with the patch linked below and
> add a tcpdump -x output taken at the server as an addition to the usual
> information ?
> 
> http://www.fr.zoreil.com/people/francois/misc/20050611a-2.6.12-rc-sis190-test.patch
> 
> If you are in a hurry and have any output, I'll look at it today (~18h).
> 
> Thanks.
> 
> --
> Ueimor
> 
> 
No, i am not in hurry, and many thanks for working on this driver.

The results :
# cat /var/log/messages
Jun 13 09:04:27 local kernel: sis190 Gigabit Ethernet driver 1.2 loaded
Jun 13 09:04:27 local kernel: ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11
Jun 13 09:04:27 local kernel: ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LNKD] -> GSI 11 (level, low) -> IRQ 11
Jun 13 09:04:27 local kernel: 0000:00:04.0: sis190 at ffffc20000004c00 (IRQ: 11), 00:11:2f:e9:42:70
Jun 13 09:04:27 local kernel: eth0: Enabling Auto-negotiation.
Jun 13 09:04:27 local kernel: eth0: status = 20000000
Jun 13 09:04:29 local last message repeated 155 times
Jun 13 09:04:29 local kernel: eth0: status = 20010000
Jun 13 09:04:29 local kernel: eth0: link change
Jun 13 09:04:29 local kernel: eth0: Link on unknown mode.
Jun 13 09:04:29 local kernel: eth0: status = 20000000
Jun 13 09:04:29 local last message repeated 4 times
Jun 13 09:04:29 local network: Bringing up interface eth0:  succeeded
Jun 13 09:04:29 local kernel: eth0: status = 20000000
Jun 13 09:04:31 local last message repeated 147 times
Jun 13 09:04:31 local kernel: eth0: status = 2000000c
Jun 13 09:04:31 local kernel: eth0: status = 20000000
...
Jun 13 09:05:02 local kernel: eth0: Rx status = 40040040
Jun 13 09:05:02 local kernel: eth0: Rx PSize = 01010040
Jun 13 09:05:02 local kernel: eth0: Rx status = c0000000
Jun 13 09:05:03 local kernel: eth0: Rx status = 40040040
Jun 13 09:05:03 local kernel: eth0: Rx PSize = 01010040
Jun 13 09:05:03 local kernel: eth0: Rx status = c0000000
Jun 13 09:05:04 local kernel: eth0: Rx status = 40040040
Jun 13 09:05:04 local kernel: eth0: Rx PSize = 01010040
Jun 13 09:05:04 local kernel: eth0: Rx status = c0000000
Jun 13 09:05:05 local kernel: eth0: Rx status = 40040040
Jun 13 09:05:05 local kernel: eth0: Rx PSize = 01010040
Jun 13 09:05:05 local kernel: eth0: Rx status = c0000000
Jun 13 09:05:06 local kernel: eth0: Rx status = 40040040
Jun 13 09:05:06 local kernel: eth0: Rx PSize = 01010040
Jun 13 09:05:06 local kernel: eth0: Rx status = c0000000
Jun 13 09:05:07 local kernel: eth0: Rx status = 40040040
Jun 13 09:05:07 local kernel: eth0: Rx PSize = 01010040
Jun 13 09:05:07 local kernel: eth0: Rx status = c0000000
...

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet addr:10.169.21.20  Bcast:10.169.23.255  Mask:255.255.252.0
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:141 errors:0 dropped:0 overruns:0 frame:0
          TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8460 (8.2 KiB)  TX bytes:6104 (5.9 KiB)
          Interrupt:11 Base address:0xbeef

NOTE : here is something strange about base address =>
dmesg :  sis190 at ffffc20000004c00 (IRQ: 11)
ifconfig :          Interrupt:11 Base address:0xbeef

# local tcpdump  : ping server 10.169.21.1 from local 10.169.21.20
09:09:41.798748 arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
09:09:41.798920 4f:06:48:6e:08:06 null > 2f:e9:42:70:00:30 sap 08 I (s=3,r=2,C) len=42
        0x0000:  0800 0604 0002 0030 4f06 486e 0aa9 1501  .......0O.Hn....
        0x0010:  0011 2fe9 4270 0aa9 1514 0000 0000 0000  ../.Bp..........
        0x0020:  0000 0000 0000 0000 0000 0000 0c15       ..............
09:09:42.798592 arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501            ............
09:09:42.798767 4f:06:48:6e:08:06 null > 2f:e9:42:70:00:30 sap 08 I (s=3,r=2,C) len=42
        0x0000:  0800 0604 0002 0030 4f06 486e 0aa9 1501  .......0O.Hn....
        0x0010:  0011 2fe9 4270 0aa9 1514 0000 0000 0000  ../.Bp..........
        0x0020:  0000 0000 0000 0000 0000 0000 0c15       ..............
...

# server tcpdump  : ping server 10.169.21.1 from local 10.169.21.20
09:27:40.749713 arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501 0000 0000  ................
        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............
09:27:40.749797 arp reply 10.169.21.1 is-at 00:30:4f:06:48:6e
        0x0000:  0001 0800 0604 0002 0030 4f06 486e 0aa9  .........0O.Hn..
        0x0010:  1501 0011 2fe9 4270 0aa9 1514            ..../.Bp....
09:27:41.749522 arp who-has 10.169.21.1 tell 10.169.21.20
        0x0000:  0001 0800 0604 0001 0011 2fe9 4270 0aa9  ........../.Bp..
        0x0010:  1514 0000 0000 0000 0aa9 1501 0000 0000  ................
        0x0020:  0000 0000 0000 0000 0000 0000 0000       ..............
09:27:41.749605 arp reply 10.169.21.1 is-at 00:30:4f:06:48:6e
        0x0000:  0001 0800 0604 0002 0030 4f06 486e 0aa9  .........0O.Hn..
        0x0010:  1501 0011 2fe9 4270 0aa9 1514            ..../.Bp....

It seems that sis190 driver shifts 4 bytes...


further test about autoneg, probably silly:
be nice, as i know nothing to network drivers dev.
i do not understand what is LPA_SLCT...

modification :
# diff -puN sis190-20050611a.c sis190.c
--- sis190-20050611a.c  2005-06-13 08:54:56.000000000 +0200
+++ sis190.c    2005-06-13 09:41:29.000000000 +0200
@@ -630,7 +630,7 @@ static irqreturn_t sis190_interrupt(int

                SIS_W32(IntrStatus, status);

-               printk(KERN_INFO "%s: status = %08x\n", dev->name, status);
+               // printk(KERN_INFO "%s: status = %08x\n", dev->name, status);

                if ((status & LinkChange) && netif_running(dev)) {
                        printk(KERN_INFO "%s: link change\n", dev->name);
@@ -823,18 +823,17 @@ static void sis190_phy_task(void * data)
                        u16 ctl;
                        const char *msg;
                } reg31[] = {
-                       { _1000bpsF,    0x1c01, "1000 bps Full Duplex" },
-                       { _1000bpsH,    0x0c01, "1000 bps Half Duplex" },
-                       { _100bpsF,     0x1801, "100 bps Full Duplex" },
-                       { _100bpsH,     0x0801, "100 bps Half Duplex" },
-                       { _10bpsF,      0x1401, "10 bps Full Duplex" },
-                       { _10bpsH,      0x0401, "10 bps Half Duplex" },
+                       { LPA_1000XFULL | LPA_SLCT,  0x1c01, "1000 bps Full Duplex" },
+                       { LPA_1000XHALF | LPA_SLCT,  0x0c01, "1000 bps Half Duplex" },
+                       { LPA_100FULL,  0x1801, "100 bps Full Duplex" },
+                       { LPA_100HALF,  0x0901, "100 bps Half Duplex" },
+                       { LPA_10FULL,   0x1401, "10 bps Full Duplex" },
+                       { LPA_10HALF,   0x0401, "10 bps Half Duplex" },
                        { 0,            0x0000, "unknown" }
                }, *p;
-               val = mdio_read(ioaddr, LPA_SLCT) & 0x1c; // bit 4:2
-
+               val = mdio_read(ioaddr, MII_LPA);
                for (p = reg31; p->ctl; p++) {
-                       if (val == p->val)
+                 if ((val &  p->val) == p->val)
                                break;
                }
                if (p->ctl)

# dmesg
...
[  remote card forced in 10 half autoneg off ]
...
sis190 Gigabit Ethernet driver 1.2 loaded
ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LNKD] -> GSI 11 (level, low) ->
IRQ 11
PCI: Setting latency timer of device 0000:00:04.0 to 64
0000:00:04.0: sis190 at ffffc20000004c00 (IRQ: 11), 00:11:2f:e9:42:70
eth0: Enabling Auto-negotiation.
eth0: Link on 10 bps Half Duplex mode.
eth0: no IPv6 routers present
...
[ remote card in 10 full autoneg off ]
[ I must restart the network to have (false) mode detection ]
...
eth0: Link on 10 bps Half Duplex mode.
eth0: Link on 10 bps Half Duplex mode.
...
[ remote card in 100 full autoneg on ]
[ no network restart ]
...
eth0: no IPv6 routers present
eth0: link change
eth0: PHY reset until link up
eth0: link change
eth0: Link on 100 bps Full Duplex mode.
eth0: Link on 100 bps Full Duplex mode.
...


Regards
Pascal


^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: sis190
@ 2005-06-11  9:39 Pascal CHAPPERON
  2005-06-11 10:56 ` sis190 Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Pascal CHAPPERON @ 2005-06-11  9:39 UTC (permalink / raw)
  To: Francois Romieu, Andrew Hutchings; +Cc: linux-kernel, vinay kumar, jgarzik

> Message du 11/06/05 01:46
> De : "Francois Romieu" <romieu@fr.zoreil.com>
> 
> Andrew Hutchings <info@a-wing.co.uk> :
> [...]
> > Something went wrong on build.  Getting 'syntax error before '}' token' 
> > on every line there is _msleep(1);
> 
> I have checked it again and the patch applies and compiles correctly
> against 2.6.12-rc6. So does the updated patch of the day:
> 
> http://www.fr.zoreil.com/people/francois/misc/20050611-2.6.12-rc-sis190-test.patch

Sorry, but it does not compile correctly if you define CONFIG_SIS190_NO_DELAY.
# diff -puN /usr/src/linux/drivers/net/sis190.c sis190.c
--- /usr/src/linux/drivers/net/sis190.c 2005-06-11 09:16:41.000000000 +0200
+++ sis190.c    2005-06-11 10:20:01.000000000 +0200
@@ -43,8 +43,8 @@
 #endif

 #ifdef CONFIG_SIS190_NO_DELAY
-#define s_mdelay(d)    do { (d) } while (0)
-#define s_msleep(d)    do { (d) } while (0)
+#define s_mdelay(d)    do {  } while (0)
+#define s_msleep(d)    do {  } while (0)
 #else
 #define s_mdelay(d)    mdelay(d)
 #define s_msleep(d)    msleep(d)

So it works.

> 
> No need to use SIS190_NO_DELAY so far. The media negotiation process has
> been changed. It is now allowed to take longer to complete (it should help).
> 
> dmesg and ifconfig output will be welcome.
> 
> --
> Ueimor
> 
> 
It still do not work :
#dmesg
...
sis190 Gigabit Ethernet driver 1.2 loaded
ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LNKD] -> GSI 10 (level, low) -> IRQ  10
PCI: Setting latency timer of device 0000:00:04.0 to 64
0000:00:04.0: sis190 at ffffc20000026c00 (IRQ: 10), 00:11:2f:e9:42:70
eth0: Enabling Auto-negotiation.
eth0: Link on unknown mode.
eth0: no IPv6 routers present
eth0: status = 20000008
eth0: status = 00000004
eth0: status = 20000008
eth0: status = 00000004
eth0: pad error. status = 00000000
eth0: pad error. status = 00000000
eth0: pad error. status = 00000000
eth0: pad error. status = 00000000
...

#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:248 dropped:0 overruns:0 frame:248
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:762 (762.0 b)  TX bytes:1404 (1.3 KiB)
          Interrupt:10 Base address:0xbeef


I compared sis190_rx_interrupt() in old and new driver, and i tried :
 diff -puN /usr/src/linux/drivers/net/sis190.c sis190.c
--- /usr/src/linux/drivers/net/sis190.c 2005-06-11 09:16:41.000000000 +0200
+++ sis190.c    2005-06-11 10:20:01.000000000 +0200
@@ -478,7 +478,7 @@ static int sis190_rx_interrupt(struct ne
                rmb();
                status = le32_to_cpu(desc->PSize);

-               if (status & OWNbit)
+               if (desc->status & OWNbit)
                        break;

                if (status & RxCRC) {

new test :
# dmesg
...
sis190 Gigabit Ethernet driver 1.2 loaded
ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LNKD] -> GSI 10 (level, low) -> IRQ  10
PCI: Setting latency timer of device 0000:00:04.0 to 64
0000:00:04.0: sis190 at ffffc20000026c00 (IRQ: 10), 00:11:2f:e9:42:70
eth0: Enabling Auto-negotiation.
eth0: Link on unknown mode.
eth0: no IPv6 routers present
eth0: status = 22000008
eth0: status = 00000004
eth0: status = 20000008
eth0: status = 00000004
eth0: status = 20000040
eth0: status = 20000040
eth0: status = 20000040
eth0: status = 20000040
eth0: status = 20000008
eth0: status = 00000004
...

#ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1206 (1.1 KiB)  TX bytes:1026 (1.0 KiB)
          Interrupt:10 Base address:0xbeef

As you can see, no more RX errors, but the network script failed to establish the link.

On the other box (dhcp server) :
#dmesg
...
eth2: link down
eth2: link up, 100Mbps, full-duplex, lpa 0x41E0
DHCPREQUEST for 10.169.21.20 from 00:11:2f:e9:42:70 via eth2: unknown lease 10.169.21.20.
DHCPDISCOVER from 00:11:2f:e9:42:70 via eth2
DHCPOFFER on 10.169.21.47 to 00:11:2f:e9:42:70 via eth2
DHCPDISCOVER from 00:11:2f:e9:42:70 via eth2
DHCPOFFER on 10.169.21.47 to 00:11:2f:e9:42:70 via eth2
DHCPDISCOVER from 00:11:2f:e9:42:70 via eth2
DHCPOFFER on 10.169.21.47 to 00:11:2f:e9:42:70 via eth2
...

I also tried without dhcp :
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2F:E9:42:70
          inet addr:10.169.21.20  Bcast:10.169.23.255  Mask:255.255.252.0
          inet6 addr: fe80::211:2fff:fee9:4270/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:59 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4148 (4.0 KiB)  TX bytes:1806 (1.7 KiB)
          Interrupt:10 Base address:0xbeef

ping failed both sides, though RX and TX counters were incremented.


Regards
Pascal



^ permalink raw reply	[flat|nested] 27+ messages in thread
* sis5513.c patch
@ 2005-06-07 22:37 Andrew Hutchings
  2005-06-07 22:57 ` Francois Romieu
  0 siblings, 1 reply; 27+ messages in thread
From: Andrew Hutchings @ 2005-06-07 22:37 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

Hi,

I'm not sure if a similar patch has been submitted or not, but here is a 
patch to get DMA working on ASUS K8S-MX with a SiS 760GX/SiS 965L 
chipset combo.

I'm looking at trying to revive the old sis190.c net driver for this 
board too, this does depend on my boss giving me some development time.

Anyway, this is my first kernel patch so I hope it helps.

Regards
Andrew
-- 
Andrew Hutchings (A-Wing)
Linux Guru - Netserve Consultants Ltd. - http://www.domaincity.co.uk/
Admin - North Wales Linux User Group - http://www.nwlug.org.uk/
BOFH excuse 183: filesystem not big enough for Jumbo Kernel Patch

[-- Attachment #2: SiS5513.patch --]
[-- Type: text/x-patch, Size: 560 bytes --]

diff -u -r linux-2.6.11.11.orig/drivers/ide/pci/sis5513.c linux-2.6.11.11/drivers/ide/pci/sis5513.c
--- linux-2.6.11.11.orig/drivers/ide/pci/sis5513.c	2005-05-27 06:06:46.000000000 +0100
+++ linux-2.6.11.11/drivers/ide/pci/sis5513.c	2005-06-07 22:14:25.000000000 +0100
@@ -112,6 +112,7 @@
 	{ "SiS5596",	PCI_DEVICE_ID_SI_5596,	ATA_16   },
 	{ "SiS5571",	PCI_DEVICE_ID_SI_5571,	ATA_16   },
 	{ "SiS551x",	PCI_DEVICE_ID_SI_5511,	ATA_16   },
+	{ "SiS5513",	PCI_DEVICE_ID_SI_5513,	ATA_133	 },
 };
 
 /* Cycle time bits and values vary across chip dma capabilities

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2005-07-10 13:23 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-14 14:14 sis190 Pascal CHAPPERON
2005-06-14 20:04 ` sis190 Francois Romieu
  -- strict thread matches above, loose matches on Subject: below --
2005-07-10 13:23 sis190 Pascal CHAPPERON
2005-07-09 13:25 sis190 Pascal CHAPPERON
2005-07-09 20:57 ` sis190 Francois Romieu
2005-07-06 15:58 sis190 Pascal CHAPPERON
2005-07-06 21:29 ` sis190 Francois Romieu
2005-07-02 10:52 sis190 Pascal CHAPPERON
2005-07-02 11:33 ` sis190 Francois Romieu
2005-07-04 23:30 ` sis190 Francois Romieu
2005-06-26 12:39 sis190 Pascal CHAPPERON
2005-06-30 23:37 ` sis190 Francois Romieu
2005-06-19 10:17 sis190 Pascal CHAPPERON
2005-06-21 23:02 ` sis190 Francois Romieu
2005-06-17 11:14 sis190 Pascal CHAPPERON
2005-06-17 18:22 ` sis190 Francois Romieu
2005-06-15 15:22 sis190 Pascal CHAPPERON
2005-06-16 22:34 ` sis190 Francois Romieu
2005-06-13  8:19 sis190 Pascal CHAPPERON
2005-06-13 21:39 ` sis190 Francois Romieu
2005-06-11  9:39 sis190 Pascal CHAPPERON
2005-06-11 10:56 ` sis190 Francois Romieu
2005-06-07 22:37 sis5513.c patch Andrew Hutchings
2005-06-07 22:57 ` Francois Romieu
2005-06-07 23:20   ` Andrew Hutchings
2005-06-08 22:51     ` sis190 (was: Re: sis5513.c patch) Francois Romieu
2005-06-09  4:54       ` sis190 Andrew Hutchings
2005-06-09 12:02       ` sis190 Andrew Hutchings
2005-06-09 21:18         ` sis190 Francois Romieu
2005-06-10 13:55           ` sis190 Andrew Hutchings
2005-06-10 23:41             ` sis190 Francois Romieu

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).