socsvn commit: r306416 - soc2016/vincenzo/head/sys/dev/netmap
vincenzo at FreeBSD.org
vincenzo at FreeBSD.org
Mon Jul 18 09:08:04 UTC 2016
Author: vincenzo
Date: Mon Jul 18 09:08:03 2016
New Revision: 306416
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=306416
Log:
freebsd: ptnet_ring_update: generalize it, so that can be used by ptnet_rx_eof
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 18 09:07:52 2016 (r306415)
+++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c Mon Jul 18 09:08:03 2016 (r306416)
@@ -1565,7 +1565,7 @@
static void
ptnet_ring_update(struct ptnet_queue *pq, struct netmap_kring *kring,
- unsigned int head)
+ unsigned int head, unsigned int sync_flags)
{
struct netmap_ring *ring = kring->ring;
struct ptnet_ring *ptring = pq->ptring;
@@ -1575,14 +1575,14 @@
* and head in the CSB. */
ring->head = ring->cur = head;
- /* nm_txsync_prologue */
- kring->rcur = kring->rhead = ring->head;
+ /* Mimic nm_txsync_prologue/nm_rxsync_prologue. */
+ kring->rcur = kring->rhead = head;
ptnetmap_guest_write_kring_csb(ptring, kring->rcur, kring->rhead);
/* Kick the host if needed. */
if (NM_ACCESS_ONCE(ptring->host_need_kick)) {
- ptring->sync_flags = NAF_FORCE_RECLAIM;
+ ptring->sync_flags = sync_flags;
bus_write_4(pq->sc->iomem, pq->kick, 0);
}
}
@@ -1752,12 +1752,12 @@
if (++batch_count == PTNET_TX_BATCH) {
batch_count = 0;
- ptnet_ring_update(pq, kring, head);
+ ptnet_ring_update(pq, kring, head, NAF_FORCE_RECLAIM);
}
}
if (batch_count) {
- ptnet_ring_update(pq, kring, head);
+ ptnet_ring_update(pq, kring, head, NAF_FORCE_RECLAIM);
}
PTNET_Q_UNLOCK(pq);
More information about the svn-soc-all
mailing list