aboutsummaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorVincenzo Maffione <vmaffione@FreeBSD.org>2020-06-25 19:35:43 +0000
committerVincenzo Maffione <vmaffione@FreeBSD.org>2020-06-25 19:35:43 +0000
commit88a688663a5992f47e96062cb25f2fb1fc3b9437 (patch)
tree0e0f526f69bbcee814ed13f8dc58130bbde4e06f /sys/net
parente3981394150dab0d36ccbd30b21aeb9732cb7f56 (diff)
downloadsrc-88a688663a5992f47e96062cb25f2fb1fc3b9437.tar.gz
src-88a688663a5992f47e96062cb25f2fb1fc3b9437.zip
iflib: netmap: add per-tx-queue netmap support
Reviewed by: gallatin MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25253
Notes
Notes: svn path=/head/; revision=362621
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/iflib.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index 6a7e12354e40..755b3d283170 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -1235,7 +1235,9 @@ iflib_netmap_timer_adjust(if_ctx_t ctx, iflib_txq_t txq, uint32_t *reset_on)
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,
@@ -3756,20 +3758,12 @@ _task_fn_tx(void *context)
#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))
@@ -3784,6 +3778,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