From nobody@FreeBSD.org  Mon Aug 24 12:16:00 2009
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 7CBBD106568C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Aug 2009 12:16:00 +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 6C0D18FC1C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Aug 2009 12:16:00 +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 n7OCFxdG070991
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Aug 2009 12:15:59 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n7OCFxEd070990;
	Mon, 24 Aug 2009 12:15:59 GMT
	(envelope-from nobody)
Message-Id: <200908241215.n7OCFxEd070990@www.freebsd.org>
Date: Mon, 24 Aug 2009 12:15:59 GMT
From: Tom Mller-Kortkamp <tmueko@kommunity.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: truncated-ip - 2 bytes missing! on fxp(4)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138135
>Category:       kern
>Synopsis:       [fxp] truncated-ip - 2 bytes missing! on fxp(4) [regression]
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 24 12:20:01 UTC 2009
>Closed-Date:    Wed Nov 04 18:43:12 UTC 2009
>Last-Modified:  Wed Nov 04 18:43:12 UTC 2009
>Originator:     Tom Mller-Kortkamp
>Release:        RELENG_7_2 RELENG_7
>Organization:
kommunity GmbH & Co. KG
>Environment:
FreeBSD  7.2-STABLE FreeBSD 7.2-STABLE #0: Mon Aug 24 12:17:25 CEST 2009     root@baal2.kommunity.net:/usr/obj/nanobsd.nexgate/usr/src/sys/nexgate  i3
86
>Description:
I tested with GENERIC kernel also. I tested with nanoBSD (FreeBSD-7.2-p) and STABLE:

Hardware ist a Nexgate-NSA 1080 with 8x10/100 Ethernet fxp(4).

