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
492 tfp = find_tfp_by_pid(pid); in set_pid_tclass()
493 if (tfp == NULL) { in set_pid_tclass()
494 tfp = alloc_tclass_for_proc(pid, NULL); in set_pid_tclass()
495 if (tfp == NULL) { in set_pid_tclass()
501 tfp->tfp_class = tclass; in set_pid_tclass()
502 tfp->tfp_qos_mode = so_tcdbg->so_tcbbg_qos_mode; in set_pid_tclass()
506 if (tfp != NULL) { in set_pid_tclass()
524 if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_ENABLE) { in set_pid_tclass()
526 } else if (tfp->tfp_qos_mode == QOS_MODE_MARKING_POLICY_DISABLE) { in set_pid_tclass()
557 struct tclass_for_proc *tfp; in set_pname_tclass() local
561 tfp = find_tfp_by_pname(so_tcdbg->so_tcdbg_pname); in set_pname_tclass()
562 if (tfp == NULL) { in set_pname_tclass()
563 tfp = alloc_tclass_for_proc(-1, so_tcdbg->so_tcdbg_pname); in set_pname_tclass()
564 if (tfp == NULL) { in set_pname_tclass()
570 tfp->tfp_class = so_tcdbg->so_tcdbg_tclass; in set_pname_tclass()
571 tfp->tfp_qos_mode = so_tcdbg->so_tcbbg_qos_mode; in set_pname_tclass()
627 struct tclass_for_proc *tfp; in get_pid_tclass() local
641 tfp = find_tfp_by_pid(pid); in get_pid_tclass()
642 if (tfp != NULL) { in get_pid_tclass()
643 so_tcdbg->so_tcdbg_tclass = tfp->tfp_class; in get_pid_tclass()
644 so_tcdbg->so_tcbbg_qos_mode = tfp->tfp_qos_mode; in get_pid_tclass()
660 struct tclass_for_proc *tfp; in get_pname_tclass() local
667 tfp = find_tfp_by_pname(so_tcdbg->so_tcdbg_pname); in get_pname_tclass()
668 if (tfp != NULL) { in get_pname_tclass()
669 so_tcdbg->so_tcdbg_tclass = tfp->tfp_class; in get_pname_tclass()
670 so_tcdbg->so_tcbbg_qos_mode = tfp->tfp_qos_mode; in get_pname_tclass()
683 struct tclass_for_proc *tfp = NULL; in delete_tclass_for_pid_pname() local
688 tfp = find_tfp_by_pid(pid); in delete_tclass_for_pid_pname()
690 tfp = find_tfp_by_pname(so_tcdbg->so_tcdbg_pname); in delete_tclass_for_pid_pname()
693 if (tfp != NULL) { in delete_tclass_for_pid_pname()
694 free_tclass_for_proc(tfp); in delete_tclass_for_pid_pname()
789 struct tclass_for_proc *tfp; in sogetopt_tcdbg() local
811 TAILQ_FOREACH(tfp, &tfp_head, tfp_link) { in sogetopt_tcdbg()
815 if (tfp->tfp_pid != -1) { in sogetopt_tcdbg()
817 ptr->so_tcdbg_pid = tfp->tfp_pid; in sogetopt_tcdbg()
822 tfp->tfp_pname, in sogetopt_tcdbg()
825 ptr->so_tcdbg_tclass = tfp->tfp_class; in sogetopt_tcdbg()
826 ptr->so_tcbbg_qos_mode = tfp->tfp_qos_mode; in sogetopt_tcdbg()