From owner-svn-src-stable@freebsd.org Wed Jun 10 19:59:12 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82DDD33DD5C; Wed, 10 Jun 2020 19:59:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49hyVm2vsnz4TwB; Wed, 10 Jun 2020 19:59:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F3CEBDDC; Wed, 10 Jun 2020 19:59:12 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05AJxCwp025828; Wed, 10 Jun 2020 19:59:12 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05AJxCDN025827; Wed, 10 Jun 2020 19:59:12 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <202006101959.05AJxCDN025827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 10 Jun 2020 19:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362021 - stable/12/sys/dev/virtio/network X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/sys/dev/virtio/network X-SVN-Commit-Revision: 362021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 19:59:12 -0000 Author: vmaffione Date: Wed Jun 10 19:59:11 2020 New Revision: 362021 URL: https://svnweb.freebsd.org/changeset/base/362021 Log: MFC r361744 netmap: vtnet: honor NM_IRQ_RESCHED The netmap_rx_irq() function may return NM_IRQ_RESCHED to inform the driver that more work is pending, and that netmap expects netmap_rx_irq() to be called again as soon as possible. This change implements this behaviour in the vtnet driver. Modified: stable/12/sys/dev/virtio/network/if_vtnet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/12/sys/dev/virtio/network/if_vtnet.c Wed Jun 10 19:58:03 2020 (r362020) +++ stable/12/sys/dev/virtio/network/if_vtnet.c Wed Jun 10 19:59:11 2020 (r362021) @@ -1853,6 +1853,9 @@ vtnet_rx_vq_intr(void *xrxq) struct vtnet_rxq *rxq; struct ifnet *ifp; int tries, more; +#ifdef DEV_NETMAP + int nmirq; +#endif /* DEV_NETMAP */ rxq = xrxq; sc = rxq->vtnrx_sc; @@ -1871,8 +1874,13 @@ vtnet_rx_vq_intr(void *xrxq) } #ifdef DEV_NETMAP - if (netmap_rx_irq(ifp, rxq->vtnrx_id, &more) != NM_IRQ_PASS) + nmirq = netmap_rx_irq(ifp, rxq->vtnrx_id, &more); + if (nmirq != NM_IRQ_PASS) { + if (nmirq == NM_IRQ_RESCHED) { + taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); + } return; + } #endif /* DEV_NETMAP */ VTNET_RXQ_LOCK(rxq); @@ -1908,10 +1916,23 @@ vtnet_rxq_tq_intr(void *xrxq, int pending) struct vtnet_rxq *rxq; struct ifnet *ifp; int more; +#ifdef DEV_NETMAP + int nmirq; +#endif /* DEV_NETMAP */ rxq = xrxq; sc = rxq->vtnrx_sc; ifp = sc->vtnet_ifp; + +#ifdef DEV_NETMAP + nmirq = netmap_rx_irq(ifp, rxq->vtnrx_id, &more); + if (nmirq != NM_IRQ_PASS) { + if (nmirq == NM_IRQ_RESCHED) { + taskqueue_enqueue(rxq->vtnrx_tq, &rxq->vtnrx_intrtask); + } + return; + } +#endif /* DEV_NETMAP */ VTNET_RXQ_LOCK(rxq);