Lines Matching refs:te

508 	struct tcb_histent *te;  in alloc_tcb_histent()  local
512 te = malloc(sizeof(*te), M_CXGBE, M_ZERO | flags); in alloc_tcb_histent()
513 if (te == NULL) in alloc_tcb_histent()
515 mtx_init(&te->te_lock, "TCB entry", NULL, MTX_DEF); in alloc_tcb_histent()
516 callout_init_mtx(&te->te_callout, &te->te_lock, 0); in alloc_tcb_histent()
517 te->te_adapter = sc; in alloc_tcb_histent()
518 te->te_tid = tid; in alloc_tcb_histent()
520 return (te); in alloc_tcb_histent()
524 free_tcb_histent(struct tcb_histent *te) in free_tcb_histent() argument
527 mtx_destroy(&te->te_lock); in free_tcb_histent()
528 free(te, M_CXGBE); in free_tcb_histent()
537 struct tcb_histent *te = NULL; in add_tid_to_history() local
552 te = alloc_tcb_histent(sc, tid, M_NOWAIT); in add_tid_to_history()
553 if (te == NULL) { in add_tid_to_history()
557 mtx_lock(&te->te_lock); in add_tid_to_history()
560 te->te_flags |= TE_RPL_PENDING; in add_tid_to_history()
561 td->tcb_history[tid] = te; in add_tid_to_history()
563 free(te, M_CXGBE); in add_tid_to_history()
565 mtx_unlock(&te->te_lock); in add_tid_to_history()
572 remove_tcb_histent(struct tcb_histent *te) in remove_tcb_histent() argument
574 struct adapter *sc = te->te_adapter; in remove_tcb_histent()
578 mtx_assert(&te->te_lock, MA_OWNED); in remove_tcb_histent()
579 MPASS(td->tcb_history[te->te_tid] == te); in remove_tcb_histent()
581 td->tcb_history[te->te_tid] = NULL; in remove_tcb_histent()
582 free_tcb_histent(te); in remove_tcb_histent()
589 struct tcb_histent *te; in lookup_tcb_histent() local
602 te = td->tcb_history[tid]; in lookup_tcb_histent()
603 if (te != NULL) { in lookup_tcb_histent()
604 mtx_lock(&te->te_lock); in lookup_tcb_histent()
605 return (te); /* with both locks held */ in lookup_tcb_histent()
612 return (te); in lookup_tcb_histent()
616 release_tcb_histent(struct tcb_histent *te) in release_tcb_histent() argument
618 struct adapter *sc = te->te_adapter; in release_tcb_histent()
621 mtx_assert(&te->te_lock, MA_OWNED); in release_tcb_histent()
622 mtx_unlock(&te->te_lock); in release_tcb_histent()
630 struct tcb_histent *te = arg; in request_tcb() local
632 mtx_assert(&te->te_lock, MA_OWNED); in request_tcb()
635 MPASS(!(te->te_flags & TE_RPL_PENDING)); in request_tcb()
636 if (send_get_tcb(te->te_adapter, te->te_tid) == 0) in request_tcb()
637 te->te_flags |= TE_RPL_PENDING; in request_tcb()
639 callout_schedule(&te->te_callout, hz / 100); in request_tcb()
643 update_tcb_histent(struct tcb_histent *te, const uint64_t *tcb) in update_tcb_histent() argument
645 struct tom_data *td = te->te_adapter->tom_softc; in update_tcb_histent()
689 te->te_sample[te->te_pidx] = sample; in update_tcb_histent()
690 if (++te->te_pidx == nitems(te->te_sample)) in update_tcb_histent()
691 te->te_pidx = 0; in update_tcb_histent()
692 memcpy(te->te_tcb, tcb, TCB_SIZE); in update_tcb_histent()
693 te->te_flags |= TE_ACTIVE; in update_tcb_histent()
702 struct tcb_histent *te; in do_get_tcb_rpl() local
707 te = lookup_tcb_histent(sc, tid, remove); in do_get_tcb_rpl()
708 if (te == NULL) { in do_get_tcb_rpl()
718 MPASS(te->te_flags & TE_RPL_PENDING); in do_get_tcb_rpl()
719 te->te_flags &= ~TE_RPL_PENDING; in do_get_tcb_rpl()
721 remove_tcb_histent(te); in do_get_tcb_rpl()
723 update_tcb_histent(te, tcb); in do_get_tcb_rpl()
724 callout_reset(&te->te_callout, hz / 10, request_tcb, te); in do_get_tcb_rpl()
725 release_tcb_histent(te); in do_get_tcb_rpl()
771 fill_tcp_info_from_history(struct adapter *sc, struct tcb_histent *te, in fill_tcp_info_from_history() argument
775 fill_tcp_info_from_tcb(sc, te->te_tcb, ti); in fill_tcp_info_from_history()
811 struct tcb_histent *te; in fill_tcp_info() local
814 te = lookup_tcb_histent(sc, tid, false); in fill_tcp_info()
815 if (te != NULL) { in fill_tcp_info()
816 fill_tcp_info_from_history(sc, te, ti); in fill_tcp_info()
817 release_tcb_histent(te); in fill_tcp_info()