Lines Matching defs:inputthread
488 ifnet_t ifp, struct dlil_threading_info *inputthread)
492 bzero(inputthread, sizeof(*inputthread));
495 strlcat(inputthread->input_name, "dlil_input_main_thread_mtx", 32);
497 snprintf(inputthread->input_name, 32, "dlil_input_%s%d_mtx", ifp->if_name, ifp->if_unit);
499 inputthread->lck_grp = lck_grp_alloc_init(inputthread->input_name, dlil_grp_attributes);
500 inputthread->input_lck = lck_mtx_alloc_init(inputthread->lck_grp, dlil_lck_attributes);
502 error= kernel_thread_start((thread_continue_t)dlil_input_thread_func, inputthread, &inputthread->input_thread);
504 ml_thread_policy(inputthread->input_thread, MACHINE_GROUP,
511 if (net_affinity && inputthread != dlil_lo_thread_ptr) {
512 struct thread *tp = inputthread->input_thread;
521 inputthread->tag = tag;
522 inputthread->net_affinity = TRUE;
531 inputthread, inputthread->input_thread, dlil_multithreaded_input, cur_dlil_input_threads);
537 struct dlil_threading_info *inputthread)
541 lck_mtx_unlock(inputthread->input_lck);
542 lck_mtx_free(inputthread->input_lck, inputthread->lck_grp);
543 lck_grp_free(inputthread->lck_grp);
545 FREE(inputthread, M_NKE);
712 struct dlil_threading_info *inputthread)
722 lck_mtx_lock(inputthread->input_lck);
725 while ((inputthread->input_waiting & ~DLIL_INPUT_RUNNING) == 0) {
726 inputthread->input_waiting &= ~DLIL_INPUT_RUNNING;
727 msleep(&inputthread->input_waiting, inputthread->input_lck, 0, inputthread->input_name, 0);
731 lck_mtx_assert(inputthread->input_lck, LCK_MTX_ASSERT_OWNED);
733 m = inputthread->mbuf_head;
734 inputthread->mbuf_head = NULL;
735 inputthread->mbuf_tail = NULL;
737 if (inputthread->input_waiting & DLIL_INPUT_TERMINATE) {
741 dlil_terminate_input_thread(inputthread);
745 inputthread->input_waiting |= DLIL_INPUT_RUNNING;
746 inputthread->input_waiting &= ~DLIL_INPUT_WAITING;
748 if (inputthread == dlil_lo_thread_ptr) {
756 mbuf_cnt = inputthread->mbuf_count;
757 inputthread->mbuf_count = 0;
758 if (inputthread == dlil_lo_thread_ptr) {
763 lck_mtx_unlock(inputthread->input_lck);
770 inputthread, count, mbuf_cnt);
773 if (inputthread == dlil_lo_thread_ptr) {
779 inputthread, count, loop_cnt);
785 lck_mtx_unlock(inputthread->input_lck);
795 if (inputthread == dlil_lo_thread_ptr)
800 inputthread, loop_cnt);
809 lck_mtx_lock(inputthread->input_lck);
811 if ((inputthread->input_waiting & (DLIL_PROTO_WAITING | DLIL_PROTO_REGISTER)) != 0) {
812 lck_mtx_unlock(inputthread->input_lck);
816 lck_mtx_unlock(inputthread->input_lck);
2605 struct dlil_threading_info *inputthread;
2656 if ((inputthread = ifp->if_input_thread) != NULL) {
2657 if (inputthread->net_affinity) {
2660 if (inputthread == dlil_lo_thread_ptr)
2664 lck_mtx_lock(inputthread->input_lck);
2665 tp = inputthread->workloop_thread;
2666 inputthread->workloop_thread = NULL;
2667 inputthread->tag = 0;
2668 inputthread->net_affinity = FALSE;
2669 lck_mtx_unlock(inputthread->input_lck);
2679 tp = inputthread->input_thread;
2687 if (inputthread != dlil_lo_thread_ptr) {
2691 inputthread, inputthread->input_thread,
2694 lck_mtx_lock(inputthread->input_lck);
2696 inputthread->input_waiting |= DLIL_INPUT_TERMINATE;
2697 if ((inputthread->input_waiting & DLIL_INPUT_RUNNING) == 0) {
2698 wakeup((caddr_t)&inputthread->input_waiting);
2700 lck_mtx_unlock(inputthread->input_lck);