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

Function xlp_msgring_config

freebsd/mips/nlm/cms.c:415–448  ·  view source on GitHub ↗

* Initialize the messaging subsystem. * * Message Stations are shared among all threads in a cpu core, this * has to be called once from every core which is online. */

Source from the content-addressed store, hash-verified

413 * has to be called once from every core which is online.
414 */
415static void
416xlp_msgring_config(void *arg)
417{
418 void *cookie;
419 unsigned int thrmask, mask;
420 int i;
421
422 /* used polled handler for Ax silion */
423 if (nlm_is_xlp8xx_ax())
424 polled = 1;
425
426 /* Don't poll on all threads, if polled */
427 if (polled)
428 xlp_msg_threads_per_core -= 1;
429
430 mtx_init(&msgmap_lock, "msgring", NULL, MTX_SPIN);
431 if (xlp_threads_per_core < xlp_msg_threads_per_core)
432 xlp_msg_threads_per_core = xlp_threads_per_core;
433 thrmask = ((1 << xlp_msg_threads_per_core) - 1);
434 mask = 0;
435 for (i = 0; i < XLP_MAX_CORES; i++) {
436 mask <<= XLP_MAX_THREADS;
437 mask |= thrmask;
438 }
439 xlp_msg_thread_mask = xlp_hw_thread_mask & mask;
440#if 0
441 printf("CMS Message handler thread mask %#jx\n",
442 (uintmax_t)xlp_msg_thread_mask);
443#endif
444 xlp_cms_credit_setup(CMS_DEFAULT_CREDIT);
445 create_msgring_thread(0);
446 cpu_establish_hardintr("msgring", msgring_process_fast_intr, NULL,
447 NULL, IRQ_MSGRING, INTR_TYPE_NET, &cookie);
448}
449
450/*
451 * Start message ring processing threads on other CPUs, after SMP start

Callers

nothing calls this directly

Calls 6

nlm_is_xlp8xx_axFunction · 0.85
mtx_initFunction · 0.85
xlp_cms_credit_setupFunction · 0.85
create_msgring_threadFunction · 0.85
cpu_establish_hardintrFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected