From nobody@FreeBSD.org  Thu May 11 02:37:13 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 07EF016A407
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 11 May 2006 02:37:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8B7E743D48
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 11 May 2006 02:37:12 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k4B2bCYR096165
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 11 May 2006 02:37:12 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k4B2bCuV096131;
	Thu, 11 May 2006 02:37:12 GMT
	(envelope-from nobody)
Message-Id: <200605110237.k4B2bCuV096131@www.freebsd.org>
Date: Thu, 11 May 2006 02:37:12 GMT
From: Joseph Terner <jtsn@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: sis(4): low TCP throughput and abnormal delays with manual media selection
X-Send-Pr-Version: www-2.3

>Number:         97116
>Category:       kern
>Synopsis:       [sis] low TCP throughput and abnormal delays with manual media selection
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 11 02:40:09 GMT 2006
>Closed-Date:    Sun Jun 11 20:10:44 GMT 2006
>Last-Modified:  Sun Jun 11 20:10:44 GMT 2006
>Originator:     Joseph Terner
>Release:        5.4-RELEASE
>Organization:
>Environment:
FreeBSD xylex 5.4-RELEASE-p1 FreeBSD 5.4-RELEASE-p1 #0: Wed May 18 02:50:23 CEST 2005     root@xylex:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
dmesg(8) output:
sis0: <SiS 900 10/100BaseTX> port 0xdc00-0xdcff mem 0xcfffd000-0xcfffdfff irq 10 at device 3.0 on pci0
miibus0: <MII bus> on sis0
rlphy0: <RTL8201L 10/100 media interface> on miibus0
rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto

Using manual media selection (100baseTX/FDX) causes TCP throughput to drop to about 1-5 MBit/s. There seems to be no packet-loss, but abnormal delays show up if the host is pinged during the TCP transfer:

PING 192.168.5.6 (192.168.5.6): 56 data bytes
64 bytes from 192.168.5.6: icmp_seq=0 ttl=64 time=0.174 ms
64 bytes from 192.168.5.6: icmp_seq=1 ttl=64 time=0.170 ms
64 bytes from 192.168.5.6: icmp_seq=2 ttl=64 time=0.195 ms
64 bytes from 192.168.5.6: icmp_seq=3 ttl=64 time=29.269 ms
64 bytes from 192.168.5.6: icmp_seq=4 ttl=64 time=0.164 ms
64 bytes from 192.168.5.6: icmp_seq=5 ttl=64 time=0.193 ms
64 bytes from 192.168.5.6: icmp_seq=6 ttl=64 time=629.664 ms
64 bytes from 192.168.5.6: icmp_seq=7 ttl=64 time=0.189 ms
64 bytes from 192.168.5.6: icmp_seq=8 ttl=64 time=0.168 ms
64 bytes from 192.168.5.6: icmp_seq=9 ttl=64 time=0.189 ms
64 bytes from 192.168.5.6: icmp_seq=10 ttl=64 time=709.360 ms
64 bytes from 192.168.5.6: icmp_seq=11 ttl=64 time=0.213 ms
64 bytes from 192.168.5.6: icmp_seq=12 ttl=64 time=0.192 ms
64 bytes from 192.168.5.6: icmp_seq=13 ttl=64 time=489.767 ms
64 bytes from 192.168.5.6: icmp_seq=14 ttl=64 time=989.519 ms
64 bytes from 192.168.5.6: icmp_seq=15 ttl=64 time=0.192 ms
64 bytes from 192.168.5.6: icmp_seq=16 ttl=64 time=0.193 ms
64 bytes from 192.168.5.6: icmp_seq=17 ttl=64 time=369.145 ms
64 bytes from 192.168.5.6: icmp_seq=18 ttl=64 time=449.103 ms
64 bytes from 192.168.5.6: icmp_seq=19 ttl=64 time=0.192 ms
64 bytes from 192.168.5.6: icmp_seq=20 ttl=64 time=718.485 ms
64 bytes from 192.168.5.6: icmp_seq=21 ttl=64 time=0.173 ms
64 bytes from 192.168.5.6: icmp_seq=22 ttl=64 time=0.198 ms
64 bytes from 192.168.5.6: icmp_seq=23 ttl=64 time=0.179 ms
64 bytes from 192.168.5.6: icmp_seq=24 ttl=64 time=0.196 ms
64 bytes from 192.168.5.6: icmp_seq=25 ttl=64 time=0.189 ms
64 bytes from 192.168.5.6: icmp_seq=26 ttl=64 time=809.865 ms
64 bytes from 192.168.5.6: icmp_seq=27 ttl=64 time=0.158 ms
64 bytes from 192.168.5.6: icmp_seq=28 ttl=64 time=1.640 ms
64 bytes from 192.168.5.6: icmp_seq=29 ttl=64 time=0.175 ms
64 bytes from 192.168.5.6: icmp_seq=30 ttl=64 time=219.603 ms
64 bytes from 192.168.5.6: icmp_seq=31 ttl=64 time=990.000 ms
64 bytes from 192.168.5.6: icmp_seq=32 ttl=64 time=0.299 ms
64 bytes from 192.168.5.6: icmp_seq=33 ttl=64 time=289.938 ms
^C
--- 192.168.5.6 ping statistics ---
34 packets transmitted, 34 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.158/197.040/990.000/317.248 ms

>How-To-Repeat:
Configure a sis(4)-Interface to use manual media selection:

# ifconfig sis0 media 100baseTX mediaopt full-duplex

Then do a TCP transfer using fetch(1) or something similar.

>Fix:
Use media autoselection:

# ifconfig sis0 media autoselect

>Release-Note:
>Audit-Trail:

From: Andrew Thompson <thompsa@freebsd.org>
To: Joseph Terner <jtsn@gmx.de>, bug-followup@freebsd.org
Cc:  
Subject: Re: kern/97116: sis(4): low TCP throughput and abnormal delays with manual media selection
Date: Thu, 11 May 2006 14:53:12 +1200

 This is most likely due to a duplex mismatch. If you set your card to a
 manual setting then you must ensure the other end is using exactly the
 same values. Unmanaged switches do not provide this ability and can
 usually only be used with auto.
 
 
 cheers,
 Andrew
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Sun Jun 11 20:07:50 UTC 2006 
State-Changed-Why:  
As Andrew says nothing wrong with FreeBSD here.  You need to have 
the same duplex setting on the both ends of the link.  Duplex mismatch 
leads to collisions and therefore to transfer throughput degradation. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97116 
>Unformatted:
