From owner-svn-soc-all@freebsd.org Mon Jul 4 07:43:23 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 2D86BB91CBA for ; Mon, 4 Jul 2016 07:43:23 +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 213C925D6 for ; Mon, 4 Jul 2016 07:43:23 +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 u647hM3p050052 for ; Mon, 4 Jul 2016 07:43:23 GMT (envelope-from vincenzo@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u647hMcp050050 for svn-soc-all@FreeBSD.org; Mon, 4 Jul 2016 07:43:22 GMT (envelope-from vincenzo@FreeBSD.org) Date: Mon, 4 Jul 2016 07:43:22 GMT Message-Id: <201607040743.u647hMcp050050@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: r305709 - 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: Mon, 04 Jul 2016 07:43:23 -0000 Author: vincenzo Date: Mon Jul 4 07:43:22 2016 New Revision: 305709 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305709 Log: freebsd: ptnet_transmit: assert we cannot run out of slots while transmitting 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 Mon Jul 4 07:43:12 2016 (r305708) +++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c Mon Jul 4 07:43:22 2016 (r305709) @@ -1301,16 +1301,8 @@ slot->flags = NS_MOREFRAG; head = nm_next(head, lim); - if (head == ring->tail) { - /* Run out of slots while processing - * a packet. Reset head to the previous - * position and requeue the mbuf. */ - RD(1, "%s: Drop, no free slots\n", - __func__); - head = prev_head; - drbr_putback(ifp, pq->bufring, m); - goto escape; - } + KASSERT(head != rina->tail, + "Unexpectedly run out of TX space"); slot = ring->slot + head; nmbuf = NMB(na, slot); nmbuf_bytes = 0; @@ -1331,7 +1323,7 @@ ptnet_ring_update(pq, kring, head); } } -escape: + if (batch_count) { ptnet_ring_update(pq, kring, head); }