socsvn commit: r305578 - soc2016/vincenzo/head/sys/dev/netmap
vincenzo at FreeBSD.org
vincenzo at FreeBSD.org
Mon Jun 27 09:34:23 UTC 2016
Author: vincenzo
Date: Mon Jun 27 09:34:22 2016
New Revision: 305578
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305578
Log:
freebsd: ptnet_qflush: flush ring buffers
Modified:
soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c
Modified: soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c
==============================================================================
--- soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c Mon Jun 27 09:34:12 2016 (r305577)
+++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c Mon Jun 27 09:34:22 2016 (r305578)
@@ -971,6 +971,24 @@
static void
ptnet_qflush(struct ifnet *ifp)
{
+ struct ptnet_softc *sc = ifp->if_softc;
+ int i;
+
+ /* Flush all ring buffers and do the interface flush. */
+ for (i = 0; i < sc->num_rings; i++) {
+ struct ptnet_queue *pq = sc->queues + i;
+ struct mbuf *m;
+
+ PTNET_Q_LOCK(pq);
+ if (pq->bufring) {
+ while ((m = buf_ring_dequeue_sc(pq->bufring))) {
+ m_freem(m);
+ }
+ }
+ PTNET_Q_UNLOCK(pq);
+ }
+
+ if_qflush(ifp);
}
static int
More information about the svn-soc-all
mailing list