From 78a38663ec7520b04ab57be92dc1a7b3fa1c2224 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 8 Aug 2012 11:49:41 +0800 Subject: [PATCH] igb: Make sure that mbuf is changed before busdma sync 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 | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/netif/igb/if_igb.c b/sys/dev/netif/igb/if_igb.c index 36241d8..5761038 100644 --- a/sys/dev/netif/igb/if_igb.c +++ b/sys/dev/netif/igb/if_igb.c @@ -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; -- 1.7.7.2