diff options
author | 2006-05-31 06:46:12 +0000 | |
---|---|---|
committer | 2006-05-31 06:46:12 +0000 | |
commit | d74ff77ca844a96e8124179a4a2286b4b8d3ec40 (patch) | |
tree | 5d536c3aa3868d31514e9ebea54c8a037680dce4 | |
parent | Save and restore the data toggle value when a pipe to an endpoint (diff) | |
download | wireguard-openbsd-d74ff77ca844a96e8124179a4a2286b4b8d3ec40.tar.xz wireguard-openbsd-d74ff77ca844a96e8124179a4a2286b4b8d3ec40.zip |
- stop counting input/output bytes in the driver as this is taken care of
in ether_input/ether_output.
- only count input packets when sure the packet can be received as opposed
to counting it unconditionally, then potentially running into an error
and then dropping the packet.
ok reyk@
-rw-r--r-- | sys/dev/pci/if_vic.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c index 1f795490bcf..f3eab35f9c8 100644 --- a/sys/dev/pci/if_vic.c +++ b/sys/dev/pci/if_vic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vic.c,v 1.8 2006/05/28 00:20:21 brad Exp $ */ +/* $OpenBSD: if_vic.c,v 1.9 2006/05/31 06:46:12 brad Exp $ */ /* * Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org> @@ -315,9 +315,6 @@ vic_rx_proc(struct vic_softc *sc) break; len = letoh32(desc->rx_length); - ifp->if_ibytes += len; - ifp->if_ipackets++; - if (len < ETHER_MIN_LEN) { ifp->if_iqdrops++; goto nextp; @@ -350,6 +347,8 @@ vic_rx_proc(struct vic_softc *sc) } desc->rx_physaddr = rxb->rxb_map->dm_segs->ds_addr; + ifp->if_ipackets++; + #if NBPFILTER > 0 if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN); @@ -597,7 +596,6 @@ vic_tx_start(struct vic_softc *sc, struct mbuf *m) } ifp->if_opackets++; - ifp->if_obytes += m->m_len; sc->sc_txpending++; sc->sc_txtimeout = VIC_TX_TIMEOUT; |