Date: Fri, 3 Jun 2016 14:08:04 GMT From: vincenzo@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r304513 - soc2016/vincenzo/head/sys/dev/netmap Message-ID: <201606031408.u53E84RF058974@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vincenzo Date: Fri Jun 3 14:08:03 2016 New Revision: 304513 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=304513 Log: freebsd: ptnet: implement nm_rxsync 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:52 2016 (r304512) +++ soc2016/vincenzo/head/sys/dev/netmap/if_ptnet.c Fri Jun 3 14:08:03 2016 (r304513) @@ -113,6 +113,7 @@ unsigned int num_rings; struct ptnet_queue *queues; + struct ptnet_queue *rxqueues; struct ptnet_csb *csb; struct netmap_pt_guest_adapter *ptna_nm; @@ -153,6 +154,7 @@ 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 int ptnet_nm_rxsync(struct netmap_kring *kring, int flags); static void ptnet_tx_intr(void *opaque); static void ptnet_rx_intr(void *opaque); @@ -263,6 +265,7 @@ err = ENOMEM; goto err_path; } + sc->rxqueues = sc->queues + num_tx_rings; for (i = 0; i < sc->num_rings; i++) { struct ptnet_queue *pq = sc->queues + i; @@ -333,6 +336,7 @@ na_arg.num_rx_rings = num_rx_rings; na_arg.nm_config = ptnet_nm_config; na_arg.nm_txsync = ptnet_nm_txsync; + na_arg.nm_rxsync = ptnet_nm_rxsync; netmap_pt_guest_attach(&na_arg, sc->csb, nifp_offset, ptnet_nm_ptctl); @@ -668,6 +672,21 @@ return 0; } +static int +ptnet_nm_rxsync(struct netmap_kring *kring, int flags) +{ + struct ptnet_softc *sc = kring->na->ifp->if_softc; + struct ptnet_queue *pq = sc->rxqueues + kring->ring_id; + bool notify; + + notify = netmap_pt_guest_rxsync(pq->ptring, kring, flags); + if (notify) { + bus_write_4(sc->iomem, pq->kick, 0); + } + + return 0; +} + static void ptnet_tx_intr(void *opaque) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606031408.u53E84RF058974>