On Sat, Nov 03, 2012 at 06:12:23PM -0400, Brad Smith wrote:
> On Sat, Nov 03, 2012 at 09:41:08PM +0000, Christian Weisgerber wrote:
> > Previously, we couldn't enable TCP/UDP transmit checksum offload
> > on chipsets that require the checksum field to be initialized with
> > the pseudo-header checksum because this would break rdr-to 127.0.0.1.
> >
> > Henning's epic rewrite of the checksum handling has fixed this
> > problem, so let's enable TCP/UDP checksumming on bge(4). This
> > _might_ break on some of the gazillion chipset versions. There's
> > no way to find out but try.
> >
> > FWIW, it works fine with VLAN on this one:
> > bge0 at pci0 dev 5 function 0 "Broadcom BCM5702X" rev 0x02, BCM5702/5703
> > A2 (0x1002)
>
> Here is another revision but disabling the UDP checksum offload.
> There is a bug that results in some UDP packets having a 0 checksum.
And add a comment indicating why UDP checksum offload is not enabled.
Index: if_bge.c
===================================================================
RCS file: /home/cvs/src/sys/dev/pci/if_bge.c,v
retrieving revision 1.312
diff -u -p -r1.312 if_bge.c
--- if_bge.c 13 Sep 2012 04:15:18 -0000 1.312
+++ if_bge.c 4 Nov 2012 07:03:35 -0000
@@ -2155,12 +2155,14 @@ bge_attach(struct device *parent, struct
/*
* 5700 B0 chips do not support checksumming correctly due
* to hardware bugs.
+ *
+ * It seems all controllers have a bug that can generate UDP
+ * datagrams with a checksum value 0 when TX UDP checksum
+ * offloading is enabled. Generating UDP checksum value 0 is
+ * a violation of RFC 768.
*/
if (sc->bge_chipid != BGE_CHIPID_BCM5700_B0)
- ifp->if_capabilities |= IFCAP_CSUM_IPv4;
-#if 0 /* TCP/UDP checksum offload breaks with pf(4) */
- ifp->if_capabilities |= IFCAP_CSUM_TCPv4|IFCAP_CSUM_UDPv4;
-#endif
+ ifp->if_capabilities |= IFCAP_CSUM_IPv4 | IFCAP_CSUM_TCPv4;
if (BGE_IS_JUMBO_CAPABLE(sc))
ifp->if_hardmtu = BGE_JUMBO_MTU;
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.