diff options
author | Mark Johnston <markj@FreeBSD.org> | 2024-07-14 16:15:23 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2024-07-14 18:29:15 +0000 |
commit | d254651de392538fa7f5c0020093dde0ca06c614 (patch) | |
tree | 569e7a78764a670fb1476f54257646e937df37f9 | |
parent | dc8357de606aa65fc1c35a43d4a5f1d706164ddb (diff) |
axgbe: Remove a nonsensical use of kernel_sysctlbyname()
No functional change intended.
MFC after: 1 week
-rw-r--r-- | sys/dev/axgbe/if_axgbe_pci.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index 3e68525067fb..320799e77188 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -36,6 +36,7 @@ #include <sys/module.h> #include <sys/mutex.h> #include <sys/rman.h> +#include <sys/smp.h> #include <sys/socket.h> #include <sys/sysctl.h> #include <sys/systm.h> @@ -610,8 +611,6 @@ axgbe_set_counts(if_ctx_t ctx) struct axgbe_if_softc *sc = iflib_get_softc(ctx); struct xgbe_prv_data *pdata = &sc->pdata; cpuset_t lcpus; - int cpu_count, err; - size_t len; /* Set all function pointers */ xgbe_init_all_fptrs(pdata); @@ -638,21 +637,12 @@ axgbe_set_counts(if_ctx_t ctx) * number of Rx queues or maximum allowed */ - /* Get cpu count from sysctl */ - len = sizeof(cpu_count); - err = kernel_sysctlbyname(curthread, "hw.ncpu", &cpu_count, &len, NULL, - 0, NULL, 0); - if (err) { - axgbe_error("Unable to fetch number of cpus\n"); - cpu_count = 1; - } - if (bus_get_cpus(pdata->dev, INTR_CPUS, sizeof(lcpus), &lcpus) != 0) { axgbe_error("Unable to fetch CPU list\n"); /* TODO - handle CPU_COPY(&all_cpus, &lcpus); */ } - DBGPR("ncpu %d intrcpu %d\n", cpu_count, CPU_COUNT(&lcpus)); + DBGPR("ncpu %d intrcpu %d\n", mp_ncpus, CPU_COUNT(&lcpus)); pdata->tx_ring_count = min(CPU_COUNT(&lcpus), pdata->hw_feat.tx_ch_cnt); pdata->tx_ring_count = min(pdata->tx_ring_count, |