| 5930 | |
| 5931 | #ifdef SMP |
| 5932 | static int |
| 5933 | find_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 |
| 5953 | extern struct cpu_group *cpu_top; /* CPU topology */ |
no outgoing calls
no test coverage detected