socsvn commit: r305576 - soc2016/vincenzo/head/sys/dev/netmap

vincenzo at FreeBSD.org vincenzo at FreeBSD.org
Mon Jun 27 09:34:04 UTC 2016


Author: vincenzo
Date: Mon Jun 27 09:34:03 2016
New Revision: 305576
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305576

Log:
   freebsd: ptnet_transmit: add doublecheck with rescheduling

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:33:54 2016	(r305575)
+++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c	Mon Jun 27 09:34:03 2016	(r305576)
@@ -937,8 +937,20 @@
 
 	if (head == ring->tail) {
 		/* Reactivate the interrupts so that we can be notified
-		 * when some netmap slots are made available by the host. */
+		 * when some free slots are made available by the host. */
 		ptring->guest_need_kick = 1;
+
+                /* Double check. */
+		ptnet_sync_tail(ptring, kring);
+		if (unlikely(head != ring->tail)) {
+			RD(1, "Doublecheck finds more slots");
+			/* More slots were freed before reactivating
+			 * the interrupts. */
+			ptring->guest_need_kick = 0;
+			if (!drbr_empty(ifp, pq->bufring)) {
+				taskqueue_enqueue(pq->taskq, &pq->task);
+			}
+		}
 	}
 
 	PTNET_Q_UNLOCK(pq);


More information about the svn-soc-all mailing list