From nobody@FreeBSD.org  Sun Jan 13 16:28:29 2008
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 6172F16A417
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Jan 2008 16:28:29 +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 553C313C458
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Jan 2008 16:28:29 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m0DGRGjd098114
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 13 Jan 2008 16:27:16 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m0DGRGAV098112;
	Sun, 13 Jan 2008 16:27:16 GMT
	(envelope-from nobody)
Message-Id: <200801131627.m0DGRGAV098112@www.freebsd.org>
Date: Sun, 13 Jan 2008 16:27:16 GMT
From: Bernd Heller <bdheller@users.sourceforge.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Bad UDP packet checksum with em(4) and rxcsum/txcsum enabled
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         119635
>Category:       kern
>Synopsis:       [em] Bad UDP packet checksum with em(4) and rxcsum/txcsum enabled
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnn
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 13 16:30:01 UTC 2008
>Closed-Date:    Fri Jan 30 21:32:17 UTC 2009
>Last-Modified:  Fri Jan 30 21:32:17 UTC 2009
>Originator:     Bernd Heller
>Release:        7.0-RC1
>Organization:
>Environment:
FreeBSD 7.0-RC1 FreeBSD 7.0-RC1 #0: Mon Dec 24 10:10:07 UTC 2007     root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
I have an Intel Pro/1000 PT Desktop Adapter network card in that machine, and by default the em(4) driver has rxcsum/txcsum enabled.

But the checksums for some UDP packets generated this way are wrong. I noticed this when trying to run avahi-daemon. It sends UDP multicast packets, but they were never recognized on the network. Only when using tcpdump did I notice the bad checksums. After I disabled rxcsum/txcsum on the interface all was working perfectly.

I could reproduce the same issue in a VMware machine using FreeBSD 7.0-RC1 i386 and amd64. 6.2 seems to be unaffected.
>How-To-Repeat:
Run avahi-daemon to publish any services (it will do so by default) and analyze the UDP packages sent out.
>Fix:
Workaround: disable rxcsum/txcsum on the interface.



>Release-Note:
>Audit-Trail:

From: Kris Kennaway <kris@FreeBSD.org>
To: Bernd Heller <bdheller@users.sourceforge.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/119635: Bad UDP packet checksum with em(4) and rxcsum/txcsum
 enabled
Date: Sun, 13 Jan 2008 20:04:53 +0100

 Bernd Heller wrote:
 
 >> Description:
 > I have an Intel Pro/1000 PT Desktop Adapter network card in that machine, and by default the em(4) driver has rxcsum/txcsum enabled.
 > 
 > But the checksums for some UDP packets generated this way are wrong. I noticed this when trying to run avahi-daemon. It sends UDP multicast packets, but they were never recognized on the network. Only when using tcpdump did I notice the bad checksums. After I disabled rxcsum/txcsum on the interface all was working perfectly.
 > 
 > I could reproduce the same issue in a VMware machine using FreeBSD 7.0-RC1 i386 and amd64. 6.2 seems to be unaffected.
 >> How-To-Repeat:
 > Run avahi-daemon to publish any services (it will do so by default) and analyze the UDP packages sent out.
 >> Fix:
 > Workaround: disable rxcsum/txcsum on the interface.
 
 Please confirm that you ran tcpdump from ANOTHER system, not the one 
 generating the packets.  See the tcpdump manpage for more discussion of 
 hardware checksumming and tcpdump.
 
 Kris

