From nobody@FreeBSD.org  Fri Jun 18 23:27:01 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1A9B4106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jun 2010 23:27:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 09D1A8FC21
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jun 2010 23:27:01 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o5INR0fn013550
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Jun 2010 23:27:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o5INR0GT013549;
	Fri, 18 Jun 2010 23:27:00 GMT
	(envelope-from nobody)
Message-Id: <201006182327.o5INR0GT013549@www.freebsd.org>
Date: Fri, 18 Jun 2010 23:27:00 GMT
From: Tony J <freebsd@spam.t71.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: alc network driver + tso ( + vlan ? ) does not work. 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         147985
>Category:       kern
>Synopsis:       [alc] alc network driver + tso ( + vlan ? ) does not work.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 18 23:30:02 UTC 2010
>Closed-Date:    Mon Jan 17 18:57:49 UTC 2011
>Last-Modified:  Wed Dec  7 00:40:07 UTC 2011
>Originator:     Tony J
>Release:        8.1-PRERELEASE
>Organization:
>Environment:
FreeBSD xxxxx.client.convoitec.com 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #1: Fri Jun 18 13:14:06 EST 2010     root@xxxxx.client.convoitec.com:/usr/obj/usr/src/sys/GENERIC  amd64


>Description:
alc network driver + tso ( + vlan ? ) does not work. 

alc0: <Atheros AR8131 PCIe Gigabit Ethernet> port 0xec00-0xec7f mem 0xfebc0000-0xfebfffff irq 17 at device 0.0 on pci1
alc0: 15872 Tx FIFO, 15360 Rx FIFO
alc0: Using 1 MSI message(s).
miibus0: <MII bus> on alc0
alc0: Ethernet address: 90:e6:ba:f6:b6:c3
alc0: [FILTER]
alc0: link state changed to UP

Hello, I have a system using the ALC network card driver with vlans. By default the driver enables TSO4 support on the card. This support does not seem to work in this configuration and causes the OS to generate packets larger then MTU which are sent to the card to be fragmented. This doesn't seem to happen and the packets are dropped. This causes TCP connections to go extremely slowly as many re-transitions occur. ifconfig alc0 -tso fixes the problem.   

The problem may also occur without vlans however I have not tested this.
>How-To-Repeat:
/etc/rc.conf:
cloned_interfaces="vlan2 vlan3"
ifconfig_alc0="inet 192.168.1.1 netmask 255.255.255.0"
ifconfig_vlan2="inet 192.168.13.1 netmask 255.255.255.0 vlan 2 vlandev alc0"
ifconfig_vlan3="inet 192.168.14.1 netmask 255.255.255.0 vlan 3 vlandev alc0"
defaultrouter="192.168.14.254"

# scp largefile fred@remote.machine:/tmp/largefile 
.... goes very very slowly and stalls.

# ifconfig alc0 -tso
# scp largefile fred@remote.machine:/tmp/largefile 
.... proceeds normally.
>Fix:
Temporary fix is to disable tso on the interface:

/etc/rc.conf:

ifconfig_alc0="inet 192.168.1.1 netmask 255.255.255.0 -tso"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Jun 18 23:51:57 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147985 
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Mon Oct 25 18:32:39 UTC 2010 
State-Changed-Why:  
I can't reproduce this on my box with/without VLAN. I believe this 
is the first report that TSO issue on alc(4) and I have no idea how 
this can happen. The only vague guess I have at this moment is 
upper stack's TSO issue. r212803 fixed a TSO issue but it was not 
MFCed yet due to possible side-effects. 
http://svn.freebsd.org/viewvc/base/head/sys/netinet/tcp_output.c?r1=212765&r2=212803&view=patch 

Another thing to try is using alc(4) in stable/8. 
http://svn.freebsd.org/viewvc/base/stable/8/sys/dev/alc/if_alc.c 
http://svn.freebsd.org/viewvc/base/stable/8/sys/dev/alc/if_alcreg.h 
http://svn.freebsd.org/viewvc/base/stable/8/sys/dev/alc/if_alcvar.h 
I'm not sure whether it correctly builds on 8.1-RELEASE but mostly 
it would work. 


Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Mon Oct 25 18:32:39 UTC 2010 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147985 
State-Changed-From-To: feedback->closed 
State-Changed-By: yongari 
State-Changed-When: Mon Jan 17 18:57:25 UTC 2011 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147985 

From: Tony Jago <tony@hammertelecom.com.au>
To: bug-followup@FreeBSD.org, freebsd@spam.t71.org
Cc:  
Subject: Re: kern/147985: [alc] alc network driver + tso ( + vlan ? ) does
 not work.
Date: Wed, 07 Dec 2011 09:58:16 +1000

 I believe the root cause of the failure of the alc(4) driver to work 
 with the tso was my use of the pf(4) with "route-to" directive. This has 
 been documented not to work with other drivers and it would seem to 
 affect the alc driver as well. As noted, in the original bug report, the 
 solution is to switch off TSO and everything works fine. It seems that 
 pf and "route-to" are incompatible with TSO.
 
 Tony
 
 
>Unformatted:
