* 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. */
| 413 | * has to be called once from every core which is online. |
| 414 | */ |
| 415 | static void |
| 416 | xlp_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 |
nothing calls this directly
no test coverage detected