Lines Matching refs:tfp

313 	struct tclass_for_proc *tfp;  in find_tfp_by_pid()  local
315 TAILQ_FOREACH(tfp, &tfp_head, tfp_link) { in find_tfp_by_pid()
316 if (tfp->tfp_pid == pid) { in find_tfp_by_pid()
320 return tfp; in find_tfp_by_pid()
329 struct tclass_for_proc *tfp; in find_tfp_by_pname() local
331 TAILQ_FOREACH(tfp, &tfp_head, tfp_link) { in find_tfp_by_pname()
332 if (strlcmp(tfp->tfp_pname, pname, in find_tfp_by_pname()
333 sizeof(tfp->tfp_pname)) == 0) { in find_tfp_by_pname()
337 return tfp; in find_tfp_by_pname()
343 struct tclass_for_proc *tfp = NULL; in set_tclass_for_curr_proc() local
350 TAILQ_FOREACH(tfp, &tfp_head, tfp_link) { in set_tclass_for_curr_proc()
351 if ((tfp->tfp_pid == pid) || (tfp->tfp_pid == -1 && in set_tclass_for_curr_proc()
352 strlcmp(tfp->tfp_pname, pname, in set_tclass_for_curr_proc()
353 sizeof(tfp->tfp_pname)) == 0)) { in set_tclass_for_curr_proc()
354 if (tfp->tfp_class != SO_TC_UNSPEC) { in set_tclass_for_curr_proc()
355 so->so_traffic_class = (uint16_t)tfp->tfp_class; in set_tclass_for_curr_proc()
358 if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_ENABLE) { in set_tclass_for_curr_proc()
360 } else if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_DISABLE) { in set_tclass_for_curr_proc()
377 struct tclass_for_proc *tfp, *tvar; in purge_tclass_for_proc() local
381 TAILQ_FOREACH_SAFE(tfp, &tfp_head, tfp_link, tvar) { in purge_tclass_for_proc()
384 if (tfp->tfp_pid == -1) { in purge_tclass_for_proc()
387 if ((p = proc_find(tfp->tfp_pid)) == NULL) { in purge_tclass_for_proc()
389 TAILQ_REMOVE(&tfp_head, tfp, tfp_link); in purge_tclass_for_proc()
391 kfree_type(struct tclass_for_proc, tfp); in purge_tclass_for_proc()
407 free_tclass_for_proc(struct tclass_for_proc *tfp) in free_tclass_for_proc() argument
409 if (tfp == NULL) { in free_tclass_for_proc()
413 TAILQ_REMOVE(&tfp_head, tfp, tfp_link); in free_tclass_for_proc()
414 kfree_type(struct tclass_for_proc, tfp); in free_tclass_for_proc()
424 struct tclass_for_proc *tfp, *tvar; in flush_tclass_for_proc() local
428 TAILQ_FOREACH_SAFE(tfp, &tfp_head, tfp_link, tvar) { in flush_tclass_for_proc()
429 free_tclass_for_proc(tfp); in flush_tclass_for_proc()
443 struct tclass_for_proc *tfp; in alloc_tclass_for_proc() local
449 tfp = kalloc_type(struct tclass_for_proc, Z_NOWAIT | Z_ZERO); in alloc_tclass_for_proc()
450 if (tfp == NULL) { in alloc_tclass_for_proc()
454 tfp->tfp_pid = pid; in alloc_tclass_for_proc()
460 TAILQ_INSERT_HEAD(&tfp_head, tfp, tfp_link); in alloc_tclass_for_proc()
463 strbufcpy(tfp->tfp_pname, sizeof(tfp->tfp_pname), in alloc_tclass_for_proc()
466 tfp->tfp_pname[0] = '\0'; in alloc_tclass_for_proc()
468 TAILQ_INSERT_TAIL(&tfp_head, tfp, tfp_link); in alloc_tclass_for_proc()
473 return tfp; in alloc_tclass_for_proc()
484 struct tclass_for_proc *tfp; in set_pid_tclass() local
499 tfp = find_tfp_by_pid(pid); in set_pid_tclass()
500 if (tfp == NULL) { in set_pid_tclass()
501 tfp = alloc_tclass_for_proc(pid, NULL, 0); in set_pid_tclass()
502 if (tfp == NULL) { in set_pid_tclass()
507 tfp->tfp_class = tclass; in set_pid_tclass()
508 tfp->tfp_qos_mode = so_tcdbg->so_tcbbg_qos_mode; in set_pid_tclass()
510 if (tfp != NULL) { in set_pid_tclass()
526 if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_ENABLE) { in set_pid_tclass()
528 } else if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_DISABLE) { in set_pid_tclass()
573 struct tclass_for_proc *tfp; in set_pname_tclass() local
577 tfp = find_tfp_by_pname(__unsafe_null_terminated_from_indexable(so_tcdbg->so_tcdbg_pname)); in set_pname_tclass()
578 if (tfp == NULL) { in set_pname_tclass()
579 tfp = alloc_tclass_for_proc(-1, so_tcdbg->so_tcdbg_pname, in set_pname_tclass()
581 if (tfp == NULL) { in set_pname_tclass()
587 tfp->tfp_class = so_tcdbg->so_tcdbg_tclass; in set_pname_tclass()
588 tfp->tfp_qos_mode = so_tcdbg->so_tcbbg_qos_mode; in set_pname_tclass()
644 struct tclass_for_proc *tfp; in get_pid_tclass() local
658 tfp = find_tfp_by_pid(pid); in get_pid_tclass()
659 if (tfp != NULL) { in get_pid_tclass()
660 so_tcdbg->so_tcdbg_tclass = tfp->tfp_class; in get_pid_tclass()
661 so_tcdbg->so_tcbbg_qos_mode = tfp->tfp_qos_mode; in get_pid_tclass()
677 struct tclass_for_proc *tfp; in get_pname_tclass() local
684 tfp = find_tfp_by_pname(__unsafe_null_terminated_from_indexable(so_tcdbg->so_tcdbg_pname)); in get_pname_tclass()
685 if (tfp != NULL) { in get_pname_tclass()
686 so_tcdbg->so_tcdbg_tclass = tfp->tfp_class; in get_pname_tclass()
687 so_tcdbg->so_tcbbg_qos_mode = tfp->tfp_qos_mode; in get_pname_tclass()
700 struct tclass_for_proc *tfp = NULL; in delete_tclass_for_pid_pname() local
705 tfp = find_tfp_by_pid(pid); in delete_tclass_for_pid_pname()
707 tfp = find_tfp_by_pname(__unsafe_null_terminated_from_indexable(so_tcdbg->so_tcdbg_pname)); in delete_tclass_for_pid_pname()
710 if (tfp != NULL) { in delete_tclass_for_pid_pname()
711 free_tclass_for_proc(tfp); in delete_tclass_for_pid_pname()
806 struct tclass_for_proc *tfp; in sogetopt_tcdbg() local
828 TAILQ_FOREACH(tfp, &tfp_head, tfp_link) { in sogetopt_tcdbg()
832 if (tfp->tfp_pid != -1) { in sogetopt_tcdbg()
834 ptr->so_tcdbg_pid = tfp->tfp_pid; in sogetopt_tcdbg()
839 tfp->tfp_pname); in sogetopt_tcdbg()
841 ptr->so_tcdbg_tclass = tfp->tfp_class; in sogetopt_tcdbg()
842 ptr->so_tcbbg_qos_mode = tfp->tfp_qos_mode; in sogetopt_tcdbg()