diff options
author | yongari <yongari@FreeBSD.org> | 2010-02-22 23:35:35 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2010-02-22 23:35:35 +0000 |
commit | 79836e2e5810d99956566c16cbe92cffe46d6b70 (patch) | |
tree | d95ce8a410f3b6b5d90f3efd117e9cfd708fda22 | |
parent | 21b36471d34ed9e69e9d196551a97b771fefd9ca (diff) | |
download | FreeBSD-src-79836e2e5810d99956566c16cbe92cffe46d6b70.zip FreeBSD-src-79836e2e5810d99956566c16cbe92cffe46d6b70.tar.gz |
Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
not support TSO over VLAN if VLAN hardware tagging is disabled so
there is no need to check VLAN here.
-rw-r--r-- | sys/dev/alc/if_alc.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index b3e5288..e95b044 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -1788,7 +1788,7 @@ alc_encap(struct alc_softc *sc, struct mbuf **m_head) struct tcphdr *tcp; bus_dma_segment_t txsegs[ALC_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, hdrlen, ip_off, poff, vtag; + uint32_t cflags, hdrlen, poff, vtag; int error, idx, nsegs, prod; ALC_LOCK_ASSERT(sc); @@ -1798,7 +1798,7 @@ alc_encap(struct alc_softc *sc, struct mbuf **m_head) m = *m_head; ip = NULL; tcp = NULL; - ip_off = poff = 0; + poff = 0; if ((m->m_pkthdr.csum_flags & (ALC_CSUM_FEATURES | CSUM_TSO)) != 0) { /* * AR8131/AR8132 requires offset of TCP/UDP header in its @@ -1808,7 +1808,6 @@ alc_encap(struct alc_softc *sc, struct mbuf **m_head) * cycles on FreeBSD so fast host CPU is required to get * smooth TSO performance. */ - struct ether_header *eh; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ @@ -1822,32 +1821,13 @@ alc_encap(struct alc_softc *sc, struct mbuf **m_head) *m_head = m; } - ip_off = sizeof(struct ether_header); - m = m_pullup(m, ip_off); + m = m_pullup(m, sizeof(struct ether_header) + sizeof(struct ip)); if (m == NULL) { *m_head = NULL; return (ENOBUFS); } - eh = mtod(m, struct ether_header *); - /* - * Check if hardware VLAN insertion is off. - * Additional check for LLC/SNAP frame? - */ - if (eh->ether_type == htons(ETHERTYPE_VLAN)) { - ip_off = sizeof(struct ether_vlan_header); - m = m_pullup(m, ip_off); - if (m == NULL) { - *m_head = NULL; - return (ENOBUFS); - } - } - m = m_pullup(m, ip_off + sizeof(struct ip)); - if (m == NULL) { - *m_head = NULL; - return (ENOBUFS); - } - ip = (struct ip *)(mtod(m, char *) + ip_off); - poff = ip_off + (ip->ip_hl << 2); + ip = (struct ip *)(mtod(m, char *) + sizeof(struct ether_header)); + poff = sizeof(struct ether_header) + (ip->ip_hl << 2); if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { m = m_pullup(m, poff + sizeof(struct tcphdr)); if (m == NULL) { |