summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2015-10-23 01:32:11 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2015-10-23 01:32:11 +0000
commite77a0be2f5607af6ca4629b6e85c2e8fc849406c (patch)
tree9492672b2a178fc777eb3211fd1dbf5e854714cd
parent46414bebb04bce3ce52afb402304f9ca4e155da1 (diff)
counting packets in hif_packets in hfsc_if is redundant.
the ifqueue struct has the same information, and hif_packets is never read separately. trim it.
-rw-r--r--sys/net/hfsc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/net/hfsc.c b/sys/net/hfsc.c
index 71e3a9f67c0..309ff9aa36b 100644
--- a/sys/net/hfsc.c
+++ b/sys/net/hfsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hfsc.c,v 1.25 2015/10/23 01:02:46 dlg Exp $ */
+/* $OpenBSD: hfsc.c,v 1.26 2015/10/23 01:32:10 dlg Exp $ */
/*
* Copyright (c) 2012-2013 Henning Brauer <henning@openbsd.org>
@@ -193,7 +193,6 @@ struct hfsc_if {
u_int hif_allocated; /* # of slots in hif_class_tbl */
u_int hif_classes; /* # of classes in the tree */
- u_int hif_packets; /* # of packets in the tree */
u_int hif_classid; /* class id sequence number */
hfsc_ellist_t *hif_eligible; /* eligible list */
@@ -673,7 +672,6 @@ hfsc_queue(struct ifqueue *ifq, struct mbuf *m,
return (ENOBUFS);
}
ifq->ifq_len++;
- hif->hif_packets++;
m->m_pkthdr.pf.prio = IFQ_MAXPRIO;
/* successfully queued. */
@@ -692,7 +690,7 @@ hfsc_dequeue(struct ifqueue *ifq, int remove)
int next_len, realtime = 0;
u_int64_t cur_time;
- if (hif->hif_packets == 0)
+ if (IFQ_LEN(ifq) == 0)
return (NULL);
cur_time = hfsc_microuptime();
@@ -749,7 +747,6 @@ hfsc_dequeue(struct ifqueue *ifq, int remove)
if ((m = hfsc_cl_dequeue(cl)) == NULL)
panic("hfsc_dequeue");
- hif->hif_packets--;
ifq->ifq_len--;
PKTCNTR_INC(&cl->cl_stats.xmit_cnt, m->m_pkthdr.len);
@@ -833,7 +830,6 @@ hfsc_cl_purge(struct hfsc_if *hif, struct hfsc_class *cl)
while ((m = hfsc_cl_dequeue(cl)) != NULL) {
PKTCNTR_INC(&cl->cl_stats.drop_cnt, m->m_pkthdr.len);
m_freem(m);
- hif->hif_packets--;
hif->hif_ifq->ifq_len--;
}