Lines Matching defs:agent
47 struct ib_mad_agent_private *agent;
86 void ib_cancel_rmpp_recvs(struct ib_mad_agent_private *agent)
91 spin_lock_irqsave(&agent->lock, flags);
92 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) {
97 spin_unlock_irqrestore(&agent->lock, flags);
99 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) {
104 flush_workqueue(agent->qp_info->port_priv->wq);
107 &agent->rmpp_list, list) {
140 msg = ib_create_send_mad(&rmpp_recv->agent->agent, recv_wc->wc->src_qp,
153 static struct ib_mad_send_buf *alloc_response_msg(struct ib_mad_agent *agent,
160 ah = ib_create_ah_from_wc(agent->qp->pd, recv_wc->wc,
161 recv_wc->recv_buf.grh, agent->port_num);
166 msg = ib_create_send_mad(agent, recv_wc->wc->src_qp,
179 static void ack_ds_ack(struct ib_mad_agent_private *agent,
186 msg = alloc_response_msg(&agent->agent, recv_wc);
212 static void nack_recv(struct ib_mad_agent_private *agent,
219 msg = alloc_response_msg(&agent->agent, recv_wc);
248 spin_lock_irqsave(&rmpp_recv->agent->lock, flags);
250 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags);
255 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags);
258 nack_recv(rmpp_recv->agent, rmpp_wc, IB_MGMT_RMPP_STATUS_T2L);
269 spin_lock_irqsave(&rmpp_recv->agent->lock, flags);
271 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags);
275 spin_unlock_irqrestore(&rmpp_recv->agent->lock, flags);
280 create_rmpp_recv(struct ib_mad_agent_private *agent,
290 rmpp_recv->ah = ib_create_ah_from_wc(agent->agent.qp->pd,
293 agent->agent.port_num);
297 rmpp_recv->agent = agent;
326 find_rmpp_recv(struct ib_mad_agent_private *agent,
332 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) {
345 acquire_rmpp_recv(struct ib_mad_agent_private *agent,
351 spin_lock_irqsave(&agent->lock, flags);
352 rmpp_recv = find_rmpp_recv(agent, mad_recv_wc);
355 spin_unlock_irqrestore(&agent->lock, flags);
360 insert_rmpp_recv(struct ib_mad_agent_private *agent,
365 cur_rmpp_recv = find_rmpp_recv(agent, rmpp_recv->rmpp_wc);
367 list_add_tail(&rmpp_recv->list, &agent->rmpp_list);
397 static inline int window_size(struct ib_mad_agent_private *agent)
399 return max(agent->qp_info->recv_queue.max_active >> 3, 1);
457 queue_delayed_work(rmpp_recv->agent->qp_info->port_priv->wq,
463 continue_rmpp(struct ib_mad_agent_private *agent,
472 rmpp_recv = acquire_rmpp_recv(agent, mad_recv_wc);
504 rmpp_recv->newwin += window_size(agent);
522 start_rmpp(struct ib_mad_agent_private *agent,
528 rmpp_recv = create_rmpp_recv(agent, mad_recv_wc);
534 spin_lock_irqsave(&agent->lock, flags);
535 if (insert_rmpp_recv(agent, rmpp_recv)) {
536 spin_unlock_irqrestore(&agent->lock, flags);
539 return continue_rmpp(agent, mad_recv_wc);
545 spin_unlock_irqrestore(&agent->lock, flags);
548 spin_unlock_irqrestore(&agent->lock, flags);
550 queue_delayed_work(agent->qp_info->port_priv->wq,
553 rmpp_recv->newwin += window_size(agent);
591 static void abort_send(struct ib_mad_agent_private *agent,
598 spin_lock_irqsave(&agent->lock, flags);
599 mad_send_wr = ib_find_send_mad(agent, mad_recv_wc);
608 spin_unlock_irqrestore(&agent->lock, flags);
616 spin_unlock_irqrestore(&agent->lock, flags);
631 static void process_ds_ack(struct ib_mad_agent_private *agent,
636 rmpp_recv = find_rmpp_recv(agent, mad_recv_wc);
641 static void process_rmpp_ack(struct ib_mad_agent_private *agent,
651 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS);
652 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS);
659 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_W2S);
660 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_W2S);
664 spin_lock_irqsave(&agent->lock, flags);
665 mad_send_wr = ib_find_send_mad(agent, mad_recv_wc);
668 process_ds_ack(agent, mad_recv_wc, newwin);
674 spin_unlock_irqrestore(&agent->lock, flags);
675 ack_ds_ack(agent, mad_recv_wc);
685 spin_unlock_irqrestore(&agent->lock, flags);
686 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_S2B);
687 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_S2B);
705 spin_unlock_irqrestore(&agent->lock, flags);
716 spin_unlock_irqrestore(&agent->lock, flags);
717 ack_ds_ack(agent, mad_recv_wc);
732 spin_unlock_irqrestore(&agent->lock, flags);
736 process_rmpp_data(struct ib_mad_agent_private *agent,
754 return start_rmpp(agent, mad_recv_wc);
760 return continue_rmpp(agent, mad_recv_wc);
763 nack_recv(agent, mad_recv_wc, rmpp_status);
768 static void process_rmpp_stop(struct ib_mad_agent_private *agent,
776 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS);
777 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS);
779 abort_send(agent, mad_recv_wc, rmpp_mad->rmpp_hdr.rmpp_status);
782 static void process_rmpp_abort(struct ib_mad_agent_private *agent,
791 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS);
792 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS);
794 abort_send(agent, mad_recv_wc, rmpp_mad->rmpp_hdr.rmpp_status);
798 ib_process_rmpp_recv_wc(struct ib_mad_agent_private *agent,
808 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_UNV);
809 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_UNV);
815 return process_rmpp_data(agent, mad_recv_wc);
817 process_rmpp_ack(agent, mad_recv_wc);
820 process_rmpp_stop(agent, mad_recv_wc);
823 process_rmpp_abort(agent, mad_recv_wc);
826 abort_send(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BADT);
827 nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BADT);
837 struct ib_mad_agent_private *agent = mad_send_wr->mad_agent_priv;
847 spin_lock_irqsave(&agent->lock, flags);
848 list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) {
863 spin_unlock_irqrestore(&agent->lock, flags);