Lines Matching defs:path
227 * path basis. To send a message the pathend needs to have a credit and
331 extern void rsmka_enqueue_msgbuf(path_t *path, void *data);
332 extern void rsmka_dequeue_msgbuf(path_t *path);
333 extern msgbuf_elem_t *rsmka_gethead_msgbuf(path_t *path);
511 int rsmipc_send_controlmsg(path_t *path, int msgtype);
3741 path_t *path = (path_t *)arg;
3748 mutex_enter(&path->mutex);
3751 * If path is not active no point in sending the ACK
3753 * when the path becomes active.
3755 if (path->state != RSMKA_PATH_ACTIVE) {
3757 * decrement the path refcnt incremented in rsm_proc_sqready
3759 PATH_RELE_NOLOCK(path);
3760 mutex_exit(&path->mutex);
3767 (void) rsmipc_send_controlmsg(path, RSMIPC_MSG_SQREADY_ACK);
3770 path->sendq_token.msgbuf_avail = RSMIPC_MAX_MESSAGES;
3773 cv_broadcast(&path->sendq_token.sendq_cv);
3776 * decrement the path refcnt since we incremented it in
3779 PATH_RELE_NOLOCK(path);
3781 mutex_exit(&path->mutex);
3796 path_t *path;
3802 /* look up the path - incr the path refcnt */
3803 path = rsm_find_path(hdlr_argp->adapter_name,
3807 * No path exists or path is not active - drop the message
3809 if (path == NULL) {
3811 "rsm_proc_sqready done: msg dropped no path\n"));
3815 mutex_exit(&path->mutex);
3818 taskq_wait(path->recv_taskq);
3820 mutex_enter(&path->mutex);
3827 path->flags &= ~RSMKA_WAIT_FOR_SQACK;
3829 if (path->state != RSMKA_PATH_ACTIVE) {
3831 PATH_RELE_NOLOCK(path);
3832 mutex_exit(&path->mutex);
3834 "rsm_proc_sqready done: msg dropped path !ACTIVE\n"));
3838 DBG_PRINTF((category, RSM_DEBUG, "rsm_proc_sqready:path=%lx "
3839 " src=%lx:%llx\n", path, msghdr->rsmipc_src, src_hwaddr));
3843 * number save it in the path data structure
3845 path->remote_incn = msg->rsmipc_local_incn;
3846 path->sendq_token.msgbuf_avail = 0;
3847 path->procmsg_cnt = 0;
3850 * path is active - dispatch task to send SQREADY_ACK - remember
3857 * The path refcnt will be decremented in rsm_sqready_ack_deferred.
3859 (void) taskq_dispatch(path->recv_taskq,
3860 rsm_sqready_ack_deferred, path, KM_NOSLEEP);
3862 mutex_exit(&path->mutex);
3877 path_t *path;
3884 /* look up the path - incr the path refcnt */
3885 path = rsm_find_path(hdlr_argp->adapter_name,
3889 * drop the message if - no path exists or path is not active
3892 if (path == NULL) {
3894 "rsm_proc_sqready_ack done: msg dropped no path\n"));
3898 if ((path->state != RSMKA_PATH_ACTIVE) ||
3899 !(path->flags & RSMKA_WAIT_FOR_SQACK)) {
3901 PATH_RELE_NOLOCK(path);
3902 mutex_exit(&path->mutex);
3912 if (path->local_incn != msghdr->rsmipc_incn) {
3914 PATH_RELE_NOLOCK(path);
3915 mutex_exit(&path->mutex);
3922 DBG_PRINTF((category, RSM_DEBUG, "rsm_proc_sqready_ack:path=%lx "
3923 " src=%lx:%llx\n", path, msghdr->rsmipc_src, src_hwaddr));
3928 path->flags &= ~RSMKA_WAIT_FOR_SQACK;
3931 path->remote_incn = msg->rsmipc_local_incn;
3934 path->sendq_token.msgbuf_avail = RSMIPC_MAX_MESSAGES;
3937 cv_broadcast(&path->sendq_token.sendq_cv);
3940 PATH_RELE_NOLOCK(path);
3942 mutex_exit(&path->mutex);
3957 path_t *path;
3964 /* look up the path - incr the path refcnt */
3965 path = rsm_find_path(hdlr_argp->adapter_name,
3968 if (path == NULL) {
3970 "rsm_add_credits enter: path not found\n"));
3974 /* the path is not active - discard credits */
3975 if (path->state != RSMKA_PATH_ACTIVE) {
3976 PATH_RELE_NOLOCK(path);
3977 mutex_exit(&path->mutex);
3979 "rsm_add_credits enter:path=%lx !ACTIVE\n", path));
3984 * Check if these credits are for current incarnation of the path.
3986 if (path->local_incn != msghdr->rsmipc_incn) {
3988 PATH_RELE_NOLOCK(path);
3989 mutex_exit(&path->mutex);
3997 "rsm_add_credits:path=%lx new-creds=%d "
3998 "curr credits=%d src=%lx:%llx\n", path, msg->rsmipc_credits,
3999 path->sendq_token.msgbuf_avail, msghdr->rsmipc_src,
4003 /* add credits to the path's sendq */
4004 path->sendq_token.msgbuf_avail += msg->rsmipc_credits;
4006 ASSERT(path->sendq_token.msgbuf_avail <= RSMIPC_MAX_MESSAGES);
4009 cv_broadcast(&path->sendq_token.sendq_cv);
4012 PATH_RELE_NOLOCK(path);
4014 mutex_exit(&path->mutex);
4889 path_t *path = (path_t *)arg;
4901 mutex_enter(&path->mutex);
4904 head = rsmka_gethead_msgbuf(path);
4906 mutex_exit(&path->mutex);
4946 mutex_enter(&path->mutex);
4948 rsmka_dequeue_msgbuf(path);
4951 if (path->procmsg_cnt < RSMIPC_MAX_MESSAGES)
4952 path->procmsg_cnt++;
4954 ASSERT(path->procmsg_cnt <= RSMIPC_MAX_MESSAGES);
4956 /* No need to send credits if path is going down */
4957 if ((path->state == RSMKA_PATH_ACTIVE) &&
4958 (path->procmsg_cnt >= RSMIPC_LOTSFREE_MSGBUFS)) {
4963 e = rsmipc_send_controlmsg(path, RSMIPC_MSG_CREDIT);
4965 path->procmsg_cnt = 0;
4972 * decrement the path refcnt since we incremented it in
4975 PATH_RELE_NOLOCK(path);
4977 mutex_exit(&path->mutex);
4991 path_t *path;
5000 /* look up the path - incr the path refcnt */
5001 path = rsm_find_path(hdlr_argp->adapter_name,
5004 /* the path has been removed - drop this message */
5005 if (path == NULL) {
5010 /* the path is not active - don't accept new messages */
5011 if (path->state != RSMKA_PATH_ACTIVE) {
5012 PATH_RELE_NOLOCK(path);
5013 mutex_exit(&path->mutex);
5016 " path=%lx !ACTIVE\n", path));
5022 * of the path/sendq.
5024 if (path->local_incn != msghdr->rsmipc_incn) {
5026 PATH_RELE_NOLOCK(path);
5027 mutex_exit(&path->mutex);
5034 /* copy and enqueue msg on the path's msgbuf queue */
5035 rsmka_enqueue_msgbuf(path, data);
5042 (void) taskq_dispatch(path->recv_taskq,
5043 rsm_intr_proc_deferred, path, KM_NOSLEEP);
5045 mutex_exit(&path->mutex);
5062 path_t *path;
5069 /* look up the path - incr the path refcnt */
5070 path = rsm_find_path(hdlr_argp->adapter_name,
5073 if (path == NULL) {
5075 "rsm_sqcreateop_callback done: no path\n"));
5079 if ((path->state == RSMKA_PATH_UP) &&
5080 (path->flags & RSMKA_SQCREATE_PENDING)) {
5086 (void) rsmka_do_path_active(path, RSMKA_NO_SLEEP);
5089 PATH_RELE_NOLOCK(path);
5091 mutex_exit(&path->mutex);
5299 path_t *path;
5408 path = SQ_TOKEN_TO_PATH(sendq_token);
5409 adapter = path->local_adapter;
5414 "rsmipc_send: path=%lx sendq_hdl=%lx\n", path, ipc_handle));
5426 * path's remote_incn field. No need to grab any lock
5427 * since we have refcnted the path in rsmka_get_sendq_token
5429 req->rsmipc_hdr.rsmipc_incn = path->remote_incn;
5437 mutex_enter(&path->mutex);
5439 * wait till we recv credits or path goes down. If path
5444 (path->state == RSMKA_PATH_ACTIVE)) {
5446 &path->mutex);
5448 mutex_exit(&path->mutex);
5459 * path is not active retry on another path.
5461 if (path->state != RSMKA_PATH_ACTIVE) {
5462 mutex_exit(&path->mutex);
5466 "rsm: rsmipc_send: path !ACTIVE"));
5477 mutex_exit(&path->mutex);
5483 mutex_enter(&path->mutex);
5490 mutex_exit(&path->mutex);
5524 reply->rsmipc_hdr.rsmipc_incn = path->remote_incn;
5563 * path's remote_incn field. No need to grab any lock
5564 * since we have refcnted the path in rsmka_get_sendq_token
5566 req->rsmipc_hdr.rsmipc_incn = path->remote_incn;
5574 mutex_enter(&path->mutex);
5576 * wait till we recv credits or path goes down. If path
5581 (path->state == RSMKA_PATH_ACTIVE)) {
5583 &path->mutex);
5585 mutex_exit(&path->mutex);
5597 * path is not active retry on another path.
5599 if (path->state != RSMKA_PATH_ACTIVE) {
5600 mutex_exit(&path->mutex);
5606 "rsm: rsmipc_send: path !ACTIVE"));
5617 mutex_exit(&path->mutex);
5623 mutex_enter(&path->mutex);
5630 mutex_exit(&path->mutex);
5867 * This function takes path and sends a message using the sendq
5872 rsmipc_send_controlmsg(path_t *path, int msgtype)
5886 ASSERT(MUTEX_HELD(&path->mutex));
5888 adapter = path->local_adapter;
5890 DBG_PRINTF((category, RSM_DEBUG, "rsmipc_send_controlmsg:path=%lx "
5891 "msgtype=%d %lx:%llx->%lx:%llx procmsg=%d\n", path, msgtype,
5892 my_nodeid, adapter->hwaddr, path->remote_node,
5893 path->remote_hwaddr, path->procmsg_cnt));
5895 if (path->state != RSMKA_PATH_ACTIVE) {
5901 ipc_handle = path->sendq_token.rsmpi_sendq_handle;
5906 msg.rsmipc_hdr.rsmipc_incn = path->remote_incn;
5909 msg.rsmipc_credits = path->procmsg_cnt;
5911 msg.rsmipc_local_incn = path->local_incn;
5914 /* incr the sendq, path refcnt */
5915 PATH_HOLD_NOLOCK(path);
5916 SENDQ_TOKEN_HOLD(path);
5919 /* drop the path lock before doing the rsm_send */
5920 mutex_exit(&path->mutex);
5932 mutex_enter(&path->mutex);
5944 (void) cv_reltimedwait(&path->sendq_token.sendq_cv,
5945 &path->mutex, drv_usectohz(10000), TR_CLOCK_TICK);
5948 } while (path->state == RSMKA_PATH_ACTIVE);
5950 /* decrement the sendq,path refcnt that we incr before rsm_send */
5951 SENDQ_TOKEN_RELE(path);
5952 PATH_RELE_NOLOCK(path);