socsvn commit: r304512 - soc2016/vincenzo/head/sys/dev/netmap
vincenzo at FreeBSD.org
vincenzo at FreeBSD.org
Fri Jun 3 14:07:53 UTC 2016
Author: vincenzo
Date: Fri Jun 3 14:07:52 2016
New Revision: 304512
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=304512
Log:
freebsd: ptnet: implement nm_txsync
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 Jun 3 14:07:37 2016 (r304511)
+++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c Fri Jun 3 14:07:52 2016 (r304512)
@@ -152,6 +152,7 @@
static uint32_t ptnet_nm_ptctl(struct ifnet *ifp, uint32_t cmd);
static int ptnet_nm_config(struct netmap_adapter *na, unsigned *txr,
unsigned *txd, unsigned *rxr, unsigned *rxd);
+static int ptnet_nm_txsync(struct netmap_kring *kring, int flags);
static void ptnet_tx_intr(void *opaque);
static void ptnet_rx_intr(void *opaque);
@@ -331,6 +332,7 @@
na_arg.num_tx_rings = num_tx_rings;
na_arg.num_rx_rings = num_rx_rings;
na_arg.nm_config = ptnet_nm_config;
+ na_arg.nm_txsync = ptnet_nm_txsync;
netmap_pt_guest_attach(&na_arg, sc->csb, nifp_offset, ptnet_nm_ptctl);
@@ -651,6 +653,21 @@
return 0;
}
+static int
+ptnet_nm_txsync(struct netmap_kring *kring, int flags)
+{
+ struct ptnet_softc *sc = kring->na->ifp->if_softc;
+ struct ptnet_queue *pq = sc->queues + kring->ring_id;
+ bool notify;
+
+ notify = netmap_pt_guest_txsync(pq->ptring, kring, flags);
+ if (notify) {
+ bus_write_4(sc->iomem, pq->kick, 0);
+ }
+
+ return 0;
+}
+
static void
ptnet_tx_intr(void *opaque)
{
More information about the svn-soc-all
mailing list