mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 00:51:36 +08:00
iflib.c: Deactivate use of ifc_cpus
- cpusets and SMP are currently not supported in libbsd for RTEMS - Disable the ifc_cpus context variable and replace its usage, essentially hard-coding for cpu 0
This commit is contained in:
parent
5cfbb629b6
commit
514ffab353
@ -1837,8 +1837,14 @@ em_if_update_admin_status(if_ctx_t ctx)
|
|||||||
|
|
||||||
if (adapter->hw.mac.type < em_mac_min)
|
if (adapter->hw.mac.type < em_mac_min)
|
||||||
lem_smartspeed(adapter);
|
lem_smartspeed(adapter);
|
||||||
|
#ifdef __rtems__
|
||||||
|
else if (hw->mac.type == e1000_82574 &&
|
||||||
|
adapter->intr_type == IFLIB_INTR_MSIX)
|
||||||
|
E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC);
|
||||||
|
#else /* __rtems__ */
|
||||||
|
|
||||||
E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC);
|
E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC);
|
||||||
|
#endif /* __rtems__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -159,7 +159,9 @@ struct iflib_ctx {
|
|||||||
device_t ifc_dev;
|
device_t ifc_dev;
|
||||||
if_t ifc_ifp;
|
if_t ifc_ifp;
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
cpuset_t ifc_cpus;
|
cpuset_t ifc_cpus;
|
||||||
|
#endif /* __rtems__ */
|
||||||
if_shared_ctx_t ifc_sctx;
|
if_shared_ctx_t ifc_sctx;
|
||||||
struct if_softc_ctx ifc_softc_ctx;
|
struct if_softc_ctx ifc_softc_ctx;
|
||||||
|
|
||||||
@ -4498,6 +4500,7 @@ get_ctx_core_offset(if_ctx_t ctx)
|
|||||||
qc = max(scctx->isc_ntxqsets, scctx->isc_nrxqsets);
|
qc = max(scctx->isc_ntxqsets, scctx->isc_nrxqsets);
|
||||||
|
|
||||||
mtx_lock(&cpu_offset_mtx);
|
mtx_lock(&cpu_offset_mtx);
|
||||||
|
#ifndef __rtems__
|
||||||
SLIST_FOREACH(op, &cpu_offsets, entries) {
|
SLIST_FOREACH(op, &cpu_offsets, entries) {
|
||||||
if (CPU_CMP(&ctx->ifc_cpus, &op->set) == 0) {
|
if (CPU_CMP(&ctx->ifc_cpus, &op->set) == 0) {
|
||||||
ret = op->offset;
|
ret = op->offset;
|
||||||
@ -4507,6 +4510,7 @@ get_ctx_core_offset(if_ctx_t ctx)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* __rtems__ */
|
||||||
if (ret == CORE_OFFSET_UNSPECIFIED) {
|
if (ret == CORE_OFFSET_UNSPECIFIED) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
op = malloc(sizeof(struct cpu_offset), M_IFLIB,
|
op = malloc(sizeof(struct cpu_offset), M_IFLIB,
|
||||||
@ -4517,7 +4521,9 @@ get_ctx_core_offset(if_ctx_t ctx)
|
|||||||
} else {
|
} else {
|
||||||
op->offset = qc;
|
op->offset = qc;
|
||||||
op->refcount = 1;
|
op->refcount = 1;
|
||||||
|
#ifndef __rtems__
|
||||||
CPU_COPY(&ctx->ifc_cpus, &op->set);
|
CPU_COPY(&ctx->ifc_cpus, &op->set);
|
||||||
|
#endif /* __rtems__ */
|
||||||
SLIST_INSERT_HEAD(&cpu_offsets, op, entries);
|
SLIST_INSERT_HEAD(&cpu_offsets, op, entries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4533,7 +4539,11 @@ unref_ctx_core_offset(if_ctx_t ctx)
|
|||||||
|
|
||||||
mtx_lock(&cpu_offset_mtx);
|
mtx_lock(&cpu_offset_mtx);
|
||||||
SLIST_FOREACH_SAFE(op, &cpu_offsets, entries, top) {
|
SLIST_FOREACH_SAFE(op, &cpu_offsets, entries, top) {
|
||||||
|
#ifndef __rtems__
|
||||||
if (CPU_CMP(&ctx->ifc_cpus, &op->set) == 0) {
|
if (CPU_CMP(&ctx->ifc_cpus, &op->set) == 0) {
|
||||||
|
#else /* __rtems__ */
|
||||||
|
{
|
||||||
|
#endif /* __rtems__ */
|
||||||
MPASS(op->refcount > 0);
|
MPASS(op->refcount > 0);
|
||||||
op->refcount--;
|
op->refcount--;
|
||||||
if (op->refcount == 0) {
|
if (op->refcount == 0) {
|
||||||
@ -4647,12 +4657,14 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
|
|||||||
taskqgroup_attach(qgroup_if_config_tqg, &ctx->ifc_admin_task, ctx,
|
taskqgroup_attach(qgroup_if_config_tqg, &ctx->ifc_admin_task, ctx,
|
||||||
NULL, NULL, "admin");
|
NULL, NULL, "admin");
|
||||||
|
|
||||||
|
#ifndef __rtems__
|
||||||
/* Set up cpu set. If it fails, use the set of all CPUs. */
|
/* Set up cpu set. If it fails, use the set of all CPUs. */
|
||||||
if (bus_get_cpus(dev, INTR_CPUS, sizeof(ctx->ifc_cpus), &ctx->ifc_cpus) != 0) {
|
if (bus_get_cpus(dev, INTR_CPUS, sizeof(ctx->ifc_cpus), &ctx->ifc_cpus) != 0) {
|
||||||
device_printf(dev, "Unable to fetch CPU list\n");
|
device_printf(dev, "Unable to fetch CPU list\n");
|
||||||
CPU_COPY(&all_cpus, &ctx->ifc_cpus);
|
CPU_COPY(&all_cpus, &ctx->ifc_cpus);
|
||||||
}
|
}
|
||||||
MPASS(CPU_COUNT(&ctx->ifc_cpus) > 0);
|
MPASS(CPU_COUNT(&ctx->ifc_cpus) > 0);
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Now set up MSI or MSI-X, should return us the number of supported
|
** Now set up MSI or MSI-X, should return us the number of supported
|
||||||
@ -5484,7 +5496,9 @@ iflib_queues_alloc(if_ctx_t ctx)
|
|||||||
txq->ift_br_offset = 0;
|
txq->ift_br_offset = 0;
|
||||||
}
|
}
|
||||||
/* XXX fix this */
|
/* XXX fix this */
|
||||||
|
#ifndef __rtems__
|
||||||
txq->ift_timer.c_cpu = cpu;
|
txq->ift_timer.c_cpu = cpu;
|
||||||
|
#endif /* __rtems__ */
|
||||||
|
|
||||||
if (iflib_txsd_alloc(txq)) {
|
if (iflib_txsd_alloc(txq)) {
|
||||||
device_printf(dev, "Critical Failure setting up TX buffers\n");
|
device_printf(dev, "Critical Failure setting up TX buffers\n");
|
||||||
@ -6291,11 +6305,19 @@ iflib_msix_init(if_ctx_t ctx)
|
|||||||
#else
|
#else
|
||||||
queues = queuemsgs;
|
queues = queuemsgs;
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef __rtems__
|
||||||
queues = imin(CPU_COUNT(&ctx->ifc_cpus), queues);
|
queues = imin(CPU_COUNT(&ctx->ifc_cpus), queues);
|
||||||
|
#else /* __rtems__ */
|
||||||
|
queues = imin(1, queues);
|
||||||
|
#endif /* __rtems__ */
|
||||||
if (bootverbose)
|
if (bootverbose)
|
||||||
device_printf(dev,
|
device_printf(dev,
|
||||||
"intr CPUs: %d queue msgs: %d admincnt: %d\n",
|
"intr CPUs: %d queue msgs: %d admincnt: %d\n",
|
||||||
|
#ifndef __rtems__
|
||||||
CPU_COUNT(&ctx->ifc_cpus), queuemsgs, admincnt);
|
CPU_COUNT(&ctx->ifc_cpus), queuemsgs, admincnt);
|
||||||
|
#else /* __rtems__ */
|
||||||
|
1, queuemsgs, admincnt);
|
||||||
|
#endif /* __rtems__ */
|
||||||
#ifdef RSS
|
#ifdef RSS
|
||||||
/* If we're doing RSS, clamp at the number of RSS buckets */
|
/* If we're doing RSS, clamp at the number of RSS buckets */
|
||||||
if (queues > rss_getnumbuckets())
|
if (queues > rss_getnumbuckets())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user