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/ale | |
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/ale')
-rw-r--r-- | sys/dev/ale/if_ale.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/dev/ale/if_ale.c b/sys/dev/ale/if_ale.c index 76f1b74..b3e7187 100644 --- a/sys/dev/ale/if_ale.c +++ b/sys/dev/ale/if_ale.c @@ -1737,8 +1737,14 @@ ale_encap(struct ale_softc *sc, struct mbuf **m_head) bus_dmamap_sync(sc->ale_cdata.ale_tx_tag, map, BUS_DMASYNC_PREWRITE); m = *m_head; - /* Configure Tx checksum offload. */ - if ((m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + /* Request TSO and set MSS. */ + cflags |= ALE_TD_TSO; + cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << ALE_TD_MSS_SHIFT); + /* Set IP/TCP header size. */ + cflags |= ip->ip_hl << ALE_TD_IPHDR_LEN_SHIFT; + cflags |= tcp->th_off << ALE_TD_TCPHDR_LEN_SHIFT; + } else if ((m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0) { /* * AR81xx supports Tx custom checksum offload feature * that offloads single 16bit checksum computation. @@ -1769,15 +1775,6 @@ ale_encap(struct ale_softc *sc, struct mbuf **m_head) ALE_TD_CSUM_XSUMOFFSET_SHIFT); } - if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - /* Request TSO and set MSS. */ - cflags |= ALE_TD_TSO; - cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << ALE_TD_MSS_SHIFT); - /* Set IP/TCP header size. */ - cflags |= ip->ip_hl << ALE_TD_IPHDR_LEN_SHIFT; - cflags |= tcp->th_off << ALE_TD_TCPHDR_LEN_SHIFT; - } - /* Configure VLAN hardware tag insertion. */ if ((m->m_flags & M_VLANTAG) != 0) { vtag = ALE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); |