summaryrefslogtreecommitdiff
path: root/sys/net/ifq.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/ifq.c')
-rw-r--r--sys/net/ifq.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/net/ifq.c b/sys/net/ifq.c
index d460d764488..2090704a8c7 100644
--- a/sys/net/ifq.c
+++ b/sys/net/ifq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifq.c,v 1.13 2017/11/14 00:00:35 dlg Exp $ */
+/* $OpenBSD: ifq.c,v 1.14 2017/11/14 04:08:11 dlg Exp $ */
/*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
@@ -289,6 +289,18 @@ ifq_destroy(struct ifqueue *ifq)
ml_purge(&ml);
}
+void
+ifq_add_data(struct ifqueue *ifq, struct if_data *data)
+{
+ mtx_enter(&ifq->ifq_mtx);
+ data->ifi_opackets += ifq->ifq_packets;
+ data->ifi_obytes += ifq->ifq_bytes;
+ data->ifi_oqdrops += ifq->ifq_qdrops;
+ data->ifi_omcasts += ifq->ifq_mcasts;
+ /* ifp->if_data.ifi_oerrors */
+ mtx_leave(&ifq->ifq_mtx);
+}
+
int
ifq_enqueue(struct ifqueue *ifq, struct mbuf *m)
{