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:
parent
f1650f412f
commit
cfcb50259d
@ -2520,6 +2520,11 @@ bge_rxeof(sc)
|
|||||||
|
|
||||||
BGE_LOCK_ASSERT(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;
|
ifp = sc->bge_ifp;
|
||||||
|
|
||||||
bus_dmamap_sync(sc->bge_cdata.bge_rx_return_ring_tag,
|
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);
|
CSR_WRITE_4(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std);
|
||||||
if (jumbocnt)
|
if (jumbocnt)
|
||||||
CSR_WRITE_4(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo);
|
CSR_WRITE_4(sc, BGE_MBX_RX_JUMBO_PROD_LO, sc->bge_jumbo);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2679,6 +2682,11 @@ bge_txeof(sc)
|
|||||||
|
|
||||||
BGE_LOCK_ASSERT(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;
|
ifp = sc->bge_ifp;
|
||||||
|
|
||||||
bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag,
|
bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag,
|
||||||
@ -2712,8 +2720,6 @@ bge_txeof(sc)
|
|||||||
|
|
||||||
if (cur_tx != NULL)
|
if (cur_tx != NULL)
|
||||||
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEVICE_POLLING
|
#ifdef DEVICE_POLLING
|
||||||
|
Loading…
x
Reference in New Issue
Block a user