Date: Fri, 10 Jul 2020 18:19:05 +0000 (UTC) From: Vincenzo Maffione <vmaffione@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363082 - stable/12/sys/net Message-ID: <202007101819.06AIJ55F041532@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vmaffione Date: Fri Jul 10 18:19:04 2020 New Revision: 363082 URL: https://svnweb.freebsd.org/changeset/base/363082 Log: MFC r362633, r362633 iflib: netmap: add per-tx-queue netmap support Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D25253 Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Fri Jul 10 17:42:22 2020 (r363081) +++ stable/12/sys/net/iflib.c Fri Jul 10 18:19:04 2020 (r363082) @@ -1240,7 +1240,9 @@ iflib_netmap_timer_adjust(if_ctx_t ctx, iflib_txq_t tx uint16_t txqid; txqid = txq->ift_id; - kring = NA(ctx->ifc_ifp)->tx_rings[txqid]; + kring = netmap_kring_on(NA(ctx->ifc_ifp), txqid, NR_TX); + if (kring == NULL) + return; if (kring->nr_hwcur != nm_next(kring->nr_hwtail, kring->nkr_num_slots - 1)) { bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, @@ -3737,28 +3739,18 @@ _task_fn_tx(void *context) { iflib_txq_t txq = context; if_ctx_t ctx = txq->ift_ctx; -#if defined(ALTQ) || defined(DEV_NETMAP) if_t ifp = ctx->ifc_ifp; -#endif int abdicate = ctx->ifc_sysctl_tx_abdicate; #ifdef IFLIB_DIAGNOSTICS txq->ift_cpu_exec_count[curcpu]++; #endif - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) + if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) return; #ifdef DEV_NETMAP - if (if_getcapenable(ifp) & IFCAP_NETMAP) { - bus_dmamap_sync(txq->ift_ifdi->idi_tag, txq->ift_ifdi->idi_map, - BUS_DMASYNC_POSTREAD); - if (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)) - netmap_tx_irq(ifp, txq->ift_id); - if (ctx->ifc_flags & IFC_LEGACY) - IFDI_INTR_ENABLE(ctx); - else - IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); - return; - } + if ((if_getcapenable(ifp) & IFCAP_NETMAP) && + netmap_tx_irq(ifp, txq->ift_id)) + goto skip_ifmp; #endif #ifdef ALTQ if (ALTQ_IS_ENABLED(&ifp->if_snd)) @@ -3773,6 +3765,9 @@ _task_fn_tx(void *context) */ if (abdicate) ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); +#ifdef DEV_NETMAP +skip_ifmp: +#endif if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); else
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007101819.06AIJ55F041532>