From: Sepherosa Ziehau Date: Wed, 8 Aug 2012 04:09:51 +0000 (+0800) Subject: emx: Make sure that mbuf is changed before busdma sync X-Git-Tag: v3.2.0~450 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/81317a8fde17da870e0b6186d563075b2d28afd9 emx: Make sure that mbuf is changed before busdma sync This should not be problem for emx, since it does not have any busdma constraint thus no effective busdma sync will happen. --- diff --git a/sys/dev/netif/emx/if_emx.c b/sys/dev/netif/emx/if_emx.c index 31d907c..b8526ea 100644 --- a/sys/dev/netif/emx/if_emx.c +++ b/sys/dev/netif/emx/if_emx.c @@ -3763,6 +3763,7 @@ emx_tso_pullup(struct emx_softc *sc, struct mbuf **mp) { int iphlen, hoff, thoff, ex = 0; struct mbuf *m; + struct ip *ip; m = *mp; KASSERT(M_WRITABLE(m), ("TSO mbuf not writable")); @@ -3786,6 +3787,9 @@ emx_tso_pullup(struct emx_softc *sc, struct mbuf **mp) } *mp = m; } + ip = mtodoff(m, struct ip *, hoff); + ip->ip_len = 0; + return 0; } @@ -3796,7 +3800,6 @@ emx_tso_setup(struct emx_softc *sc, struct mbuf *mp, struct e1000_context_desc *TXD; int hoff, iphlen, thoff, hlen; int mss, pktlen, curr_txd; - struct ip *ip; #ifdef EMX_TSO_DEBUG sc->tso_segments++; @@ -3808,9 +3811,6 @@ emx_tso_setup(struct emx_softc *sc, struct mbuf *mp, mss = mp->m_pkthdr.tso_segsz; pktlen = mp->m_pkthdr.len; - ip = mtodoff(mp, struct ip *, hoff); - ip->ip_len = 0; - if (sc->csum_flags == CSUM_TSO && sc->csum_iphlen == iphlen && sc->csum_lhlen == hoff &&