Lines Matching refs:bps
557 struct nm_bdg_polling_state *bps; member
584 bna = nbk->bps->bna; in netmap_bwrap_polling()
594 nm_bdg_create_kthreads(struct nm_bdg_polling_state *bps) in nm_bdg_create_kthreads() argument
599 bps->kthreads = nm_os_malloc(sizeof(struct nm_bdg_kthread) * bps->ncpus); in nm_bdg_create_kthreads()
600 if (bps->kthreads == NULL) in nm_bdg_create_kthreads()
605 for (i = 0; i < bps->ncpus; i++) { in nm_bdg_create_kthreads()
606 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_create_kthreads()
607 int all = (bps->ncpus == 1 && in nm_bdg_create_kthreads()
608 bps->mode == NETMAP_POLLING_MODE_SINGLE_CPU); in nm_bdg_create_kthreads()
609 int affinity = bps->cpu_from + i; in nm_bdg_create_kthreads()
611 t->bps = bps; in nm_bdg_create_kthreads()
612 t->qfirst = all ? bps->qfirst /* must be 0 */: affinity; in nm_bdg_create_kthreads()
613 t->qlast = all ? bps->qlast : t->qfirst + 1; in nm_bdg_create_kthreads()
630 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_create_kthreads()
633 nm_os_free(bps->kthreads); in nm_bdg_create_kthreads()
639 nm_bdg_polling_start_kthreads(struct nm_bdg_polling_state *bps) in nm_bdg_polling_start_kthreads() argument
643 if (!bps) { in nm_bdg_polling_start_kthreads()
647 bps->stopped = false; in nm_bdg_polling_start_kthreads()
649 for (i = 0; i < bps->ncpus; i++) { in nm_bdg_polling_start_kthreads()
650 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_polling_start_kthreads()
661 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_polling_start_kthreads()
664 bps->stopped = true; in nm_bdg_polling_start_kthreads()
669 nm_bdg_polling_stop_delete_kthreads(struct nm_bdg_polling_state *bps) in nm_bdg_polling_stop_delete_kthreads() argument
673 if (!bps) in nm_bdg_polling_stop_delete_kthreads()
676 for (i = 0; i < bps->ncpus; i++) { in nm_bdg_polling_stop_delete_kthreads()
677 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_polling_stop_delete_kthreads()
681 bps->stopped = true; in nm_bdg_polling_stop_delete_kthreads()
686 struct nm_bdg_polling_state *bps) in get_polling_cfg() argument
733 bps->mode = req->nr_mode; in get_polling_cfg()
734 bps->qfirst = qfirst; in get_polling_cfg()
735 bps->qlast = qlast; in get_polling_cfg()
736 bps->cpu_from = core_from; in get_polling_cfg()
737 bps->ncpus = req_cpus; in get_polling_cfg()
748 struct nm_bdg_polling_state *bps; in nm_bdg_ctl_polling_start() local
758 bps = nm_os_malloc(sizeof(*bps)); in nm_bdg_ctl_polling_start()
759 if (!bps) in nm_bdg_ctl_polling_start()
761 bps->configured = false; in nm_bdg_ctl_polling_start()
762 bps->stopped = true; in nm_bdg_ctl_polling_start()
764 if (get_polling_cfg(req, na, bps)) { in nm_bdg_ctl_polling_start()
765 nm_os_free(bps); in nm_bdg_ctl_polling_start()
769 if (nm_bdg_create_kthreads(bps)) { in nm_bdg_ctl_polling_start()
770 nm_os_free(bps); in nm_bdg_ctl_polling_start()
774 bps->configured = true; in nm_bdg_ctl_polling_start()
775 bna->na_polling_state = bps; in nm_bdg_ctl_polling_start()
776 bps->bna = bna; in nm_bdg_ctl_polling_start()
781 error = nm_bdg_polling_start_kthreads(bps); in nm_bdg_ctl_polling_start()
784 nm_os_free(bps->kthreads); in nm_bdg_ctl_polling_start()
785 nm_os_free(bps); in nm_bdg_ctl_polling_start()
796 struct nm_bdg_polling_state *bps; in nm_bdg_ctl_polling_stop() local
802 bps = bna->na_polling_state; in nm_bdg_ctl_polling_stop()
804 bps->configured = false; in nm_bdg_ctl_polling_stop()
805 nm_os_free(bps); in nm_bdg_ctl_polling_stop()