[Bug 285837] rtwn with RTL8821AU and h/w checksum offload seems to treat 0 for IPv4+UDP as invalid

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 01 Apr 2025 21:01:21 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285837

--- Comment #1 from Jessica Clarke <jrtc27@freebsd.org> ---
Applying the following patch makes DHCP "just work" on this network.

diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx.c b/sys/dev/rtwn/rtl8812a/r12a_rx.c
index 805775033fd1..b5f019cc6509 100644
--- a/sys/dev/rtwn/rtl8812a/r12a_rx.c
+++ b/sys/dev/rtwn/rtl8812a/r12a_rx.c
@@ -177,6 +177,15 @@ r12a_handle_c2h_report(struct rtwn_softc *sc, uint8_t
*buf, int len)
 int
 r12a_check_frame_checksum(struct rtwn_softc *sc, struct mbuf *m)
 {
+       /*
+        * XXX: RTL8821AU seems to incorrectly handle at least UDP checksum
+        * fields of 0, treating them as an error. Ignore the offloaded
+        * checksumming result until this has been better characterised
+        * (including whether all-ones is correctly handled).
+        *
+        * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285837
+        */
+#if 0
        struct r12a_softc *rs = sc->sc_priv;
        struct r92c_rx_stat *stat;
        uint32_t rxdw1;
@@ -201,6 +210,7 @@ r12a_check_frame_checksum(struct rtwn_softc *sc, struct
mbuf *m)
                        m->m_pkthdr.csum_data = 0xffff;
                }
        }
+#endif

        return (0);
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.