Changeset View
Changeset View
Standalone View
Standalone View
sys/net/iflib.c
Show First 20 Lines • Show All 3,584 Lines • ▼ Show 20 Lines | #endif | ||||
/* TSO parameters - dig these out of the data sheet - simply correspond to tag setup */ | /* TSO parameters - dig these out of the data sheet - simply correspond to tag setup */ | ||||
ifp->if_hw_tsomaxsegcount = scctx->isc_tx_tso_segments_max; | ifp->if_hw_tsomaxsegcount = scctx->isc_tx_tso_segments_max; | ||||
ifp->if_hw_tsomax = scctx->isc_tx_tso_size_max; | ifp->if_hw_tsomax = scctx->isc_tx_tso_size_max; | ||||
ifp->if_hw_tsomaxsegsize = scctx->isc_tx_tso_segsize_max; | ifp->if_hw_tsomaxsegsize = scctx->isc_tx_tso_segsize_max; | ||||
if (scctx->isc_rss_table_size == 0) | if (scctx->isc_rss_table_size == 0) | ||||
scctx->isc_rss_table_size = 64; | scctx->isc_rss_table_size = 64; | ||||
scctx->isc_rss_table_mask = scctx->isc_rss_table_size-1; | scctx->isc_rss_table_mask = scctx->isc_rss_table_size-1; | ||||
GROUPTASK_INIT(&ctx->ifc_admin_task, 0, _task_fn_admin, ctx); | |||||
/* XXX format name */ | |||||
taskqgroup_attach(qgroup_if_config_tqg, &ctx->ifc_admin_task, ctx, -1, "admin"); | |||||
/* | /* | ||||
** Now setup MSI or MSI/X, should | ** Now setup MSI or MSI/X, should | ||||
** return us the number of supported | ** return us the number of supported | ||||
** vectors. (Will be 1 for MSI) | ** vectors. (Will be 1 for MSI) | ||||
*/ | */ | ||||
if (sctx->isc_flags & IFLIB_SKIP_MSIX) { | if (sctx->isc_flags & IFLIB_SKIP_MSIX) { | ||||
msix = scctx->isc_vectors; | msix = scctx->isc_vectors; | ||||
} else if (scctx->isc_msix_bar != 0) | } else if (scctx->isc_msix_bar != 0) | ||||
▲ Show 20 Lines • Show All 736 Lines • ▼ Show 20 Lines | iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid, | ||||
switch (type) { | switch (type) { | ||||
/* XXX merge tx/rx for netmap? */ | /* XXX merge tx/rx for netmap? */ | ||||
case IFLIB_INTR_TX: | case IFLIB_INTR_TX: | ||||
q = &ctx->ifc_txqs[qid]; | q = &ctx->ifc_txqs[qid]; | ||||
info = &ctx->ifc_txqs[qid].ift_filter_info; | info = &ctx->ifc_txqs[qid].ift_filter_info; | ||||
gtask = &ctx->ifc_txqs[qid].ift_task; | gtask = &ctx->ifc_txqs[qid].ift_task; | ||||
tqg = qgroup_if_io_tqg; | tqg = qgroup_if_io_tqg; | ||||
fn = _task_fn_tx; | fn = _task_fn_tx; | ||||
GROUPTASK_INIT(gtask, 0, fn, q); | |||||
break; | break; | ||||
case IFLIB_INTR_RX: | case IFLIB_INTR_RX: | ||||
q = &ctx->ifc_rxqs[qid]; | q = &ctx->ifc_rxqs[qid]; | ||||
info = &ctx->ifc_rxqs[qid].ifr_filter_info; | info = &ctx->ifc_rxqs[qid].ifr_filter_info; | ||||
gtask = &ctx->ifc_rxqs[qid].ifr_task; | gtask = &ctx->ifc_rxqs[qid].ifr_task; | ||||
tqg = qgroup_if_io_tqg; | tqg = qgroup_if_io_tqg; | ||||
fn = _task_fn_rx; | fn = _task_fn_rx; | ||||
GROUPTASK_INIT(gtask, 0, fn, q); | |||||
break; | break; | ||||
case IFLIB_INTR_ADMIN: | case IFLIB_INTR_ADMIN: | ||||
q = ctx; | q = ctx; | ||||
info = &ctx->ifc_filter_info; | info = &ctx->ifc_filter_info; | ||||
gtask = &ctx->ifc_admin_task; | gtask = &ctx->ifc_admin_task; | ||||
tqg = qgroup_if_config_tqg; | tqg = qgroup_if_config_tqg; | ||||
fn = _task_fn_admin; | fn = _task_fn_admin; | ||||
break; | break; | ||||
default: | default: | ||||
panic("unknown net intr type"); | panic("unknown net intr type"); | ||||
} | } | ||||
GROUPTASK_INIT(gtask, 0, fn, q); | |||||
info->ifi_filter = filter; | info->ifi_filter = filter; | ||||
info->ifi_filter_arg = filter_arg; | info->ifi_filter_arg = filter_arg; | ||||
info->ifi_task = gtask; | info->ifi_task = gtask; | ||||
/* XXX query cpu that rid belongs to */ | |||||
err = _iflib_irq_alloc(ctx, irq, rid, iflib_fast_intr, NULL, info, name); | err = _iflib_irq_alloc(ctx, irq, rid, iflib_fast_intr, NULL, info, name); | ||||
if (err != 0) | if (err != 0) { | ||||
device_printf(ctx->ifc_dev, "_iflib_irq_alloc failed %d\n", err); | |||||
return (err); | return (err); | ||||
} | |||||
if (type == IFLIB_INTR_ADMIN) | |||||
return (0); | |||||
if (tqrid != -1) { | if (tqrid != -1) { | ||||
cpuid = find_nth(ctx, &cpus, qid); | cpuid = find_nth(ctx, &cpus, qid); | ||||
taskqgroup_attach_cpu(tqg, gtask, q, cpuid, irq->ii_rid, name); | taskqgroup_attach_cpu(tqg, gtask, q, cpuid, irq->ii_rid, name); | ||||
} else { | } else { | ||||
taskqgroup_attach(tqg, gtask, q, tqrid, name); | taskqgroup_attach(tqg, gtask, q, tqrid, name); | ||||
} | } | ||||
return (0); | return (0); | ||||
Show All 14 Lines | case IFLIB_INTR_TX: | ||||
tqg = qgroup_if_io_tqg; | tqg = qgroup_if_io_tqg; | ||||
fn = _task_fn_tx; | fn = _task_fn_tx; | ||||
break; | break; | ||||
case IFLIB_INTR_RX: | case IFLIB_INTR_RX: | ||||
q = &ctx->ifc_rxqs[qid]; | q = &ctx->ifc_rxqs[qid]; | ||||
gtask = &ctx->ifc_rxqs[qid].ifr_task; | gtask = &ctx->ifc_rxqs[qid].ifr_task; | ||||
tqg = qgroup_if_io_tqg; | tqg = qgroup_if_io_tqg; | ||||
fn = _task_fn_rx; | fn = _task_fn_rx; | ||||
break; | |||||
case IFLIB_INTR_ADMIN: | |||||
q = ctx; | |||||
gtask = &ctx->ifc_admin_task; | |||||
tqg = qgroup_if_config_tqg; | |||||
rid = -1; | |||||
fn = _task_fn_admin; | |||||
break; | break; | ||||
case IFLIB_INTR_IOV: | case IFLIB_INTR_IOV: | ||||
q = ctx; | q = ctx; | ||||
gtask = &ctx->ifc_vflr_task; | gtask = &ctx->ifc_vflr_task; | ||||
tqg = qgroup_if_config_tqg; | tqg = qgroup_if_config_tqg; | ||||
rid = -1; | rid = -1; | ||||
fn = _task_fn_iov; | fn = _task_fn_iov; | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 604 Lines • Show Last 20 Lines |