socsvn commit: r287507 - soc2015/stefano/ptnetmap/head/sys/dev/virtio/network

stefano at FreeBSD.org stefano at FreeBSD.org
Tue Jun 23 19:28:52 UTC 2015


Author: stefano
Date: Tue Jun 23 19:28:51 2015
New Revision: 287507
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287507

Log:
  [ptnetmap/virtio] avoid infinite cycle on vtnet_rxq_eof()
  
  When the device is in ptnetmap mode, we left one packet in the
  used rx queue to enable interrupts. So, when we receive an interrupt,
  we must not call vtnet_rxq_enable_intr(rxq) beacuse it returns always
  false since there is the fake packet in the queue.

Modified:
  soc2015/stefano/ptnetmap/head/sys/dev/virtio/network/if_vtnet.c

Modified: soc2015/stefano/ptnetmap/head/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- soc2015/stefano/ptnetmap/head/sys/dev/virtio/network/if_vtnet.c	Tue Jun 23 19:27:12 2015	(r287506)
+++ soc2015/stefano/ptnetmap/head/sys/dev/virtio/network/if_vtnet.c	Tue Jun 23 19:28:51 2015	(r287507)
@@ -290,6 +290,8 @@
 
 #ifdef DEV_NETMAP
 #include <dev/netmap/if_vtnet_netmap.h>
+#else
+#define VTNET_PTNETMAP_ON(_na)        0
 #endif /* DEV_NETMAP */
 
 static driver_t vtnet_driver = {
@@ -1857,7 +1859,7 @@
 	}
 
 	more = vtnet_rxq_eof(rxq);
-	if (more || vtnet_rxq_enable_intr(rxq) != 0) {
+	if (!VTNET_PTNETMAP_ON(NA(ifp)) && (more || vtnet_rxq_enable_intr(rxq) != 0)) {
 		if (!more)
 			vtnet_rxq_disable_intr(rxq);
 		/*
@@ -1894,7 +1896,7 @@
 	}
 
 	more = vtnet_rxq_eof(rxq);
-	if (more || vtnet_rxq_enable_intr(rxq) != 0) {
+	if (!VTNET_PTNETMAP_ON(NA(ifp)) && (more || vtnet_rxq_enable_intr(rxq) != 0)) {
 		if (!more)
 			vtnet_rxq_disable_intr(rxq);
 		rxq->vtnrx_stats.vrxs_rescheduled++;


More information about the svn-soc-all mailing list