Optimize bge_rxeof() & bge_txeof(): return immediately if there are no packets

to process. It could give us [significant?] perfomance increase if there is big
difference between RX/TX flows.

Submitted by:	Mihail Balikov <mihail.balikov AT interbgc DOT com>
Approved by:	glebius (mentor)
MFC after:	3 days
This commit is contained in:
Oleg Bulyzhin 2006-02-01 15:16:03 +00:00
parent f1650f412f
commit cfcb50259d

View File

@ -2520,6 +2520,11 @@ bge_rxeof(sc)
BGE_LOCK_ASSERT(sc);
/* Nothing to do */
if (sc->bge_rx_saved_considx ==
sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx)
return;
ifp = sc->bge_ifp;
bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag,
@ -2666,8 +2671,6 @@ bge_rxeof(sc)
CSR_WRITE_4(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std);
if (jumbocnt)
CSR_WRITE_4(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo);
return;
}
static void
@ -2679,6 +2682,11 @@ bge_txeof(sc)
BGE_LOCK_ASSERT(sc);
/* Nothing to do */
if (sc->bge_tx_saved_considx ==
sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx)
return;
ifp = sc->bge_ifp;
bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag,
@ -2712,8 +2720,6 @@ bge_txeof(sc)
if (cur_tx != NULL)
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
return;
}
#ifdef DEVICE_POLLING