diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-05-24 00:46:19 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-05-24 00:46:19 +0000 |
commit | b14166ec6fbbc9aef9c12d9678493124dbe3656b (patch) | |
tree | 398953857c92ff0ae41e32339a9ad79c6e1e99da /sys | |
parent | ccbd34c531a3b5f794af2397a390d37591123edd (diff) |
disable TX HW checksumming, some revs of the chip can cause packet corruption.
Issue with NFS reported by Han Boetes <han at mijncomputer dot nl>
ok pvalchev@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/re.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index ca0a4b185c6..a52b8665830 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.12 2005/04/30 19:43:41 brad Exp $ */ +/* $OpenBSD: re.c,v 1.13 2005/05/24 00:46:18 brad Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -884,10 +884,14 @@ re_attach_common(struct rl_softc *sc) IFQ_SET_MAXLEN(&ifp->if_snd, RL_IFQ_MAXLEN); IFQ_SET_READY(&ifp->if_snd); - ifp->if_capabilities = IFCAP_VLAN_MTU|IFCAP_CSUM_IPv4| - IFCAP_CSUM_TCPv4|IFCAP_CSUM_UDPv4; + ifp->if_capabilities = IFCAP_VLAN_MTU; -#ifdef VLANXXX +#ifdef RE_CSUM_OFFLOAD + ifp->if_capabilities |= IFCAP_CSUM_IPv4|IFCAP_CSUM_TCPv4| + IFCAP_CSUM_UDPv4; +#endif + +#ifdef RE_VLAN ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING; #endif @@ -1062,7 +1066,7 @@ re_rxeof(sc) struct ifnet *ifp; int i, total_len; struct rl_desc *cur_rx; -#ifdef VLANXXX +#ifdef RE_VLAN struct m_tag *mtag; #endif u_int32_t rxstat, rxvlan; @@ -1201,7 +1205,7 @@ re_rxeof(sc) !(rxstat & RL_RDESC_STAT_UDPSUMBAD))) m->m_pkthdr.csum_flags |= M_TCP_CSUM_IN_OK | M_UDP_CSUM_IN_OK; -#ifdef VLANXXX +#ifdef RE_VLAN if (rxvlan & RL_RDESC_VLANCTL_TAG) { mtag = m_tag_get(PACKET_TAG_VLAN, sizeof(u_int), M_NOWAIT); @@ -1434,15 +1438,16 @@ re_encap(sc, m_head, idx) { bus_dmamap_t map; int error, i, curidx; -#ifdef VLANXXX +#ifdef RE_VLAN struct m_tag *mtag; #endif struct rl_desc *d; - u_int32_t cmdstat, rl_flags; + u_int32_t cmdstat, rl_flags = 0; if (sc->rl_ldata.rl_tx_free <= 4) return (EFBIG); +#ifdef RE_CSUM_OFFLOAD /* * Set up checksum offload. Note: checksum offload bits must * appear in all descriptors of a multi-descriptor transmit @@ -1456,8 +1461,6 @@ re_encap(sc, m_head, idx) * RL_TDESC_CMD_UDPCSUM does not take affect. */ - rl_flags = 0; - if ((m_head->m_pkthdr.csum_flags & (M_IPV4_CSUM_OUT|M_TCPV4_CSUM_OUT|M_UDPV4_CSUM_OUT)) != 0) { rl_flags |= RL_TDESC_CMD_IPCSUM; @@ -1466,6 +1469,7 @@ re_encap(sc, m_head, idx) if (m_head->m_pkthdr.csum_flags & M_UDPV4_CSUM_OUT) rl_flags |= RL_TDESC_CMD_UDPCSUM; } +#endif map = sc->rl_ldata.rl_tx_dmamap[*idx]; error = bus_dmamap_load_mbuf(sc->sc_dmat, map, @@ -1534,7 +1538,7 @@ re_encap(sc, m_head, idx) * transmission attempt. */ -#ifdef VLANXXX +#ifdef RE_VLAN if (sc->ethercom.ec_nvlans && (mtag = m_tag_find(m_head, PACKET_TAG_VLAN, NULL)) != NULL) sc->rl_ldata.rl_tx_list[*idx].rl_vlanctl = |