From: Bernd Heller <bdheller@users.sourceforge.net>
To: Kris Kennaway <kris@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/119635: Bad UDP packet checksum with em(4) and rxcsum/txcsum enabled
Date: Sun, 13 Jan 2008 22:59:52 +0100

 Hi Kris,
 
 yes, I ran tcpdump from another system on the same subnet, connected  
 by a hub.
 
 Bernd
 
 On 13.01.2008, at 20:04, Kris Kennaway wrote:
 
 > Bernd Heller wrote:
 >
 >>> Description:
 >> I have an Intel Pro/1000 PT Desktop Adapter network card in that  
 >> machine, and by default the em(4) driver has rxcsum/txcsum enabled.
 >> But the checksums for some UDP packets generated this way are  
 >> wrong. I noticed this when trying to run avahi-daemon. It sends UDP  
 >> multicast packets, but they were never recognized on the network.  
 >> Only when using tcpdump did I notice the bad checksums. After I  
 >> disabled rxcsum/txcsum on the interface all was working perfectly.
 >> I could reproduce the same issue in a VMware machine using FreeBSD  
 >> 7.0-RC1 i386 and amd64. 6.2 seems to be unaffected.
 >>> How-To-Repeat:
 >> Run avahi-daemon to publish any services (it will do so by default)  
 >> and analyze the UDP packages sent out.
 >>> Fix:
 >> Workaround: disable rxcsum/txcsum on the interface.
 >
 > Please confirm that you ran tcpdump from ANOTHER system, not the one  
 > generating the packets.  See the tcpdump manpage for more discussion  
 > of hardware checksumming and tcpdump.
 >
 > Kris
 
Responsible-Changed-From-To: freebsd-bugs->jfv 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sun Jan 13 22:48:12 UTC 2008 
Responsible-Changed-Why:  
Please also submit the pciconf -lv output showing the affected device. 

Assign to driver maintainer for followup. 

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

From: Bernd Heller <bdheller@users.sourceforge.net>
To: bug-followup@FreeBSD.org,
 bdheller@users.sourceforge.net
