socsvn commit: r305588 - soc2016/vincenzo/head/sys/dev/netmap
vincenzo at FreeBSD.org
vincenzo at FreeBSD.org
Mon Jun 27 12:48:56 UTC 2016
Author: vincenzo
Date: Mon Jun 27 12:48:55 2016
New Revision: 305588
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305588
Log:
freebsd: ptnet_transmit: ptnet_sync_tail when running out of slots
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 Jun 27 12:48:45 2016 (r305587)
+++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c Mon Jun 27 12:48:55 2016 (r305588)
@@ -1219,16 +1219,26 @@
ring = kring->ring;
lim = kring->nkr_num_slots - 1;
- /* Update hwcur and hwtail (completed TX slots) as known by the host,
- * by reading from CSB. */
- ptnet_sync_tail(ptring, kring);
-
+ /* Initialize transmission state variables. */
head = ring->head;
slot = ring->slot + head;
nmbuf = NMB(na, slot);
nmbuf_bytes = 0;
- while (head != ring->tail) {
+ for (;;) {
+ if (head == ring->tail) {
+ /* We ran out of slot, let's see if the host has
+ * freed up some, by reading hwcur and hwtail from
+ * the CSB. */
+ ptnet_sync_tail(ptring, kring);
+ }
+
+ if (head == ring->tail) {
+ /* Still no slots available, let's stop and wait
+ * for interrupts. */
+ break;
+ }
+
m = drbr_peek(ifp, pq->bufring);
if (!m) {
break;
More information about the svn-soc-all
mailing list