From owner-svn-soc-all@FreeBSD.ORG Tue Jun 23 19:28:52 2015 Return-Path: Delivered-To: svn-soc-all@nevdull.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5C33E4E for ; Tue, 23 Jun 2015 19:28:52 +0000 (UTC) (envelope-from stefano@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C40D8FDD for ; Tue, 23 Jun 2015 19:28:52 +0000 (UTC) (envelope-from stefano@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5NJSqRb077857 for ; Tue, 23 Jun 2015 19:28:52 GMT (envelope-from stefano@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5NJSqOK077841 for svn-soc-all@FreeBSD.org; Tue, 23 Jun 2015 19:28:52 GMT (envelope-from stefano@FreeBSD.org) Date: Tue, 23 Jun 2015 19:28:52 GMT Message-Id: <201506231928.t5NJSqOK077841@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to stefano@FreeBSD.org using -f From: stefano@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287507 - soc2015/stefano/ptnetmap/head/sys/dev/virtio/network MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2015 19:28:52 -0000 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 +#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++;