Lines Matching refs:bps

702 	struct nm_bdg_polling_state *bps;  member
729 bna = nbk->bps->bna; in netmap_bwrap_polling()
739 nm_bdg_create_kthreads(struct nm_bdg_polling_state *bps) in nm_bdg_create_kthreads() argument
744 bps->kthreads = nm_os_malloc(sizeof(struct nm_bdg_kthread) * bps->ncpus); in nm_bdg_create_kthreads()
745 if (bps->kthreads == NULL) in nm_bdg_create_kthreads()
750 for (i = 0; i < bps->ncpus; i++) { in nm_bdg_create_kthreads()
751 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_create_kthreads()
752 int all = (bps->ncpus == 1 && in nm_bdg_create_kthreads()
753 bps->mode == NETMAP_POLLING_MODE_SINGLE_CPU); in nm_bdg_create_kthreads()
754 int affinity = bps->cpu_from + i; in nm_bdg_create_kthreads()
756 t->bps = bps; in nm_bdg_create_kthreads()
757 t->qfirst = all ? bps->qfirst /* must be 0 */: affinity; in nm_bdg_create_kthreads()
758 t->qlast = all ? bps->qlast : t->qfirst + 1; in nm_bdg_create_kthreads()
775 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_create_kthreads()
778 nm_os_free(bps->kthreads); in nm_bdg_create_kthreads()
784 nm_bdg_polling_start_kthreads(struct nm_bdg_polling_state *bps) in nm_bdg_polling_start_kthreads() argument
788 if (!bps) { in nm_bdg_polling_start_kthreads()
792 bps->stopped = false; in nm_bdg_polling_start_kthreads()
794 for (i = 0; i < bps->ncpus; i++) { in nm_bdg_polling_start_kthreads()
795 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_polling_start_kthreads()
806 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_polling_start_kthreads()
809 bps->stopped = true; in nm_bdg_polling_start_kthreads()
814 nm_bdg_polling_stop_delete_kthreads(struct nm_bdg_polling_state *bps) in nm_bdg_polling_stop_delete_kthreads() argument
818 if (!bps) in nm_bdg_polling_stop_delete_kthreads()
821 for (i = 0; i < bps->ncpus; i++) { in nm_bdg_polling_stop_delete_kthreads()
822 struct nm_bdg_kthread *t = bps->kthreads + i; in nm_bdg_polling_stop_delete_kthreads()
826 bps->stopped = true; in nm_bdg_polling_stop_delete_kthreads()
831 struct nm_bdg_polling_state *bps) in get_polling_cfg() argument
878 bps->mode = req->nr_mode; in get_polling_cfg()
879 bps->qfirst = qfirst; in get_polling_cfg()
880 bps->qlast = qlast; in get_polling_cfg()
881 bps->cpu_from = core_from; in get_polling_cfg()
882 bps->ncpus = req_cpus; in get_polling_cfg()
893 struct nm_bdg_polling_state *bps; in nm_bdg_ctl_polling_start() local
903 bps = nm_os_malloc(sizeof(*bps)); in nm_bdg_ctl_polling_start()
904 if (!bps) in nm_bdg_ctl_polling_start()
906 bps->configured = false; in nm_bdg_ctl_polling_start()
907 bps->stopped = true; in nm_bdg_ctl_polling_start()
909 if (get_polling_cfg(req, na, bps)) { in nm_bdg_ctl_polling_start()
910 nm_os_free(bps); in nm_bdg_ctl_polling_start()
914 if (nm_bdg_create_kthreads(bps)) { in nm_bdg_ctl_polling_start()
915 nm_os_free(bps); in nm_bdg_ctl_polling_start()
919 bps->configured = true; in nm_bdg_ctl_polling_start()
920 bna->na_polling_state = bps; in nm_bdg_ctl_polling_start()
921 bps->bna = bna; in nm_bdg_ctl_polling_start()
926 error = nm_bdg_polling_start_kthreads(bps); in nm_bdg_ctl_polling_start()
929 nm_os_free(bps->kthreads); in nm_bdg_ctl_polling_start()
930 nm_os_free(bps); in nm_bdg_ctl_polling_start()
941 struct nm_bdg_polling_state *bps; in nm_bdg_ctl_polling_stop() local
947 bps = bna->na_polling_state; in nm_bdg_ctl_polling_stop()
949 bps->configured = false; in nm_bdg_ctl_polling_stop()
950 nm_os_free(bps); in nm_bdg_ctl_polling_stop()