Date: Tue, 23 Jun 2015 19:28:52 GMT From: stefano@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287507 - soc2015/stefano/ptnetmap/head/sys/dev/virtio/network Message-ID: <201506231928.t5NJSqOK077841@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506231928.t5NJSqOK077841>