diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-02-02 20:35:56 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-02-02 20:35:56 +0000 |
commit | a55886426c77b232572a2accb52d7efe630995d9 (patch) | |
tree | bd46eec457b4b2f96fc5b63fa0d971b27177579c /sys | |
parent | f653f2e86ced73b0b711c7ec0c6d882d3cd072a4 (diff) |
Optimize bge_rxeof() & bge_txeof(): return immediately if there are no packets
to process.
From oleg FreeBSD
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_bge.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index 2216eb8e3dc..7bfa51aae85 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.125 2006/02/02 07:15:37 brad Exp $ */ +/* $OpenBSD: if_bge.c,v 1.126 2006/02/02 20:35:55 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -2178,6 +2178,11 @@ bge_rxeof(struct bge_softc *sc) bus_size_t tlen; int tosync; + /* Nothing to do */ + if (sc->bge_rx_saved_considx == + sc->bge_rdata->bge_status_block.bge_idx[0].bge_rx_prod_idx) + return; + ifp = &sc->arpcom.ac_if; bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, @@ -2322,6 +2327,11 @@ bge_txeof(struct bge_softc *sc) int tosync; struct mbuf *m; + /* Nothing to do */ + if (sc->bge_tx_saved_considx == + sc->bge_rdata->bge_status_block.bge_idx[0].bge_tx_cons_idx) + return; + ifp = &sc->arpcom.ac_if; bus_dmamap_sync(sc->bge_dmatag, sc->bge_ring_map, |