Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jul 2016 07:43:22 GMT
From:      vincenzo@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r305709 - soc2016/vincenzo/head/sys/dev/netmap
Message-ID:  <201607040743.u647hMcp050050@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607040743.u647hMcp050050>