summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2003-04-19 22:08:05 +0000
committerJason Wright <jason@cvs.openbsd.org>2003-04-19 22:08:05 +0000
commit09a817518d71fef0c88397507c6527db90ecc52c (patch)
tree9216f67d2842d007e3f12d21d32e3155298ebd87 /sys
parent9ed3fd164352343b8e96f025226c35bbeae2b549 (diff)
correct opacket/obytes statistics; from sam@freebsd
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/ubsec.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c
index 1bb2e771ea4..c1b3b3f2359 100644
--- a/sys/dev/pci/ubsec.c
+++ b/sys/dev/pci/ubsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsec.c,v 1.125 2003/04/19 21:59:08 jason Exp $ */
+/* $OpenBSD: ubsec.c,v 1.126 2003/04/19 22:08:04 jason Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -391,15 +391,12 @@ ubsec_intr(arg)
* at the top.
*/
for (i = 0; i < npkts; i++) {
- if(q->q_stacked_mcr[i]) {
+ if(q->q_stacked_mcr[i])
ubsec_callback(sc, q->q_stacked_mcr[i]);
- ubsecstats.hst_opackets++;
- } else {
+ else
break;
- }
}
ubsec_callback(sc, q);
- ubsecstats.hst_opackets++;
}
/*
@@ -1255,6 +1252,9 @@ ubsec_callback(sc, q)
struct cryptodesc *crd;
struct ubsec_dma *dmap = q->q_dma;
+ ubsecstats.hst_opackets++;
+ ubsecstats.hst_obytes += dmap->d_alloc.dma_size;
+
bus_dmamap_sync(sc->sc_dmat, dmap->d_alloc.dma_map, 0,
dmap->d_alloc.dma_map->dm_mapsize,
BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
@@ -1273,7 +1273,6 @@ ubsec_callback(sc, q)
m_freem(q->q_src_m);
crp->crp_buf = (caddr_t)q->q_dst_m;
}
- ubsecstats.hst_obytes += ((struct mbuf *)crp->crp_buf)->m_len;
/* copy out IV for future use */
if (q->q_flags & UBSEC_QFLAGS_COPYOUTIV) {