summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorPeter Valchev <pvalchev@cvs.openbsd.org>2005-04-30 08:22:24 +0000
committerPeter Valchev <pvalchev@cvs.openbsd.org>2005-04-30 08:22:24 +0000
commitc19e305b00294cdb289939c6af7365cf3072b6b3 (patch)
tree9c91e501144de7e1a76eafd970c21e6e5d19f21e /sys/dev
parent3f3f5375c2fee820eb11928b3d955b73027a67e2 (diff)
From NetBSD, pt to by brad (might fix csum problems, else they may
need to be disabled after more testing): re_encap: set RTK_TDESC_CMD_IPCSUM if any of checksum offloading is requested. otherwise, RTK_TDESC_CMD_TCPCSUM/UDPCSUM don't seem to make any effect.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/re.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index a10099b356e..109f4184269 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.9 2005/04/25 17:55:51 brad Exp $ */
+/* $OpenBSD: re.c,v 1.10 2005/04/30 08:22:23 pvalchev Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -1450,14 +1450,22 @@ re_encap(sc, m_head, idx)
* chip. I'm not sure if this is a requirement or a bug.)
*/
+ /*
+ * Set RL_TDESC_CMD_IPCSUM if any checksum offloading
+ * is requested. Otherwise, RL_TDESC_CMD_TCPCSUM/
+ * RL_TDESC_CMD_UDPCSUM does not take affect.
+ */
+
rl_flags = 0;
- if (m_head->m_pkthdr.csum_flags & M_IPV4_CSUM_OUT)
+ 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;
- if (m_head->m_pkthdr.csum_flags & M_TCPV4_CSUM_OUT)
- rl_flags |= RL_TDESC_CMD_TCPCSUM;
- if (m_head->m_pkthdr.csum_flags & M_UDPV4_CSUM_OUT)
- rl_flags |= RL_TDESC_CMD_UDPCSUM;
+ if (m_head->m_pkthdr.csum_flags & M_TCPV4_CSUM_OUT)
+ rl_flags |= RL_TDESC_CMD_TCPCSUM;
+ if (m_head->m_pkthdr.csum_flags & M_UDPV4_CSUM_OUT)
+ rl_flags |= RL_TDESC_CMD_UDPCSUM;
+ }
map = sc->rl_ldata.rl_tx_dmamap[*idx];
error = bus_dmamap_load_mbuf(sc->sc_dmat, map,