• Home
  • Raw
  • Download

Lines Matching refs:agent

48 	struct ib_mad_agent_private *agent;  member
88 void ib_cancel_rmpp_recvs(struct ib_mad_agent_private *agent) in ib_cancel_rmpp_recvs() argument
93 spin_lock_irqsave(&agent->lock, flags); in ib_cancel_rmpp_recvs()
94 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) { in ib_cancel_rmpp_recvs()
99 spin_unlock_irqrestore(&agent->lock, flags); in ib_cancel_rmpp_recvs()
101 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) { in ib_cancel_rmpp_recvs()
106 flush_workqueue(agent->qp_info->port_priv->wq); in ib_cancel_rmpp_recvs()
109 &agent->rmpp_list, list) { in ib_cancel_rmpp_recvs()
142 msg = ib_create_send_mad(&rmpp_recv->agent->agent, recv_wc->wc->src_qp, in ack_recv()
156 static struct ib_mad_send_buf *alloc_response_msg(struct ib_mad_agent *agent, in alloc_response_msg() argument
163 ah = ib_create_ah_from_wc(agent->qp->pd, recv_wc->wc, in alloc_response_msg()
164 recv_wc->recv_buf.grh, agent->port_num); in alloc_response_msg()
169 msg = ib_create_send_mad(agent, recv_wc->wc->src_qp, in alloc_response_msg()
183 static void ack_ds_ack(struct ib_mad_agent_private *agent, in ack_ds_ack() argument
190 msg = alloc_response_msg(&agent->agent, recv_wc); in ack_ds_ack()
217 static void nack_recv(struct ib_mad_agent_private *agent, in nack_recv() argument
224 msg = alloc_response_msg(&agent->agent, recv_wc); in nack_recv()
253 spin_lock_irqsave(&rmpp_recv->agent->lock, flags); in recv_timeout_handler()
255 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags); in recv_timeout_handler()
260 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags); in recv_timeout_handler()
263 nack_recv(rmpp_recv->agent, rmpp_wc, IB_MGMT_RMPP_STATUS_T2L); in recv_timeout_handler()
274 spin_lock_irqsave(&rmpp_recv->agent->lock, flags); in recv_cleanup_handler()
276 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags); in recv_cleanup_handler()
280 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags); in recv_cleanup_handler()
285 create_rmpp_recv(struct ib_mad_agent_private *agent, in create_rmpp_recv() argument
295 rmpp_recv->ah = ib_create_ah_from_wc(agent->agent.qp->pd, in create_rmpp_recv()
298 agent->agent.port_num); in create_rmpp_recv()
302 rmpp_recv->agent = agent; in create_rmpp_recv()
332 find_rmpp_recv(struct ib_mad_agent_private *agent, in find_rmpp_recv() argument
338 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) { in find_rmpp_recv()
351 acquire_rmpp_recv(struct ib_mad_agent_private *agent, in acquire_rmpp_recv() argument
357 spin_lock_irqsave(&agent->lock, flags); in acquire_rmpp_recv()
358 rmpp_recv = find_rmpp_recv(agent, mad_recv_wc); in acquire_rmpp_recv()
361 spin_unlock_irqrestore(&agent->lock, flags); in acquire_rmpp_recv()
366 insert_rmpp_recv(struct ib_mad_agent_private *agent, in insert_rmpp_recv() argument
371 cur_rmpp_recv = find_rmpp_recv(agent, rmpp_recv->rmpp_wc); in insert_rmpp_recv()
373 list_add_tail(&rmpp_recv->list, &agent->rmpp_list); in insert_rmpp_recv()
403 static inline int window_size(struct ib_mad_agent_private *agent) in window_size() argument
405 return max(agent->qp_info->recv_queue.max_active >> 3, 1); in window_size()
440 bool opa = rdma_cap_opa_mad(rmpp_recv->agent->qp_info->port_priv->device, in get_mad_len()
441 rmpp_recv->agent->qp_info->port_priv->port_num); in get_mad_len()
472 queue_delayed_work(rmpp_recv->agent->qp_info->port_priv->wq, in complete_rmpp()
478 continue_rmpp(struct ib_mad_agent_private *agent, in continue_rmpp() argument
487 rmpp_recv = acquire_rmpp_recv(agent, mad_recv_wc); in continue_rmpp()
519 rmpp_recv->newwin += window_size(agent); in continue_rmpp()
537 start_rmpp(struct ib_mad_agent_private *agent, in start_rmpp() argument
543 rmpp_recv = create_rmpp_recv(agent, mad_recv_wc); in start_rmpp()
549 spin_lock_irqsave(&agent->lock, flags); in start_rmpp()
550 if (insert_rmpp_recv(agent, rmpp_recv)) { in start_rmpp()
551 spin_unlock_irqrestore(&agent->lock, flags); in start_rmpp()
554 return continue_rmpp(agent, mad_recv_wc); in start_rmpp()
560 spin_unlock_irqrestore(&agent->lock, flags); in start_rmpp()
563 spin_unlock_irqrestore(&agent->lock, flags); in start_rmpp()
565 queue_delayed_work(agent->qp_info->port_priv->wq, in start_rmpp()
568 rmpp_recv->newwin += window_size(agent); in start_rmpp()
607 static void abort_send(struct ib_mad_agent_private *agent, in abort_send() argument
614 spin_lock_irqsave(&agent->lock, flags); in abort_send()
615 mad_send_wr = ib_find_send_mad(agent, mad_recv_wc); in abort_send()
624 spin_unlock_irqrestore(&agent->lock, flags); in abort_send()
632 spin_unlock_irqrestore(&agent->lock, flags); in abort_send()
647 static void process_ds_ack(struct ib_mad_agent_private *agent, in process_ds_ack() argument
652 rmpp_recv = find_rmpp_recv(agent, mad_recv_wc); in process_ds_ack()
657 static void process_rmpp_ack(struct ib_mad_agent_private *agent, in process_rmpp_ack() argument
667 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_ack()
668 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_ack()
675 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_W2S); in process_rmpp_ack()
676 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_W2S); in process_rmpp_ack()
680 spin_lock_irqsave(&agent->lock, flags); in process_rmpp_ack()
681 mad_send_wr = ib_find_send_mad(agent, mad_recv_wc); in process_rmpp_ack()
684 process_ds_ack(agent, mad_recv_wc, newwin); in process_rmpp_ack()
690 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
691 ack_ds_ack(agent, mad_recv_wc); in process_rmpp_ack()
701 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
702 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_S2B); in process_rmpp_ack()
703 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_S2B); in process_rmpp_ack()
721 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
732 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
733 ack_ds_ack(agent, mad_recv_wc); in process_rmpp_ack()
748 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
752 process_rmpp_data(struct ib_mad_agent_private *agent, in process_rmpp_data() argument
770 return start_rmpp(agent, mad_recv_wc); in process_rmpp_data()
776 return continue_rmpp(agent, mad_recv_wc); in process_rmpp_data()
779 nack_recv(agent, mad_recv_wc, rmpp_status); in process_rmpp_data()
784 static void process_rmpp_stop(struct ib_mad_agent_private *agent, in process_rmpp_stop() argument
792 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_stop()
793 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_stop()
795 abort_send(agent, mad_recv_wc, rmpp_mad->rmpp_hdr.rmpp_status); in process_rmpp_stop()
798 static void process_rmpp_abort(struct ib_mad_agent_private *agent, in process_rmpp_abort() argument
807 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_abort()
808 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_abort()
810 abort_send(agent, mad_recv_wc, rmpp_mad->rmpp_hdr.rmpp_status); in process_rmpp_abort()
814 ib_process_rmpp_recv_wc(struct ib_mad_agent_private *agent, in ib_process_rmpp_recv_wc() argument
824 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_UNV); in ib_process_rmpp_recv_wc()
825 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_UNV); in ib_process_rmpp_recv_wc()
831 return process_rmpp_data(agent, mad_recv_wc); in ib_process_rmpp_recv_wc()
833 process_rmpp_ack(agent, mad_recv_wc); in ib_process_rmpp_recv_wc()
836 process_rmpp_stop(agent, mad_recv_wc); in ib_process_rmpp_recv_wc()
839 process_rmpp_abort(agent, mad_recv_wc); in ib_process_rmpp_recv_wc()
842 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BADT); in ib_process_rmpp_recv_wc()
843 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BADT); in ib_process_rmpp_recv_wc()
853 struct ib_mad_agent_private *agent = mad_send_wr->mad_agent_priv; in init_newwin() local
863 spin_lock_irqsave(&agent->lock, flags); in init_newwin()
864 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) { in init_newwin()
879 spin_unlock_irqrestore(&agent->lock, flags); in init_newwin()