Cc:  
Subject: Re: kern/119635: [em] Bad UDP packet checksum with em(4) and rxcsum/txcsum enabled
Date: Mon, 14 Jan 2008 15:34:59 +0100

 Here the pciconf output as requested.
 
 pciconf -lv
 hostb0@pci0:0:0:0:	class=0x060000 card=0x50001458 chip=0x29c08086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '(Bearlake) Processor to I/O Controller'
      class      = bridge
      subclass   = HOST-PCI
 pcib1@pci0:0:1:0:	class=0x060400 card=0x50001458 chip=0x29c18086  
 rev=0x02 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '(Bearlake) PCIe Root Port'
      class      = bridge
      subclass   = PCI-PCI
 uhci0@pci0:0:26:0:	class=0x0c0300 card=0x50041458 chip=0x29378086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host  
 Controller'
      class      = serial bus
      subclass   = USB
 uhci1@pci0:0:26:1:	class=0x0c0300 card=0x50041458 chip=0x29388086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host  
 Controller'
      class      = serial bus
      subclass   = USB
 uhci2@pci0:0:26:2:	class=0x0c0300 card=0x50041458 chip=0x29398086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host  
 Controller'
      class      = serial bus
      subclass   = USB
 ehci0@pci0:0:26:7:	class=0x0c0320 card=0x50061458 chip=0x293c8086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) USB2 Enhanced Host  
 Controller'
      class      = serial bus
      subclass   = USB
 pcib2@pci0:0:28:0:	class=0x060400 card=0x50011458 chip=0x29408086  
 rev=0x02 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) PCIe Root Port 1'
      class      = bridge
      subclass   = PCI-PCI
 pcib3@pci0:0:28:1:	class=0x060400 card=0x50011458 chip=0x29428086  
 rev=0x02 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) PCIe Root Port 2'
      class      = bridge
      subclass   = PCI-PCI
 pcib4@pci0:0:28:3:	class=0x060400 card=0x50011458 chip=0x29468086  
 rev=0x02 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) PCIe Root Port 4'
      class      = bridge
      subclass   = PCI-PCI
 pcib5@pci0:0:28:4:	class=0x060400 card=0x50011458 chip=0x29488086  
 rev=0x02 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) PCIe Root Port 5'
      class      = bridge
      subclass   = PCI-PCI
 uhci3@pci0:0:29:0:	class=0x0c0300 card=0x50041458 chip=0x29348086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host  
 Controller'
      class      = serial bus
      subclass   = USB
 uhci4@pci0:0:29:1:	class=0x0c0300 card=0x50041458 chip=0x29358086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host  
 Controller'
      class      = serial bus
      subclass   = USB
 uhci5@pci0:0:29:2:	class=0x0c0300 card=0x50041458 chip=0x29368086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host  
 Controller'
      class      = serial bus
      subclass   = USB
 ehci1@pci0:0:29:7:	class=0x0c0320 card=0x50061458 chip=0x293a8086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) USB2 Enhanced Host  
 Controller'
      class      = serial bus
      subclass   = USB
 pcib6@pci0:0:30:0:	class=0x060401 card=0x50001458 chip=0x244e8086  
 rev=0x92 hdr=0x01
      vendor     = 'Intel Corporation'
      device     = '82801 Family (ICH2/3/4/4/5/5/6/7/8/9,63xxESB) Hub  
 Interface to PCI Bridge'
      class      = bridge
      subclass   = PCI-PCI
 isab0@pci0:0:31:0:	class=0x060100 card=0x50011458 chip=0x29168086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IR (ICH9R) LPC Interface Controller'
      class      = bridge
      subclass   = PCI-ISA
 atapci2@pci0:0:31:2:	class=0x010601 card=0xb0051458 chip=0x29228086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) 6 port SATA AHCI  
 Controller'
      class      = mass storage
 none0@pci0:0:31:3:	class=0x0c0500 card=0x50011458 chip=0x29308086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82801IB/IR/IH (ICH9 Family) SMBus Controller'
      class      = serial bus
      subclass   = SMBus
 vgapci0@pci0:1:0:0:	class=0x030000 card=0x0450174b chip=0x5b621002  
 rev=0x00 hdr=0x00
      vendor     = 'ATI Technologies Inc'
      device     = 'RV380 RADEON X600 Series 265MB'
      class      = display
      subclass   = VGA
 vgapci1@pci0:1:0:1:	class=0x038000 card=0x0451174b chip=0x5b721002  
 rev=0x00 hdr=0x00
      vendor     = 'ATI Technologies Inc'
      device     = 'Radeon X600 Series - Secondary'
      class      = display
 em0@pci0:3:0:0:	class=0x020000 card=0x10838086 chip=0x10b98086  
 rev=0x06 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82572EI PRO/1000 PT Desktop Adapter (Copper)'
      class      = network
      subclass   = ethernet
 atapci0@pci0:4:0:0:	class=0x010601 card=0xb0001458 chip=0x2363197b  
 rev=0x02 hdr=0x00
      vendor     = 'JMicron Technology Corp'
      device     = 'JMB36X PCIe-to-SATA-300/IDE RAID Controller'
      class      = mass storage
 atapci1@pci0:4:0:1:	class=0x010185 card=0xb0001458 chip=0x2363197b  
 rev=0x02 hdr=0x00
      vendor     = 'JMicron Technology Corp'
      device     = 'JMB36X PCIe-to-SATA-300/IDE RAID Controller'
      class      = mass storage
      subclass   = ATA
 

From: Denis Ahrens <denis@berlin.ccc.de>
To: bug-followup@FreeBSD.org
Cc: bdheller@users.sourceforge.net
Subject: Re: kern/119635: [em] Bad UDP packet checksum with em(4) and rxcsum/txcsum enabled
Date: Fri, 8 Aug 2008 22:45:50 +0200

 This bug still bites my while using 8.0 CURRENT
 
 em0@pci0:2:10:0:	class=0x020000 card=0x002e8086 chip=0x100e8086  
 rev=0x02 hdr=0x00
      vendor     = 'Intel Corporation'
      device     = '82540EM Gigabit Ethernet Controller'
      class      = network
      subclass   = ethernet
 
 Denis
 

From: John Hay <jhay@meraka.org.za>
To: jfv@freebsd.org
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/119635: [em] Bad UDP packet checksum with em(4) and rxcsum/txcsum enabled
Date: Mon, 25 Aug 2008 14:42:46 +0200

 Hi Jack,
 
 I just upgraded a DELL 1850 from FreeBSD 6.2 to 7-stable and also ran
 into this problem.
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=119635&cat=
 
 It seems as if normal udp tx packets are ok, because ntp synced without
 a problem but multicast tx packets got their checksum wrong, so the other
 routers just ignored it. Doing a "ifconfig em3 -txcsum" solved the
 problem for now.
 
 When searching, I came across this pr, which looks like the same problem
 I have. The device I have is:
 
 em3@pci0:7:8:0: class=0x020000 card=0x016d1028 chip=0x10768086 rev=0x05 hdr=0x00
     vendor     = 'Intel Corporation'
     device     = '82541EI Gigabit Ethernet Controller'
     class      = network
     subclass   = ethernet
 
 So is there any chance of a fix for this problem?
 
 John
 -- 
 John Hay -- John.Hay@meraka.csir.co.za / jhay@FreeBSD.org

From: John Hay <jhay@meraka.org.za>
To: jfv@freebsd.org
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/119635: [em] Bad UDP packet checksum with em(4) and rxcsum/txcsum enabled
Date: Mon, 25 Aug 2008 21:37:17 +0200

 On Mon, Aug 25, 2008 at 02:42:46PM +0200, John Hay wrote:
 > Hi Jack,
 > 
 > I just upgraded a DELL 1850 from FreeBSD 6.2 to 7-stable and also ran
 > into this problem.
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=119635&cat=
 > 
 > It seems as if normal udp tx packets are ok, because ntp synced without
 > a problem but multicast tx packets got their checksum wrong, so the other
 > routers just ignored it. Doing a "ifconfig em3 -txcsum" solved the
 > problem for now.
 > 
 > When searching, I came across this pr, which looks like the same problem
 > I have. The device I have is:
 > 
 > em3@pci0:7:8:0: class=0x020000 card=0x016d1028 chip=0x10768086 rev=0x05 hdr=0x00
 >     vendor     = 'Intel Corporation'
 >     device     = '82541EI Gigabit Ethernet Controller'
 >     class      = network
 >     subclass   = ethernet
 > 
 > So is there any chance of a fix for this problem?
 
 Just to report back, at least for my case the patch posted by George
 (gnn) fixed it:
 
 http://docs.freebsd.org/cgi/getmsg.cgi?fetch=256996+0+archive/2008/freebsd-net/20080824.freebsd-net
 
 It was not a problem with the driver afterall. :-)
 
 John
 -- 
 John Hay -- John.Hay@meraka.csir.co.za / jhay@FreeBSD.org

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/119635: commit references a PR
Date: Fri, 29 Aug 2008 20:43:22 +0000 (UTC)

 gnn         2008-08-29 20:42:58 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/netinet          ip_output.c 
   Log:
   SVN rev 182463 on 2008-08-29 20:42:58Z by gnn
   
   Fix a bug whereby multicast packets that are looped back locally
   wind up with the incorrect checksum on the wire when transmitted via
   devices that do checksum offloading.
   
   PR:             kern/119635
   Reviewed by:    rwatson
   MFC after:      5 days
   
   Revision  Changes    Path
   1.286     +5 -1      src/sys/netinet/ip_output.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: gnn 
State-Changed-When: Sat Aug 30 04:23:35 UTC 2008 
State-Changed-Why:  
Take the bug and update its state to patched. 


Responsible-Changed-From-To: jfv->gnn 
Responsible-Changed-By: gnn 
Responsible-Changed-When: Sat Aug 30 04:23:35 UTC 2008 
Responsible-Changed-Why:  
Take the bug and then update it to patched as this is now patched in HEAD. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/119635: commit references a PR
Date: Wed,  3 Sep 2008 22:41:02 +0000 (UTC)

 gnn         2008-09-03 22:40:38 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/netinet          ip_output.c 
   Log:
   SVN rev 182744 on 2008-09-03 22:40:38Z by gnn
   
   MFC of change 182463.  Fix a bug in the multicast loopback code that
   causes packets that are looped back to have the wrong checksum when
   transmitted on the wire.
   
   PR:             kern/119635
   Reviewed by:    rwatson
   Approved by:    re (rwatson)
   
   Revision   Changes    Path
   1.276.2.5  +5 -1      src/sys/netinet/ip_output.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: linimon 
State-Changed-When: Fri Jan 30 21:31:10 UTC 2009 
State-Changed-Why:  
Committed to -current and RELENG_7. 

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