diff options
author | yongari <yongari@FreeBSD.org> | 2010-04-19 22:10:40 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2010-04-19 22:10:40 +0000 |
commit | 66db61c8c0e978eac926b1b47c6c81a108bdaa98 (patch) | |
tree | 4e38df74b4ad94becb3a95f35a704d97f0681706 /sys/dev/msk/if_msk.c | |
parent | 35d5bf4c1d2ab71a150954bf3464549e9e2c9efc (diff) | |
download | FreeBSD-src-66db61c8c0e978eac926b1b47c6c81a108bdaa98.zip FreeBSD-src-66db61c8c0e978eac926b1b47c6c81a108bdaa98.tar.gz |
With r206844, CSUM_TCP is also set for CSUM_TSO case. Modify
drivers to take into account for the change. Basically CSUM_TSO
should be checked before checking CSUM_TCP.
Diffstat (limited to 'sys/dev/msk/if_msk.c')
-rw-r--r-- | sys/dev/msk/if_msk.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index 61b131b..c083e1e 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -2605,23 +2605,32 @@ msk_encap(struct msk_if_softc *sc_if, struct mbuf **m_head) ip = (struct ip *)(mtod(m, char *) + offset); offset += (ip->ip_hl << 2); tcp_offset = offset; - /* - * It seems that Yukon II has Tx checksum offload bug for - * small TCP packets that's less than 60 bytes in size - * (e.g. TCP window probe packet, pure ACK packet). - * Common work around like padding with zeros to make the - * frame minimum ethernet frame size didn't work at all. - * Instead of disabling checksum offload completely we - * resort to S/W checksum routine when we encounter short - * TCP frames. - * Short UDP packets appear to be handled correctly by - * Yukon II. Also I assume this bug does not happen on - * controllers that use newer descriptor format or - * automatic Tx checksum calaulcation. - */ - if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + m = m_pullup(m, offset + sizeof(struct tcphdr)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + tcp = (struct tcphdr *)(mtod(m, char *) + offset); + offset += (tcp->th_off << 2); + } else if ((sc_if->msk_flags & MSK_FLAG_AUTOTX_CSUM) == 0 && (m->m_pkthdr.len < MSK_MIN_FRAMELEN) && (m->m_pkthdr.csum_flags & CSUM_TCP) != 0) { + /* + * It seems that Yukon II has Tx checksum offload bug + * for small TCP packets that's less than 60 bytes in + * size (e.g. TCP window probe packet, pure ACK packet). + * Common work around like padding with zeros to make + * the frame minimum ethernet frame size didn't work at + * all. + * Instead of disabling checksum offload completely we + * resort to S/W checksum routine when we encounter + * short TCP frames. + * Short UDP packets appear to be handled correctly by + * Yukon II. Also I assume this bug does not happen on + * controllers that use newer descriptor format or + * automatic Tx checksum calaulcation. + */ m = m_pullup(m, offset + sizeof(struct tcphdr)); if (m == NULL) { *m_head = NULL; @@ -2632,15 +2641,6 @@ msk_encap(struct msk_if_softc *sc_if, struct mbuf **m_head) m->m_pkthdr.len, offset); m->m_pkthdr.csum_flags &= ~CSUM_TCP; } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - m = m_pullup(m, offset + sizeof(struct tcphdr)); - if (m == NULL) { - *m_head = NULL; - return (ENOBUFS); - } - tcp = (struct tcphdr *)(mtod(m, char *) + offset); - offset += (tcp->th_off << 2); - } *m_head = m; } |