Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jun 2016 09:34:23 GMT
From:      vincenzo@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r305578 - soc2016/vincenzo/head/sys/dev/netmap
Message-ID:  <201606270934.u5R9YNci027905@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



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