igb: Make sure that mbuf is changed before busdma sync
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 8 Aug 2012 03:49:41 +0000 (11:49 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 8 Aug 2012 03:51:05 +0000 (11:51 +0800)
This should not be problem for igb, since it does not have any
busdma constraint thus no effective busdma sync will happen.

sys/dev/netif/igb/if_igb.c

index 36241d8..5761038 100644 (file)
@@ -4195,7 +4195,7 @@ igb_set_ring_inuse(struct igb_softc *sc, boolean_t polling)
 }
 
 static int
-igb_tso_pullup(struct igb_tx_ring *txr __unused, struct mbuf **mp)
+igb_tso_pullup(struct igb_tx_ring *txr, struct mbuf **mp)
 {
        int hoff, iphlen, thoff;
        struct mbuf *m;
@@ -4219,6 +4219,13 @@ igb_tso_pullup(struct igb_tx_ring *txr __unused, struct mbuf **mp)
                }
                *mp = m;
        }
+       if (txr->sc->flags & IGB_FLAG_TSO_IPLEN0) {
+               struct ip *ip;
+
+               ip = mtodoff(m, struct ip *, hoff);
+               ip->ip_len = 0;
+       }
+
        return 0;
 }
 
@@ -4233,13 +4240,6 @@ igb_tso_ctx(struct igb_tx_ring *txr, struct mbuf *m, uint32_t *hlen)
        thoff = m->m_pkthdr.csum_thlen;
        hoff = m->m_pkthdr.csum_lhlen;
 
-       if (txr->sc->flags & IGB_FLAG_TSO_IPLEN0) {
-               struct ip *ip;
-
-               ip = mtodoff(m, struct ip *, hoff);
-               ip->ip_len = 0;
-       }
-
        vlan_macip_lens = type_tucmd_mlhl = mss_l4len_idx = 0;
 
        ctxd = txr->next_avail_desc;