• 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()
216 static void nack_recv(struct ib_mad_agent_private *agent, in nack_recv() argument
223 msg = alloc_response_msg(&agent->agent, recv_wc); in nack_recv()
252 spin_lock_irqsave(&rmpp_recv->agent->lock, flags); in recv_timeout_handler()
254 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags); in recv_timeout_handler()
259 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags); in recv_timeout_handler()
262 nack_recv(rmpp_recv->agent, rmpp_wc, IB_MGMT_RMPP_STATUS_T2L); in recv_timeout_handler()
273 spin_lock_irqsave(&rmpp_recv->agent->lock, flags); in recv_cleanup_handler()
275 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags); in recv_cleanup_handler()
279 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags); in recv_cleanup_handler()
284 create_rmpp_recv(struct ib_mad_agent_private *agent, in create_rmpp_recv() argument
294 rmpp_recv->ah = ib_create_ah_from_wc(agent->agent.qp->pd, in create_rmpp_recv()
297 agent->agent.port_num); in create_rmpp_recv()
301 rmpp_recv->agent = agent; in create_rmpp_recv()
331 find_rmpp_recv(struct ib_mad_agent_private *agent, in find_rmpp_recv() argument
337 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) { in find_rmpp_recv()
350 acquire_rmpp_recv(struct ib_mad_agent_private *agent, in acquire_rmpp_recv() argument
356 spin_lock_irqsave(&agent->lock, flags); in acquire_rmpp_recv()
357 rmpp_recv = find_rmpp_recv(agent, mad_recv_wc); in acquire_rmpp_recv()
360 spin_unlock_irqrestore(&agent->lock, flags); in acquire_rmpp_recv()
365 insert_rmpp_recv(struct ib_mad_agent_private *agent, in insert_rmpp_recv() argument
370 cur_rmpp_recv = find_rmpp_recv(agent, rmpp_recv->rmpp_wc); in insert_rmpp_recv()
372 list_add_tail(&rmpp_recv->list, &agent->rmpp_list); in insert_rmpp_recv()
402 static inline int window_size(struct ib_mad_agent_private *agent) in window_size() argument
404 return max(agent->qp_info->recv_queue.max_active >> 3, 1); in window_size()
439 bool opa = rdma_cap_opa_mad(rmpp_recv->agent->qp_info->port_priv->device, in get_mad_len()
440 rmpp_recv->agent->qp_info->port_priv->port_num); in get_mad_len()
471 queue_delayed_work(rmpp_recv->agent->qp_info->port_priv->wq, in complete_rmpp()
477 continue_rmpp(struct ib_mad_agent_private *agent, in continue_rmpp() argument
486 rmpp_recv = acquire_rmpp_recv(agent, mad_recv_wc); in continue_rmpp()
518 rmpp_recv->newwin += window_size(agent); in continue_rmpp()
536 start_rmpp(struct ib_mad_agent_private *agent, in start_rmpp() argument
542 rmpp_recv = create_rmpp_recv(agent, mad_recv_wc); in start_rmpp()
548 spin_lock_irqsave(&agent->lock, flags); in start_rmpp()
549 if (insert_rmpp_recv(agent, rmpp_recv)) { in start_rmpp()
550 spin_unlock_irqrestore(&agent->lock, flags); in start_rmpp()
553 return continue_rmpp(agent, mad_recv_wc); in start_rmpp()
559 spin_unlock_irqrestore(&agent->lock, flags); in start_rmpp()
562 spin_unlock_irqrestore(&agent->lock, flags); in start_rmpp()
564 queue_delayed_work(agent->qp_info->port_priv->wq, in start_rmpp()
567 rmpp_recv->newwin += window_size(agent); in start_rmpp()
606 static void abort_send(struct ib_mad_agent_private *agent, in abort_send() argument
613 spin_lock_irqsave(&agent->lock, flags); in abort_send()
614 mad_send_wr = ib_find_send_mad(agent, mad_recv_wc); in abort_send()
623 spin_unlock_irqrestore(&agent->lock, flags); in abort_send()
631 spin_unlock_irqrestore(&agent->lock, flags); in abort_send()
646 static void process_ds_ack(struct ib_mad_agent_private *agent, in process_ds_ack() argument
651 rmpp_recv = find_rmpp_recv(agent, mad_recv_wc); in process_ds_ack()
656 static void process_rmpp_ack(struct ib_mad_agent_private *agent, in process_rmpp_ack() argument
666 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_ack()
667 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_ack()
674 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_W2S); in process_rmpp_ack()
675 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_W2S); in process_rmpp_ack()
679 spin_lock_irqsave(&agent->lock, flags); in process_rmpp_ack()
680 mad_send_wr = ib_find_send_mad(agent, mad_recv_wc); in process_rmpp_ack()
683 process_ds_ack(agent, mad_recv_wc, newwin); in process_rmpp_ack()
689 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
690 ack_ds_ack(agent, mad_recv_wc); in process_rmpp_ack()
700 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
701 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_S2B); in process_rmpp_ack()
702 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_S2B); in process_rmpp_ack()
720 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
731 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
732 ack_ds_ack(agent, mad_recv_wc); in process_rmpp_ack()
747 spin_unlock_irqrestore(&agent->lock, flags); in process_rmpp_ack()
751 process_rmpp_data(struct ib_mad_agent_private *agent, in process_rmpp_data() argument
769 return start_rmpp(agent, mad_recv_wc); in process_rmpp_data()
775 return continue_rmpp(agent, mad_recv_wc); in process_rmpp_data()
778 nack_recv(agent, mad_recv_wc, rmpp_status); in process_rmpp_data()
783 static void process_rmpp_stop(struct ib_mad_agent_private *agent, in process_rmpp_stop() argument
791 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_stop()
792 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_stop()
794 abort_send(agent, mad_recv_wc, rmpp_mad->rmpp_hdr.rmpp_status); in process_rmpp_stop()
797 static void process_rmpp_abort(struct ib_mad_agent_private *agent, in process_rmpp_abort() argument
806 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_abort()
807 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS); in process_rmpp_abort()
809 abort_send(agent, mad_recv_wc, rmpp_mad->rmpp_hdr.rmpp_status); in process_rmpp_abort()
813 ib_process_rmpp_recv_wc(struct ib_mad_agent_private *agent, in ib_process_rmpp_recv_wc() argument
823 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_UNV); in ib_process_rmpp_recv_wc()
824 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_UNV); in ib_process_rmpp_recv_wc()
830 return process_rmpp_data(agent, mad_recv_wc); in ib_process_rmpp_recv_wc()
832 process_rmpp_ack(agent, mad_recv_wc); in ib_process_rmpp_recv_wc()
835 process_rmpp_stop(agent, mad_recv_wc); in ib_process_rmpp_recv_wc()
838 process_rmpp_abort(agent, mad_recv_wc); in ib_process_rmpp_recv_wc()
841 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BADT); in ib_process_rmpp_recv_wc()
842 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BADT); in ib_process_rmpp_recv_wc()
852 struct ib_mad_agent_private *agent = mad_send_wr->mad_agent_priv; in init_newwin() local
862 spin_lock_irqsave(&agent->lock, flags); in init_newwin()
863 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) { in init_newwin()
878 spin_unlock_irqrestore(&agent->lock, flags); in init_newwin()