Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Fixes for kern/40018.



details:   https://anonhg.NetBSD.org/src/rev/6b97c725e4cc
branches:  trunk
changeset: 764387:6b97c725e4cc
user:      buhrow <buhrow%NetBSD.org@localhost>
date:      Mon Apr 18 22:05:39 2011 +0000

description:
Fixes for kern/40018.

        Our driver initializes the Broadcom hardware to peform a tcp and udp
checksum on only the payload of the tcp or udp packet, rather than the
entire packet.  The FreeBSD, OpenBSD  and Linux drivers instruct the hardware to compute
the checksum for the entire packet.  I believe the bug is that some revisions
of the BCM hardware, under certain circumstances, revert to doing the
complete checksum calculation, as the FreeBSD, OpenBSD  and Linux drivers
request, while things are running. As
a result, when we pull the computed checksum from the hardware and pass it
up to the upper layers, we assume the checksum is the more minimal
one, and the upper layers perform the appropriate checks, which, when this
happens, cause the packet to be rejected because the resultant checksum is
decidedly incorrect.
        This patch changes the driver to instruct the hardware to perform the
checksum over the entire packet, just as the FreeBSD, OpenBSD  and
Linux drivers do, and to notify the upper layers appropriately.

This patch appears to work on all revisions of the hardware that have been
tested.  (See the list in the bug report.)

this patch is approved by tls.

diffstat:

 sys/dev/pci/if_bge.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 10a2cb556939 -r 6b97c725e4cc sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Mon Apr 18 17:18:03 2011 +0000
+++ b/sys/dev/pci/if_bge.c      Mon Apr 18 22:05:39 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.193 2011/04/08 17:45:10 sborrill Exp $    */
+/*     $NetBSD: if_bge.c,v 1.194 2011/04/18 22:05:39 buhrow Exp $      */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.193 2011/04/08 17:45:10 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.194 2011/04/18 22:05:39 buhrow Exp $");
 
 #include "vlan.h"
 #include "rnd.h"
@@ -1866,7 +1866,7 @@
         */
        CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS |
            BGE_MODECTL_MAC_ATTN_INTR | BGE_MODECTL_HOST_SEND_BDS |
-           BGE_MODECTL_TX_NO_PHDR_CSUM | BGE_MODECTL_RX_NO_PHDR_CSUM);
+           BGE_MODECTL_TX_NO_PHDR_CSUM);
 
        /*
         * BCM5701 B5 have a bug causing data corruption when using
@@ -3447,7 +3447,7 @@
                            cur_rx->bge_tcp_udp_csum;
                        m->m_pkthdr.csum_flags |=
                            (M_CSUM_TCPv4|M_CSUM_UDPv4|
-                            M_CSUM_DATA|M_CSUM_NO_PSEUDOHDR);
+                            M_CSUM_DATA);
                }
 
                /*



Home | Main Index | Thread Index | Old Index