Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Fix mue_sethwcsum():
details: https://anonhg.NetBSD.org/src/rev/5b9e843dca24
branches: trunk
changeset: 448328:5b9e843dca24
user: rin <rin%NetBSD.org@localhost>
date: Wed Jan 30 11:11:45 2019 +0000
description:
Fix mue_sethwcsum():
- Check appropriate flags to enable RX checksum offloading.
- We don't support ICMP/IGMP checksum offloading.
Tested both on LAN7800 and 7500.
diffstat:
sys/dev/usb/if_mue.c | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diffs (52 lines):
diff -r 6bb3d35d8f42 -r 5b9e843dca24 sys/dev/usb/if_mue.c
--- a/sys/dev/usb/if_mue.c Wed Jan 30 10:55:44 2019 +0000
+++ b/sys/dev/usb/if_mue.c Wed Jan 30 11:11:45 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mue.c,v 1.28 2019/01/22 03:42:28 msaitoh Exp $ */
+/* $NetBSD: if_mue.c,v 1.29 2019/01/30 11:11:45 rin Exp $ */
/* $OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $ */
/*
@@ -20,7 +20,7 @@
/* Driver for Microchip LAN7500/LAN7800 chipsets. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.28 2019/01/22 03:42:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.29 2019/01/30 11:11:45 rin Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -1402,17 +1402,23 @@
reg = (sc->mue_flags & LAN7500) ? MUE_7500_RFE_CTL : MUE_7800_RFE_CTL;
val = mue_csr_read(sc, reg);
- if (ifp->if_capenable & (IFCAP_CSUM_TCPv4_Rx|IFCAP_CSUM_UDPv4_Rx)) {
- DPRINTF(sc, "enabled\n");
- val |= MUE_RFE_CTL_IGMP_COE | MUE_RFE_CTL_ICMP_COE;
- val |= MUE_RFE_CTL_TCPUDP_COE | MUE_RFE_CTL_IP_COE;
+ if (ifp->if_capenable & IFCAP_CSUM_IPv4_Rx) {
+ DPRINTF(sc, "RX IPv4 hwcsum enabled\n");
+ val |= MUE_RFE_CTL_IP_COE;
} else {
- DPRINTF(sc, "disabled\n");
- val &=
- ~(MUE_RFE_CTL_IGMP_COE | MUE_RFE_CTL_ICMP_COE);
- val &=
- ~(MUE_RFE_CTL_TCPUDP_COE | MUE_RFE_CTL_IP_COE);
- }
+ DPRINTF(sc, "RX IPv4 hwcsum disabled\n");
+ val &= ~MUE_RFE_CTL_IP_COE;
+ }
+
+ if (ifp->if_capenable &
+ (IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_UDPv4_Rx |
+ IFCAP_CSUM_TCPv6_Rx | IFCAP_CSUM_UDPv6_Rx)) {
+ DPRINTF(sc, "RX L4 hwcsum enabled\n");
+ val |= MUE_RFE_CTL_TCPUDP_COE;
+ } else {
+ DPRINTF(sc, "RX L4 hwcsum disabled\n");
+ val &= ~MUE_RFE_CTL_TCPUDP_COE;
+ }
val &= ~MUE_RFE_CTL_VLAN_FILTER;
Home |
Main Index |
Thread Index |
Old Index