MCPcopy Create free account
hub / github.com/F-Stack/f-stack / find_nth

Function find_nth

freebsd/net/iflib.c:5932–5950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5930
5931#ifdef SMP
5932static int
5933find_nth(if_ctx_t ctx, int qid)
5934{
5935 cpuset_t cpus;
5936 int i, cpuid, eqid, count;
5937
5938 CPU_COPY(&ctx->ifc_cpus, &cpus);
5939 count = CPU_COUNT(&cpus);
5940 eqid = qid % count;
5941 /* clear up to the qid'th bit */
5942 for (i = 0; i < eqid; i++) {
5943 cpuid = CPU_FFS(&cpus);
5944 MPASS(cpuid != 0);
5945 CPU_CLR(cpuid-1, &cpus);
5946 }
5947 cpuid = CPU_FFS(&cpus);
5948 MPASS(cpuid != 0);
5949 return (cpuid-1);
5950}
5951
5952#ifdef SCHED_ULE
5953extern struct cpu_group *cpu_top; /* CPU topology */

Callers 1

iflib_irq_set_affinityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected