Here is a better diff, which targets just this chipset. With this the device
is still usable for me.

--- sys/dev/pci/if_bge.c
+++ sys/dev/pci/if_bge.c
@@ -3078,15 +3078,16 @@ bge_attach(struct device *parent, struct device *self,
 #endif
 
        /*
-        * 5700 B0 chips do not support checksumming correctly due
-        * to hardware bugs.
+        * 5700 B0 and 57765 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)
+       if (sc->bge_chipid != BGE_CHIPID_BCM5700_B0 &&
+           sc->bge_chipid != BGE_CHIPID_BCM57765_B0)
                ifp->if_capabilities |= IFCAP_CSUM_IPv4 | IFCAP_CSUM_TCPv4;
 
        if (BGE_IS_JUMBO_CAPABLE(sc))
@@ -3647,10 +3648,11 @@ bge_rxeof(struct bge_softc *sc)
 void
 bge_rxcsum(struct bge_softc *sc, struct bge_rx_bd *cur_rx, struct mbuf *m)
 {
-       if (sc->bge_chipid == BGE_CHIPID_BCM5700_B0) {
+       if (sc->bge_chipid == BGE_CHIPID_BCM5700_B0 ||
+           sc->bge_chipid == BGE_CHIPID_BCM57765_B0) {
                /*
-                * 5700 B0 chips do not support checksumming correctly due
-                * to hardware bugs.
+                * 5700 B0 and 57765 B0 chips do not support checksumming
+                * correctly due to hardware bugs.
                 */
                return;
        } else if (BGE_IS_5717_PLUS(sc)) {


$ ifconfig bge0 hwfeatures
bge0: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500
        hwfeatures=30<VLAN_MTU,VLAN_HWTAGGING> hardmtu 9000
        lladdr xx:xx:xx:xx:xx:xx
        index 1 priority 0 llprio 3
        groups: egress
        media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
        status: active
        inet 10.0.5.100 netmask 0xffffff00 broadcast 10.0.5.255

$ dmesg |grep bge0
bge0 at pci8 dev 0 function 0 "Broadcom BCM57765" rev 0x10, BCM57765 B0 
(0x57785100): msi, address xx:xx:xx:xx:xx:xx
brgphy0 at bge0 phy 1: BCM57765, rev. 4
bge0: restrict all mbufs to low memory

On 11/2/26 23:25, Scott Bennett wrote:
>> Synopsis:    bge(4) BCM57765 hardware checksum bug?
>> Category:    kernel
>> Environment:
>       System      : OpenBSD 8.0
>       Details     : OpenBSD 8.0-current (GENERIC.MP) #124: Sun Nov  1 
> 03:53:40 CST 2026
>                        
> [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
>       Architecture: OpenBSD.amd64
>       Machine     : amd64
>> Description:
>       My MacBookPro (9,2) bge interface hits an error when attempting to fetch
>       anything large over tcp (e.g. fetching sets via sysupgrade or the
>       installer). UDP and small files seem mostly unaffected. ftp from the
>       cdn(s) will trigger the problem more reliably, but sftp over local LAN
>       worked well enough to get all the sets.
> 
>> How-To-Repeat:
>       Same error from both ramdisk and installed system:
> 
>       $ ftp -M https://cdn.openbsd.org/pub/OpenBSD/8.0/amd64/base80.tgz
>       Trying 151.101.131.52...
>       Requesting https://cdn.openbsd.org/pub/OpenBSD/8.0/amd64/base80.tgz
>       ftp: Reading from socket: read failed: error:14FFF3E7:SSL 
> routines:(UNKNOWN)SSL_internal:unknown failure occurred
> 
>> Fix:
>       A USB axen device does not encounter the same error.
>       Disabling hardware checksumming in bge has made the device usable
>       for me. First I tried just removing IFCAP_CSUM_TCPv4, but no
>       improvement. Here's my patch, which is overkill:
> 
> diff 21ea132db7eac1d478645cd6150c5787dc366ebc 
> b2d74f486fe3cb450bb222c4e26cc0adacb705d1
> commit - 21ea132db7eac1d478645cd6150c5787dc366ebc
> commit + b2d74f486fe3cb450bb222c4e26cc0adacb705d1
> blob - 5ca8a5fd6135f002fba134ff61a1bb719d080dce
> blob + a0246c6193c77b65f353ab7acb40105eebe556f6
> --- sys/dev/pci/if_bge.c
> +++ sys/dev/pci/if_bge.c
> @@ -3086,8 +3086,10 @@ bge_attach(struct device *parent, struct device *self,
>        * offloading is enabled. Generating UDP checksum value 0 is
>        * a violation of RFC 768.
>        */
> +#if 0
>       if (sc->bge_chipid != BGE_CHIPID_BCM5700_B0)
>               ifp->if_capabilities |= IFCAP_CSUM_IPv4 | IFCAP_CSUM_TCPv4;
> +#endif
>  
>       if (BGE_IS_JUMBO_CAPABLE(sc))
>               ifp->if_hardmtu = BGE_JUMBO_MTU;
> @@ -3647,12 +3649,12 @@ bge_rxeof(struct bge_softc *sc)
>  void
>  bge_rxcsum(struct bge_softc *sc, struct bge_rx_bd *cur_rx, struct mbuf *m)
>  {
> -     if (sc->bge_chipid == BGE_CHIPID_BCM5700_B0) {
>               /*
>                * 5700 B0 chips do not support checksumming correctly due
>                * to hardware bugs.
>                */
>               return;
> +#if 0
>       } else if (BGE_IS_5717_PLUS(sc)) {
>               if ((cur_rx->bge_flags & BGE_RXBDFLAG_IPV6) == 0) {
>                       if (cur_rx->bge_flags & BGE_RXBDFLAG_IP_CSUM &&
> @@ -3677,6 +3679,7 @@ bge_rxcsum(struct bge_softc *sc, struct bge_rx_bd *cur
>                           M_TCP_CSUM_IN_OK|M_UDP_CSUM_IN_OK;
>               }
>       }
> +#endif
>  }
>  
>  void
> 

Reply via email to