diff options
author | 2006-02-02 20:35:55 +0000 | |
---|---|---|
committer | 2006-02-02 20:35:55 +0000 | |
commit | 84cec39be7f1179b7f620e713139889769b70f23 (patch) | |
tree | 28a562be26f5f0ca767c62bc43ea28b3e06bb8d9 | |
parent | In interactive mode force newline between left and right sets in the "e b" (diff) | |
download | wireguard-openbsd-84cec39be7f1179b7f620e713139889769b70f23.tar.xz wireguard-openbsd-84cec39be7f1179b7f620e713139889769b70f23.zip |
Optimize bge_rxeof() & bge_txeof(): return immediately if there are no packets
to process.
From oleg FreeBSD
-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, |