fxp0 is working ((82559ER)
fxp1 through fxp7 is NOT working(8255xER/IT)

tcpdump: listening on fxp3, link-type EN10MB (Ethernet), capture size 65535 bytes
13:58:05.210380 IP truncated-ip - 2 bytes missing! (tos 0x0, ttl 64, id 1528, offset 0, flags [none], proto ICMP (1), length 84) 192.168.0.236 > 192.1
68.0.4: ICMP echo request, id 31279, seq 0, length 64
        0x0000:  4500 0054 05f8 0000 4001 f270 c0a8 00ec  E..T....@..p....
        0x0010:  c0a8 0004 0800 408d 7a2f 0000 c180 924a  ......@.z/.....J
        0x0020:  f374 0b00 0809 0a0b 0c0d 0e0f 1011 1213  .t..............
        0x0030:  1415 1617 1819 1a1b 1c1d 1e1f 2021 2223  .............!"#
        0x0040:  2425 2627 2829 2a2b 2c2d 2e2f 3031 3233  $%&'()*+,-./0123
        0x0050:  3435                                     45

fxp0@pci0:1:8:0:        class=0x020000 card=0x30118086 chip=0x24498086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82559ER Integrated 10Base-T/100Base-TX Ethernet Controller (82559ER)'
    class      = network
    subclass   = ethernet

fxp6@pci0:1:14:0:       class=0x020000 card=0x000c8086 chip=0x12098086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Fast Ethernet Controller (8255xER/IT)'
    class      = network
    subclass   = ethernet

>How-To-Repeat:

>Fix:
Downgrade to RELENG_6

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Aug 24 12:21:54 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138135 
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Mon Aug 24 18:20:03 UTC 2009 
State-Changed-Why:  
The pciconf(8) looks wrong to me. According to the chipid your fxp0 
interface is "Intel 82801BA/CAM (ICH2/3) Pro/100 Ethernet" and 
fxp[1-7] is "Intel 82559ER Embedded 10/100 Ethernet". Since these 
controllers have no TSO/Tx checksum offload support I guess it could 
be related with other parts of kernel. By chance are you using some 
firewall in your box(pf/ipf/ipfw)? 
Also would you let me know the last known working release? 


Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Mon Aug 24 18:20:03 UTC 2009 
Responsible-Changed-Why:  
Grab. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/138135: commit references a PR
Date: Mon, 28 Sep 2009 19:40:36 +0000 (UTC)

 Author: yongari
 Date: Mon Sep 28 19:40:16 2009
 New Revision: 197586
 URL: http://svn.freebsd.org/changeset/base/197586
 
 Log:
   It seems some 82559ER controllers do not support Rx checksum
   offloading. Datasheet said nothing about the limitation of 82559ER
   except WOL. Explicitly disable Rx checksum offloading for
   controllers that is known to lack the capability.
   
   PR:	kern/138135
   Tested by:	Gooderum, Mark < mgooderum <> websense dot com >
 
 Modified:
   head/sys/dev/fxp/if_fxp.c
 
 Modified: head/sys/dev/fxp/if_fxp.c
 ==============================================================================
 --- head/sys/dev/fxp/if_fxp.c	Mon Sep 28 19:33:52 2009	(r197585)
 +++ head/sys/dev/fxp/if_fxp.c	Mon Sep 28 19:40:16 2009	(r197586)
 @@ -631,8 +631,11 @@ fxp_attach(device_t dev)
  	}
  
  	/* For 82559 or later chips, Rx checksum offload is supported. */
 -	if (sc->revision >= FXP_REV_82559_A0)
 -		sc->flags |= FXP_FLAG_82559_RXCSUM;
 +	if (sc->revision >= FXP_REV_82559_A0) {
 +		/* 82559ER does not support Rx checksum offloading. */
 +		if (sc->ident->devid != 0x1209)
 +			sc->flags |= FXP_FLAG_82559_RXCSUM;
 +	}
  	/*
  	 * Enable use of extended RFDs and TCBs for 82550
  	 * and later chips. Note: we need extended TXCB support
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: feedback->patched 
State-Changed-By: yongari 
State-Changed-When: Mon Sep 28 20:15:20 UTC 2009 
State-Changed-Why:  
Fix committed to HEAD(r197586). Another user confirmed the patch 
fixed the issue. Would you confirm that? 

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

From: Ondrej Pesta <ondrej.pesta@idc.cz>
To: bug-followup@FreeBSD.org, tmueko@kommunity.net
Cc:  
Subject: Re: kern/138135: [fxp] truncated-ip - 2 bytes missing! on fxp(4)
 [regression]
Date: Tue, 20 Oct 2009 15:30:10 +0200

 For me the patch doesn't work on RELENG_7_2.
 When I do buildworld, it fails with
 
 'struct fxp_softc' has no member named 'ident'
 
 -- 
 Ondrej Pesta
 
 

From: Pyun YongHyeon <pyunyh@gmail.com>
To: Ondrej Pesta <ondrej.pesta@idc.cz>
Cc: yongari@freebsd.org, bug-followup@FreeBSD.org
Subject: Re: kern/138135: [fxp] truncated-ip - 2 bytes missing! on fxp(4) [regression]
Date: Wed, 21 Oct 2009 15:23:13 -0700

 On Tue, Oct 20, 2009 at 01:50:04PM +0000, Ondrej Pesta wrote:
 > The following reply was made to PR kern/138135; it has been noted by GNATS.
 > 
 > From: Ondrej Pesta <ondrej.pesta@idc.cz>
 > To: bug-followup@FreeBSD.org, tmueko@kommunity.net
 > Cc:  
 > Subject: Re: kern/138135: [fxp] truncated-ip - 2 bytes missing! on fxp(4)
 >  [regression]
 > Date: Tue, 20 Oct 2009 15:30:10 +0200
 > 
 >  For me the patch doesn't work on RELENG_7_2.
 >  When I do buildworld, it fails with
 >  
 >  'struct fxp_softc' has no member named 'ident'
 
 I guess the latest fxp(4) may not build on RELENG_7_2 due to the
 changes of if_maddr_rlock()/if_maddr_runlock(). If you see the
 same issue of the PR, it could be fixed by disabling Rx checksum
 offloading like this.
 #ifconfig fxp0 -rxcsum
 Because the Rx checksum offloading logic might touch other area
 of controller it would be better to add "-rxcsum" to relevant 
 line of /etc/rc.conf file. 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/138135: commit references a PR
Date: Wed,  4 Nov 2009 18:31:52 +0000 (UTC)

 Author: yongari
 Date: Wed Nov  4 18:31:43 2009
 New Revision: 198919
 URL: http://svn.freebsd.org/changeset/base/198919
 
 Log:
   MFC r197586:
     It seems some 82559ER controllers do not support Rx checksum
     offloading. Datasheet said nothing about the limitation of 82559ER
     except WOL. Explicitly disable Rx checksum offloading for
     controllers that is known to lack the capability.
   
     PR:	kern/138135
     Tested by:	Gooderum, Mark < mgooderum <> websense dot com >
 
 Modified:
   stable/8/sys/dev/fxp/if_fxp.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/amd64/include/xen/   (props changed)
   stable/8/sys/cddl/contrib/opensolaris/   (props changed)
   stable/8/sys/contrib/dev/acpica/   (props changed)
   stable/8/sys/contrib/pf/   (props changed)
   stable/8/sys/dev/xen/xenpci/   (props changed)
 
 Modified: stable/8/sys/dev/fxp/if_fxp.c
 ==============================================================================
 --- stable/8/sys/dev/fxp/if_fxp.c	Wed Nov  4 18:22:59 2009	(r198918)
 +++ stable/8/sys/dev/fxp/if_fxp.c	Wed Nov  4 18:31:43 2009	(r198919)
 @@ -631,8 +631,11 @@ fxp_attach(device_t dev)
  	}
  
  	/* For 82559 or later chips, Rx checksum offload is supported. */
 -	if (sc->revision >= FXP_REV_82559_A0)
 -		sc->flags |= FXP_FLAG_82559_RXCSUM;
 +	if (sc->revision >= FXP_REV_82559_A0) {
 +		/* 82559ER does not support Rx checksum offloading. */
 +		if (sc->ident->devid != 0x1209)
 +			sc->flags |= FXP_FLAG_82559_RXCSUM;
 +	}
  	/*
  	 * Enable use of extended RFDs and TCBs for 82550
  	 * and later chips. Note: we need extended TXCB support
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/138135: commit references a PR
Date: Wed,  4 Nov 2009 18:34:23 +0000 (UTC)

 Author: yongari
 Date: Wed Nov  4 18:34:14 2009
 New Revision: 198920
 URL: http://svn.freebsd.org/changeset/base/198920
 
 Log:
   MFC r197586:
     It seems some 82559ER controllers do not support Rx checksum
     offloading. Datasheet said nothing about the limitation of 82559ER
     except WOL. Explicitly disable Rx checksum offloading for
     controllers that is known to lack the capability.
   
     PR:	kern/138135
     Tested by:	Gooderum, Mark < mgooderum <> websense dot com >
 
 Modified:
   stable/7/sys/dev/fxp/if_fxp.c
 Directory Properties:
   stable/7/sys/   (props changed)
   stable/7/sys/contrib/pf/   (props changed)
 
 Modified: stable/7/sys/dev/fxp/if_fxp.c
 ==============================================================================
 --- stable/7/sys/dev/fxp/if_fxp.c	Wed Nov  4 18:31:43 2009	(r198919)
 +++ stable/7/sys/dev/fxp/if_fxp.c	Wed Nov  4 18:34:14 2009	(r198920)
 @@ -632,8 +632,11 @@ fxp_attach(device_t dev)
  	}
  
  	/* For 82559 or later chips, Rx checksum offload is supported. */
 -	if (sc->revision >= FXP_REV_82559_A0)
 -		sc->flags |= FXP_FLAG_82559_RXCSUM;
 +	if (sc->revision >= FXP_REV_82559_A0) {
 +		/* 82559ER does not support Rx checksum offloading. */
 +		if (sc->ident->devid != 0x1209)
 +			sc->flags |= FXP_FLAG_82559_RXCSUM;
 +	}
  	/*
  	 * Enable use of extended RFDs and TCBs for 82550
  	 * and later chips. Note: we need extended TXCB support
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: yongari 
State-Changed-When: Wed Nov 4 18:42:47 UTC 2009 
State-Changed-Why:  
MFC to stable/8 and stable/7 done. 
Thank you very much for reporting. 

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