Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jun 2009 23:11:20 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r194518 - head/sys/net
Message-ID:  <200906192311.n5JNBKev057917@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Fri Jun 19 23:11:20 2009
New Revision: 194518
URL: http://svn.freebsd.org/changeset/base/194518

Log:
  add helper function for flushing software queues

Modified:
  head/sys/net/if_var.h

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Fri Jun 19 22:15:59 2009	(r194517)
+++ head/sys/net/if_var.h	Fri Jun 19 23:11:20 2009	(r194518)
@@ -586,13 +586,27 @@ drbr_enqueue(struct ifnet *ifp, struct b
 }
 
 static __inline void
-drbr_free(struct buf_ring *br, struct malloc_type *type)
+drbr_flush(struct ifnet *ifp, struct buf_ring *br)
 {
 	struct mbuf *m;
 
+#ifdef ALTQ
+	if (ifp != NULL && ALTQ_IS_ENABLED(&ifp->if_snd)) {
+		while (!IFQ_IS_EMPTY(&ifp->if_snd)) {
+			IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
+			m_freem(m);
+		}
+	}
+#endif	
 	while ((m = buf_ring_dequeue_sc(br)) != NULL)
 		m_freem(m);
+}
+
+static __inline void
+drbr_free(struct buf_ring *br, struct malloc_type *type)
+{
 
+	drbr_flush(NULL, br);
 	buf_ring_free(br, type);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906192311.n5JNBKev057917>