static void usdf_cm_msg_connreq_cleanup(struct usdf_connreq *crp) { struct usdf_ep *ep; struct usdf_pep *pep; struct usdf_fabric *fp; ep = crp->cr_ep; pep = crp->cr_pep; if (pep != NULL) { fp = pep->pep_fabric; } else { fp = ep->ep_domain->dom_fabric; } if (crp->cr_pollitem.pi_rtn != NULL) { (void) epoll_ctl(fp->fab_epollfd, EPOLL_CTL_DEL, crp->cr_sockfd, NULL); crp->cr_pollitem.pi_rtn = NULL; } if (crp->cr_sockfd != -1) { close(crp->cr_sockfd); crp->cr_sockfd = -1; } /* If there is a passive endpoint, recycle the crp */ if (pep != NULL) { if (TAILQ_ON_LIST(crp, cr_link)) { TAILQ_REMOVE(&pep->pep_cr_pending, crp, cr_link); } TAILQ_INSERT_TAIL(&pep->pep_cr_free, crp, cr_link); } else { free(crp); } }
static inline void usdf_msg_ep_has_ack(struct usdf_ep *ep) { struct usdf_tx *tx; struct usdf_domain *udp; if (!TAILQ_ON_LIST(ep, e.msg.ep_ack_link)) { tx = ep->ep_tx; udp = ep->ep_domain; TAILQ_INSERT_TAIL(&tx->t.msg.tx_ep_have_acks, ep, e.msg.ep_ack_link); /* Add TX to domain list if not present */ if (!TAILQ_ON_LIST(tx, tx_link)) { TAILQ_INSERT_TAIL(&udp->dom_tx_ready, tx, tx_link); } } }
static inline void usdf_msg_ep_ready(struct usdf_ep *ep) { struct usdf_tx *tx; tx = ep->ep_tx; if (!TAILQ_ON_LIST(ep, e.msg.ep_link)) { ep->e.msg.ep_fairness_credits = USDF_MSG_FAIRNESS_CREDITS; TAILQ_INSERT_TAIL(&tx->t.msg.tx_ep_ready, ep, e.msg.ep_link); /* Make sure TX is on domain ready list */ if (!TAILQ_ON_LIST(tx, tx_link)) { TAILQ_INSERT_TAIL(&tx->tx_domain->dom_tx_ready, tx, tx_link); } } }
/* * If this TX has sends to do and is not on domain ready list, then * this completion means we can go back on the domain ready list */ static void usdf_msg_send_completion(struct usd_completion *comp) { struct usdf_tx *tx; tx = comp->uc_context; if (!TAILQ_EMPTY(&tx->t.msg.tx_ep_ready) && !TAILQ_ON_LIST(tx, tx_link)) { TAILQ_INSERT_TAIL(&tx->tx_domain->dom_tx_ready, tx, tx_link); } }