From: Sepherosa Ziehau Date: Wed, 8 Aug 2012 08:11:11 +0000 (+0800) Subject: bnx: Rearrange the code to check the spare TX descripors first X-Git-Tag: v3.2.0~445 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/a1bd58c979c634722a526d69e53b2db2f9eebf47?ds=sidebyside bnx: Rearrange the code to check the spare TX descripors first While im here, remove the useless fragmentation checksum code, which is never supported by this driver --- diff --git a/sys/dev/netif/bnx/if_bnx.c b/sys/dev/netif/bnx/if_bnx.c index b14cc3f029..acaa38b4af 100644 --- a/sys/dev/netif/bnx/if_bnx.c +++ b/sys/dev/netif/bnx/if_bnx.c @@ -2955,46 +2955,22 @@ bnx_start(struct ifnet *ifp) need_trans = 0; while (sc->bnx_cdata.bnx_tx_chain[prodidx] == NULL) { - m_head = ifq_dequeue(&ifp->if_snd, NULL); - if (m_head == NULL) - break; - - /* - * XXX - * The code inside the if() block is never reached since we - * must mark CSUM_IP_FRAGS in our if_hwassist to start getting - * requests to checksum TCP/UDP in a fragmented packet. - * - * XXX - * safety overkill. If this is a fragmented packet chain - * with delayed TCP/UDP checksums, then only encapsulate - * it if we have enough descriptors to handle the entire - * chain at once. - * (paranoia -- may not actually be needed) - */ - if ((m_head->m_flags & M_FIRSTFRAG) && - (m_head->m_pkthdr.csum_flags & CSUM_DELAY_DATA)) { - if ((BGE_TX_RING_CNT - sc->bnx_txcnt) < - m_head->m_pkthdr.csum_data + BNX_NSEG_RSVD) { - ifp->if_flags |= IFF_OACTIVE; - ifq_prepend(&ifp->if_snd, m_head); - break; - } - } - /* * Sanity check: avoid coming within BGE_NSEG_RSVD * descriptors of the end of the ring. Also make * sure there are BGE_NSEG_SPARE descriptors for - * jumbo buffers' defragmentation. + * jumbo buffers' or TSO segments' defragmentation. */ if ((BGE_TX_RING_CNT - sc->bnx_txcnt) < (BNX_NSEG_RSVD + BNX_NSEG_SPARE)) { ifp->if_flags |= IFF_OACTIVE; - ifq_prepend(&ifp->if_snd, m_head); break; } + m_head = ifq_dequeue(&ifp->if_snd, NULL); + if (m_head == NULL) + break; + /* * Pack the data into the transmit ring. If we * don't have room, set the OACTIVE flag and wait