From 81317a8fde17da870e0b6186d563075b2d28afd9 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 8 Aug 2012 12:09:51 +0800 Subject: [PATCH] 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. --- sys/dev/netif/emx/if_emx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/netif/emx/if_emx.c b/sys/dev/netif/emx/if_emx.c index 31d907cfa1..b8526ea36a 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 && -- 2.41.0