diff options
author | yongari <yongari@FreeBSD.org> | 2008-11-25 04:33:02 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2008-11-25 04:33:02 +0000 |
commit | d094f70376b2af86b5404c15d2e100bab79731d8 (patch) | |
tree | d543f43fb7028f9e18d6a263e564b622a15db806 /sys | |
parent | c8de3cce1a32a8d28b7143042ac7a521dcb5400f (diff) | |
download | FreeBSD-src-d094f70376b2af86b5404c15d2e100bab79731d8.zip FreeBSD-src-d094f70376b2af86b5404c15d2e100bab79731d8.tar.gz |
Simplify Tx checksum offload configuration. Also clear CSUM_IP if
we've computed IP checksum with software method.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 3cdf9d2..135681e 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -1295,14 +1295,10 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head) * in the TCP header. The stack should have * already done this for us. */ - if (m->m_pkthdr.csum_flags) { - if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { - txp->tx_cb->ipcb_ip_schedule = - FXP_IPCB_TCPUDP_CHECKSUM_ENABLE; - if (m->m_pkthdr.csum_flags & CSUM_TCP) - txp->tx_cb->ipcb_ip_schedule |= - FXP_IPCB_TCP_PACKET; - } + if (m->m_pkthdr.csum_flags & FXP_CSUM_FEATURES) { + txp->tx_cb->ipcb_ip_schedule = FXP_IPCB_TCPUDP_CHECKSUM_ENABLE; + if (m->m_pkthdr.csum_flags & CSUM_TCP) + txp->tx_cb->ipcb_ip_schedule |= FXP_IPCB_TCP_PACKET; #ifdef FXP_IP_CSUM_WAR /* @@ -1334,6 +1330,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head) ip = mtod(m, struct ip *); ip->ip_sum = in_cksum(m, ip->ip_hl << 2); m->m_data -= ETHER_HDR_LEN; + m->m_pkthdr.csum_flags &= ~CSUM_IP; } else { txp->tx_cb->ipcb_ip_activation_high = FXP_IPCB_HARDWAREPARSING_ENABLE; |