From owner-svn-soc-all@freebsd.org Fri Jul 8 15:43:28 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA26BB824D8 for ; Fri, 8 Jul 2016 15:43:28 +0000 (UTC) (envelope-from vincenzo@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 BDAF81166 for ; Fri, 8 Jul 2016 15:43:28 +0000 (UTC) (envelope-from vincenzo@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u68FhSK0007126 for ; Fri, 8 Jul 2016 15:43:28 GMT (envelope-from vincenzo@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u68FhS5a007068 for svn-soc-all@FreeBSD.org; Fri, 8 Jul 2016 15:43:28 GMT (envelope-from vincenzo@FreeBSD.org) Date: Fri, 8 Jul 2016 15:43:28 GMT Message-Id: <201607081543.u68FhS5a007068@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to vincenzo@FreeBSD.org using -f From: vincenzo@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r305823 - soc2016/vincenzo/head/sys/dev/netmap 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.22 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: Fri, 08 Jul 2016 15:43:28 -0000 Author: vincenzo Date: Fri Jul 8 15:43:27 2016 New Revision: 305823 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305823 Log: freebsd: ptnet_rx_eof: simplify budget management and debug prints 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 Fri Jul 8 15:43:19 2016 (r305822) +++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c Fri Jul 8 15:43:27 2016 (r305823) @@ -1549,18 +1549,13 @@ kring->nr_kflags &= ~NKR_PENDINTR; - for (;;) { + do { unsigned int prev_head = head; struct mbuf *mhead, *mtail; struct netmap_slot *slot; unsigned int nmbuf_len; uint8_t *nmbuf, *mdata; - if (budget == 0) { - RD(1, "Run out of budget h %u t %u", head, ring->tail); - break; - } - if (head == ring->tail) { /* We ran out of slot, let's see if the host has * added some, by reading hwcur and hwtail from @@ -1682,8 +1677,7 @@ (*ifp->if_input)(ifp, mhead); PTNET_Q_LOCK(pq); - budget--; - } + } while (--budget); escape: if (head != ring->head) { /* Some packets have been pushed to the network stack. @@ -1707,8 +1701,8 @@ if (!budget) { /* If we ran out of budget or the double-check found new * slots to process, schedule the taskqueue. */ - RD(1, "%s: resched: budget %u h %u t %u\n", __func__, - budget, head, ring->tail); + RD(1, "out of budget: resched h %u t %u\n", + head, ring->tail); taskqueue_enqueue(pq->taskq, &pq->task); } }