Lines Matching refs:tfp

312 	struct tclass_for_proc *tfp;  in find_tfp_by_pid()  local
314 TAILQ_FOREACH(tfp, &tfp_head, tfp_link) { in find_tfp_by_pid()
315 if (tfp->tfp_pid == pid) { in find_tfp_by_pid()
319 return tfp; in find_tfp_by_pid()
328 struct tclass_for_proc *tfp; in find_tfp_by_pname() local
330 TAILQ_FOREACH(tfp, &tfp_head, tfp_link) { in find_tfp_by_pname()
331 if (strncmp(pname, tfp->tfp_pname, in find_tfp_by_pname()
332 sizeof(tfp->tfp_pname)) == 0) { in find_tfp_by_pname()
336 return tfp; in find_tfp_by_pname()
342 struct tclass_for_proc *tfp = NULL; in set_tclass_for_curr_proc() local
349 TAILQ_FOREACH(tfp, &tfp_head, tfp_link) { in set_tclass_for_curr_proc()
350 if ((tfp->tfp_pid == pid) || (tfp->tfp_pid == -1 && in set_tclass_for_curr_proc()
351 strncmp(pname, tfp->tfp_pname, in set_tclass_for_curr_proc()
352 sizeof(tfp->tfp_pname)) == 0)) { in set_tclass_for_curr_proc()
353 if (tfp->tfp_class != SO_TC_UNSPEC) { in set_tclass_for_curr_proc()
354 so->so_traffic_class = (uint16_t)tfp->tfp_class; in set_tclass_for_curr_proc()
357 if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_ENABLE) { in set_tclass_for_curr_proc()
359 } else if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_DISABLE) { in set_tclass_for_curr_proc()
376 struct tclass_for_proc *tfp, *tvar; in purge_tclass_for_proc() local
380 TAILQ_FOREACH_SAFE(tfp, &tfp_head, tfp_link, tvar) { in purge_tclass_for_proc()
383 if (tfp->tfp_pid == -1) { in purge_tclass_for_proc()
386 if ((p = proc_find(tfp->tfp_pid)) == NULL) { in purge_tclass_for_proc()
388 TAILQ_REMOVE(&tfp_head, tfp, tfp_link); in purge_tclass_for_proc()
390 kfree_type(struct tclass_for_proc, tfp); in purge_tclass_for_proc()
406 free_tclass_for_proc(struct tclass_for_proc *tfp) in free_tclass_for_proc() argument
408 if (tfp == NULL) { in free_tclass_for_proc()
412 TAILQ_REMOVE(&tfp_head, tfp, tfp_link); in free_tclass_for_proc()
413 kfree_type(struct tclass_for_proc, tfp); in free_tclass_for_proc()
423 struct tclass_for_proc *tfp, *tvar; in flush_tclass_for_proc() local
427 TAILQ_FOREACH_SAFE(tfp, &tfp_head, tfp_link, tvar) { in flush_tclass_for_proc()
428 free_tclass_for_proc(tfp); in flush_tclass_for_proc()
442 struct tclass_for_proc *tfp; in alloc_tclass_for_proc() local
448 tfp = kalloc_type(struct tclass_for_proc, Z_NOWAIT | Z_ZERO); in alloc_tclass_for_proc()
449 if (tfp == NULL) { in alloc_tclass_for_proc()
453 tfp->tfp_pid = pid; in alloc_tclass_for_proc()
459 TAILQ_INSERT_HEAD(&tfp_head, tfp, tfp_link); in alloc_tclass_for_proc()
461 strlcpy(tfp->tfp_pname, pname, sizeof(tfp->tfp_pname)); in alloc_tclass_for_proc()
462 TAILQ_INSERT_TAIL(&tfp_head, tfp, tfp_link); in alloc_tclass_for_proc()
467 return tfp; in alloc_tclass_for_proc()
478 struct tclass_for_proc *tfp; in set_pid_tclass() local
493 tfp = find_tfp_by_pid(pid); in set_pid_tclass()
494 if (tfp == NULL) { in set_pid_tclass()
495 tfp = alloc_tclass_for_proc(pid, NULL); in set_pid_tclass()
496 if (tfp == NULL) { in set_pid_tclass()
502 tfp->tfp_class = tclass; in set_pid_tclass()
503 tfp->tfp_qos_mode = so_tcdbg->so_tcbbg_qos_mode; in set_pid_tclass()
507 if (tfp != NULL) { in set_pid_tclass()
523 if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_ENABLE) { in set_pid_tclass()
525 } else if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_DISABLE) { in set_pid_tclass()
568 struct tclass_for_proc *tfp; in set_pname_tclass() local
572 tfp = find_tfp_by_pname(so_tcdbg->so_tcdbg_pname); in set_pname_tclass()
573 if (tfp == NULL) { in set_pname_tclass()
574 tfp = alloc_tclass_for_proc(-1, so_tcdbg->so_tcdbg_pname); in set_pname_tclass()
575 if (tfp == NULL) { in set_pname_tclass()
581 tfp->tfp_class = so_tcdbg->so_tcdbg_tclass; in set_pname_tclass()
582 tfp->tfp_qos_mode = so_tcdbg->so_tcbbg_qos_mode; in set_pname_tclass()
638 struct tclass_for_proc *tfp; in get_pid_tclass() local
652 tfp = find_tfp_by_pid(pid); in get_pid_tclass()
653 if (tfp != NULL) { in get_pid_tclass()
654 so_tcdbg->so_tcdbg_tclass = tfp->tfp_class; in get_pid_tclass()
655 so_tcdbg->so_tcbbg_qos_mode = tfp->tfp_qos_mode; in get_pid_tclass()
671 struct tclass_for_proc *tfp; in get_pname_tclass() local
678 tfp = find_tfp_by_pname(so_tcdbg->so_tcdbg_pname); in get_pname_tclass()
679 if (tfp != NULL) { in get_pname_tclass()
680 so_tcdbg->so_tcdbg_tclass = tfp->tfp_class; in get_pname_tclass()
681 so_tcdbg->so_tcbbg_qos_mode = tfp->tfp_qos_mode; in get_pname_tclass()
694 struct tclass_for_proc *tfp = NULL; in delete_tclass_for_pid_pname() local
699 tfp = find_tfp_by_pid(pid); in delete_tclass_for_pid_pname()
701 tfp = find_tfp_by_pname(so_tcdbg->so_tcdbg_pname); in delete_tclass_for_pid_pname()
704 if (tfp != NULL) { in delete_tclass_for_pid_pname()
705 free_tclass_for_proc(tfp); in delete_tclass_for_pid_pname()
800 struct tclass_for_proc *tfp; in sogetopt_tcdbg() local
822 TAILQ_FOREACH(tfp, &tfp_head, tfp_link) { in sogetopt_tcdbg()
826 if (tfp->tfp_pid != -1) { in sogetopt_tcdbg()
828 ptr->so_tcdbg_pid = tfp->tfp_pid; in sogetopt_tcdbg()
833 tfp->tfp_pname, in sogetopt_tcdbg()
836 ptr->so_tcdbg_tclass = tfp->tfp_class; in sogetopt_tcdbg()
837 ptr->so_tcbbg_qos_mode = tfp->tfp_qos_mode; in sogetopt_tcdbg()