Changeset d652c3b in rtems-libbsd


Ignore:
Timestamp:
Oct 9, 2013, 12:03:56 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, afaeccc05a556f6aa25ba044a7e49d6aa634a59e, freebsd-9.3, master
Children:
a9f141a
Parents:
e599318
git-author:
Sebastian Huber <sebastian.huber@…> (10/09/13 12:03:56)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/10/13 07:09:19)
Message:

Avoid per-CPU NETISR(9)

SMP support should be enabled once the new stack is ready for this.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • freebsd/sys/net/netisr.c

    re599318 rd652c3b  
    261261} __aligned(CACHE_LINE_SIZE);
    262262
     263#ifndef __rtems__
    263264/*
    264265 * Per-CPU workstream data.
     
    280281SYSCTL_INT(_net_isr, OID_AUTO, numthreads, CTLFLAG_RD,
    281282    &nws_count, 0, "Number of extant netisr threads.");
     283#else /* __rtems__ */
     284static struct netisr_workstream rtems_bsd_nws;
     285#endif /* __rtems__ */
    282286
    283287/*
     
    319323        return (nws_array[cpunumber]);
    320324}
    321 #endif  /* __rtems__ */
    322325
    323326/*
     
    333336        return (nws_array[flowid % nws_count]);
    334337}
     338#endif  /* __rtems__ */
    335339
    336340/*
     
    401405                if (CPU_ABSENT(i))
    402406                        continue;
     407#ifndef __rtems__
    403408                npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
     409#else /* __rtems__ */
     410                npwp = &rtems_bsd_nws.nws_work[proto];
     411#endif /* __rtems__ */
    404412                bzero(npwp, sizeof(*npwp));
    405413                npwp->nw_qlimit = np[proto].np_qlimit;
     
    435443                if (CPU_ABSENT(i))
    436444                        continue;
     445#ifndef __rtems__
    437446                npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
     447#else /* __rtems__ */
     448                npwp = &rtems_bsd_nws.nws_work[proto];
     449#endif /* __rtems__ */
    438450                npwp->nw_qdrops = 0;
    439451        }
     
    470482                if (CPU_ABSENT(i))
    471483                        continue;
     484#ifndef __rtems__
    472485                npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
     486#else /* __rtems__ */
     487                npwp = &rtems_bsd_nws.nws_work[proto];
     488#endif /* __rtems__ */
    473489                *qdropp += npwp->nw_qdrops;
    474490        }
     
    536552                if (CPU_ABSENT(i))
    537553                        continue;
     554#ifndef __rtems__
    538555                npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
     556#else /* __rtems__ */
     557                npwp = &rtems_bsd_nws.nws_work[proto];
     558#endif /* __rtems__ */
    539559                npwp->nw_qlimit = qlimit;
    540560        }
     
    602622                if (CPU_ABSENT(i))
    603623                        continue;
     624#ifndef __rtems__
    604625                npwp = &(DPCPU_ID_PTR(i, nws))->nws_work[proto];
     626#else /* __rtems__ */
     627                npwp = &rtems_bsd_nws.nws_work[proto];
     628#endif /* __rtems__ */
    605629                netisr_drain_proto(npwp);
    606630                bzero(npwp, sizeof(*npwp));
     
    622646        NETISR_LOCK_ASSERT();
    623647
     648#ifndef __rtems__
    624649        /*
    625650         * In the event we have only one worker, shortcut and deliver to it
     
    666691                    npp->np_policy, npp->np_name);
    667692        }
     693#else /* __rtems__ */
     694        *cpuidp = 0;
     695        return (m);
     696#endif /* __rtems__ */
    668697}
    669698
     
    830859        dosignal = 0;
    831860        error = 0;
     861#ifndef __rtems__
    832862        nwsp = DPCPU_ID_PTR(cpuid, nws);
     863#else /* __rtems__ */
     864        nwsp = &rtems_bsd_nws;
     865#endif /* __rtems__ */
    833866        npwp = &nwsp->nws_work[proto];
    834867        NWS_LOCK(nwsp);
     
    10381071        KASSERT(!CPU_ABSENT(cpuid), ("%s: CPU %u absent", __func__, cpuid));
    10391072
     1073#ifndef __rtems__
    10401074        nwsp = DPCPU_ID_PTR(cpuid, nws);
     1075#else /* __rtems__ */
     1076        nwsp = &rtems_bsd_nws;
     1077#endif /* __rtems__ */
    10411078        mtx_init(&nwsp->nws_mtx, "netisr_mtx", NULL, MTX_DEF);
    10421079        nwsp->nws_cpu = cpuid;
     
    10541091                            cpuid, error);
    10551092        }
    1056 #endif
    10571093        NETISR_WLOCK();
    10581094        nws_array[nws_count] = nwsp->nws_cpu;
    10591095        nws_count++;
    10601096        NETISR_WUNLOCK();
     1097#endif
    10611098}
    10621099
  • freebsd/sys/sys/pcpu.h

    re599318 rd652c3b  
    3939
    4040#include <sys/queue.h>
    41 #ifndef __rtems__
    4241#include <sys/vmmeter.h>
    43 #endif
    4442#include <rtems/bsd/sys/resource.h>
    4543#include <machine/pcpu.h>
     
    7674 * Accessors with a given base.
    7775 */
     76#ifndef __rtems__
    7877#define _DPCPU_PTR(b, n)                                                \
    7978    (__typeof(DPCPU_NAME(n))*)((b) + (uintptr_t)&DPCPU_NAME(n))
     79#else /* __rtems__ */
     80#define _DPCPU_PTR(b, n) NULL
     81#endif /* __rtems__ */
    8082#define _DPCPU_GET(b, n)        (*_DPCPU_PTR(b, n))
    8183#define _DPCPU_SET(b, n, v)     (*_DPCPU_PTR(b, n) = v)
  • libbsd.txt

    re599318 rd652c3b  
    4747
    4848== Issues and To Do
     49* Per-CPU data should be enabled once the new stack is ready for SMP.
     50
     51* Per-CPU NETISR(9) should be enabled onece the new stack is ready for SMP.
     52
    4953* Sebastian Huber and Joel Sherrill discussed the need for a a basic USB
    5054  functionality test that is known to work on qemu pc.
Note: See TracChangeset for help on using the changeset viewer.