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

Function get_core_offset

freebsd/net/iflib.c:6031–6046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6029#endif
6030
6031static int
6032get_core_offset(if_ctx_t ctx, iflib_intr_type_t type, int qid)
6033{
6034 switch (type) {
6035 case IFLIB_INTR_TX:
6036 /* TX queues get cores which share at least an L2 cache with the corresponding RX queue */
6037 /* XXX handle multiple RX threads per core and more than two core per L2 group */
6038 return qid / CPU_COUNT(&ctx->ifc_cpus) + 1;
6039 case IFLIB_INTR_RX:
6040 case IFLIB_INTR_RXTX:
6041 /* RX queues get the specified core */
6042 return qid / CPU_COUNT(&ctx->ifc_cpus);
6043 default:
6044 return -1;
6045 }
6046}
6047#else
6048#define get_core_offset(ctx, type, qid) CPU_FIRST()
6049#define find_close_core(cpuid, tid) CPU_FIRST()

Callers 1

iflib_irq_set_affinityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected