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

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



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