svn commit: r194518 - head/sys/net

Kip Macy kmacy at FreeBSD.org
Fri Jun 19 23:11:21 UTC 2009


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);
 }
 


More information about the svn-src-head mailing list