Lines Matching refs:qp_info

59 			  struct ib_mad_qp_info *qp_info,  in create_mad_addr_info()  argument
63 struct ib_device *dev = qp_info->port_priv->device; in create_mad_addr_info()
64 u32 pnum = qp_info->port_priv->port_num; in create_mad_addr_info()
102 static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info,
363 if (!port_priv->qp_info[qpn].qp) { in ib_register_mad_agent()
386 mad_agent_priv->qp_info = &port_priv->qp_info[qpn]; in ib_register_mad_agent()
393 mad_agent_priv->agent.qp = port_priv->qp_info[qpn].qp; in ib_register_mad_agent()
502 port_priv = mad_agent_priv->qp_info->port_priv; in unregister_mad_agent()
613 size_t mad_size = port_mad_size(mad_agent_priv->qp_info->port_priv); in handle_outgoing_dr_smp()
616 bool opa = rdma_cap_opa_mad(mad_agent_priv->qp_info->port_priv->device, in handle_outgoing_dr_smp()
617 mad_agent_priv->qp_info->port_priv->port_num); in handle_outgoing_dr_smp()
764 queue_work(mad_agent_priv->qp_info->port_priv->wq, in handle_outgoing_dr_smp()
1000 struct ib_mad_qp_info *qp_info; in ib_send_mad() local
1008 qp_info = mad_send_wr->mad_agent_priv->qp_info; in ib_send_mad()
1009 mad_send_wr->mad_list.mad_queue = &qp_info->send_queue; in ib_send_mad()
1036 spin_lock_irqsave(&qp_info->send_queue.lock, flags); in ib_send_mad()
1037 if (qp_info->send_queue.count < qp_info->send_queue.max_active) { in ib_send_mad()
1038 trace_ib_mad_ib_send_mad(mad_send_wr, qp_info); in ib_send_mad()
1041 list = &qp_info->send_queue.list; in ib_send_mad()
1044 list = &qp_info->overflow_list; in ib_send_mad()
1048 qp_info->send_queue.count++; in ib_send_mad()
1051 spin_unlock_irqrestore(&qp_info->send_queue.lock, flags); in ib_send_mad()
1289 port_priv = agent_priv->qp_info->port_priv; in add_nonoui_reg_req()
1353 port_priv = agent_priv->qp_info->port_priv; in add_oui_reg_req()
1455 port_priv = agent_priv->qp_info->port_priv; in remove_mad_reg_req()
1620 const struct ib_mad_qp_info *qp_info, in validate_mad() argument
1624 u32 qp_num = qp_info->qp->qp_num; in validate_mad()
1862 const struct ib_mad_qp_info *qp_info, in handle_ib_smi() argument
1903 qp_info->qp->qp_num, in handle_ib_smi()
1949 struct ib_mad_qp_info *qp_info, in handle_opa_smi() argument
1993 qp_info->qp->qp_num, in handle_opa_smi()
2005 struct ib_mad_qp_info *qp_info, in handle_smi() argument
2016 return handle_opa_smi(port_priv, qp_info, wc, port_num, recv, in handle_smi()
2019 return handle_ib_smi(port_priv, qp_info, wc, port_num, recv, response); in handle_smi()
2027 struct ib_mad_qp_info *qp_info; in ib_mad_recv_done() local
2048 qp_info = mad_list->mad_queue->qp_info; in ib_mad_recv_done()
2051 opa = rdma_cap_opa_mad(qp_info->port_priv->device, in ib_mad_recv_done()
2052 qp_info->port_priv->port_num); in ib_mad_recv_done()
2078 if (!validate_mad((const struct ib_mad_hdr *)recv->mad, qp_info, opa)) in ib_mad_recv_done()
2081 trace_ib_mad_recv_done_handler(qp_info, wc, in ib_mad_recv_done()
2096 if (handle_smi(port_priv, qp_info, wc, port_num, recv, in ib_mad_recv_done()
2121 qp_info->qp->qp_num, in ib_mad_recv_done()
2141 qp_info->qp->qp_num, mad_size, opa); in ib_mad_recv_done()
2147 ib_mad_post_receive_mads(qp_info, response); in ib_mad_recv_done()
2150 ib_mad_post_receive_mads(qp_info, recv); in ib_mad_recv_done()
2171 mod_delayed_work(mad_agent_priv->qp_info->port_priv->wq, in adjust_timeout()
2207 mod_delayed_work(mad_agent_priv->qp_info->port_priv->wq, in wait_for_response()
2277 struct ib_mad_qp_info *qp_info; in ib_mad_send_done() local
2294 qp_info = send_queue->qp_info; in ib_mad_send_done()
2312 mad_list = container_of(qp_info->overflow_list.next, in ib_mad_send_done()
2327 trace_ib_mad_send_done_resend(queued_send_wr, qp_info); in ib_mad_send_done()
2328 ret = ib_post_send(qp_info->qp, &queued_send_wr->send_wr.wr, in ib_mad_send_done()
2340 static void mark_sends_for_retry(struct ib_mad_qp_info *qp_info) in mark_sends_for_retry() argument
2346 spin_lock_irqsave(&qp_info->send_queue.lock, flags); in mark_sends_for_retry()
2347 list_for_each_entry(mad_list, &qp_info->send_queue.list, list) { in mark_sends_for_retry()
2353 spin_unlock_irqrestore(&qp_info->send_queue.lock, flags); in mark_sends_for_retry()
2361 struct ib_mad_qp_info *qp_info = mad_list->mad_queue->qp_info; in ib_mad_send_error() local
2375 trace_ib_mad_error_handler(mad_send_wr, qp_info); in ib_mad_send_error()
2376 ret = ib_post_send(qp_info->qp, &mad_send_wr->send_wr.wr, in ib_mad_send_error()
2389 ret = ib_modify_qp(qp_info->qp, attr, in ib_mad_send_error()
2397 mark_sends_for_retry(qp_info); in ib_mad_send_error()
2512 opa = rdma_cap_opa_mad(mad_agent_priv->qp_info->port_priv->device, in local_completions()
2513 mad_agent_priv->qp_info->port_priv->port_num); in local_completions()
2643 queue_delayed_work(mad_agent_priv->qp_info-> in timeout_sends()
2673 static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info, in ib_mad_post_receive_mads() argument
2681 struct ib_mad_queue *recv_queue = &qp_info->recv_queue; in ib_mad_post_receive_mads()
2684 sg_list.lkey = qp_info->port_priv->pd->local_dma_lkey; in ib_mad_post_receive_mads()
2697 mad_priv = alloc_mad_private(port_mad_size(qp_info->port_priv), in ib_mad_post_receive_mads()
2705 sg_list.addr = ib_dma_map_single(qp_info->port_priv->device, in ib_mad_post_receive_mads()
2709 if (unlikely(ib_dma_mapping_error(qp_info->port_priv->device, in ib_mad_post_receive_mads()
2725 ret = ib_post_recv(qp_info->qp, &recv_wr, NULL); in ib_mad_post_receive_mads()
2731 ib_dma_unmap_single(qp_info->port_priv->device, in ib_mad_post_receive_mads()
2736 dev_err(&qp_info->port_priv->device->dev, in ib_mad_post_receive_mads()
2748 static void cleanup_recv_queue(struct ib_mad_qp_info *qp_info) in cleanup_recv_queue() argument
2754 if (!qp_info->qp) in cleanup_recv_queue()
2757 while (!list_empty(&qp_info->recv_queue.list)) { in cleanup_recv_queue()
2759 mad_list = list_entry(qp_info->recv_queue.list.next, in cleanup_recv_queue()
2770 ib_dma_unmap_single(qp_info->port_priv->device, in cleanup_recv_queue()
2777 qp_info->recv_queue.count = 0; in cleanup_recv_queue()
2800 qp = port_priv->qp_info[i].qp; in ib_mad_port_start()
2849 if (!port_priv->qp_info[i].qp) in ib_mad_port_start()
2852 ret = ib_mad_post_receive_mads(&port_priv->qp_info[i], NULL); in ib_mad_port_start()
2866 struct ib_mad_qp_info *qp_info = qp_context; in qp_event_handler() local
2869 dev_err(&qp_info->port_priv->device->dev, in qp_event_handler()
2871 event->event, qp_info->qp->qp_num); in qp_event_handler()
2874 static void init_mad_queue(struct ib_mad_qp_info *qp_info, in init_mad_queue() argument
2877 mad_queue->qp_info = qp_info; in init_mad_queue()
2884 struct ib_mad_qp_info *qp_info) in init_mad_qp() argument
2886 qp_info->port_priv = port_priv; in init_mad_qp()
2887 init_mad_queue(qp_info, &qp_info->send_queue); in init_mad_qp()
2888 init_mad_queue(qp_info, &qp_info->recv_queue); in init_mad_qp()
2889 INIT_LIST_HEAD(&qp_info->overflow_list); in init_mad_qp()
2892 static int create_mad_qp(struct ib_mad_qp_info *qp_info, in create_mad_qp() argument
2899 qp_init_attr.send_cq = qp_info->port_priv->cq; in create_mad_qp()
2900 qp_init_attr.recv_cq = qp_info->port_priv->cq; in create_mad_qp()
2907 qp_init_attr.port_num = qp_info->port_priv->port_num; in create_mad_qp()
2908 qp_init_attr.qp_context = qp_info; in create_mad_qp()
2910 qp_info->qp = ib_create_qp(qp_info->port_priv->pd, &qp_init_attr); in create_mad_qp()
2911 if (IS_ERR(qp_info->qp)) { in create_mad_qp()
2912 dev_err(&qp_info->port_priv->device->dev, in create_mad_qp()
2915 ret = PTR_ERR(qp_info->qp); in create_mad_qp()
2919 qp_info->send_queue.max_active = mad_sendq_size; in create_mad_qp()
2920 qp_info->recv_queue.max_active = mad_recvq_size; in create_mad_qp()
2927 static void destroy_mad_qp(struct ib_mad_qp_info *qp_info) in destroy_mad_qp() argument
2929 if (!qp_info->qp) in destroy_mad_qp()
2932 ib_destroy_qp(qp_info->qp); in destroy_mad_qp()
2963 init_mad_qp(port_priv, &port_priv->qp_info[0]); in ib_mad_port_open()
2964 init_mad_qp(port_priv, &port_priv->qp_info[1]); in ib_mad_port_open()
2987 ret = create_mad_qp(&port_priv->qp_info[0], IB_QPT_SMI); in ib_mad_port_open()
2991 ret = create_mad_qp(&port_priv->qp_info[1], IB_QPT_GSI); in ib_mad_port_open()
3021 destroy_mad_qp(&port_priv->qp_info[1]); in ib_mad_port_open()
3023 destroy_mad_qp(&port_priv->qp_info[0]); in ib_mad_port_open()
3026 cleanup_recv_queue(&port_priv->qp_info[1]); in ib_mad_port_open()
3027 cleanup_recv_queue(&port_priv->qp_info[0]); in ib_mad_port_open()
3057 destroy_mad_qp(&port_priv->qp_info[1]); in ib_mad_port_close()
3058 destroy_mad_qp(&port_priv->qp_info[0]); in ib_mad_port_close()
3061 cleanup_recv_queue(&port_priv->qp_info[1]); in ib_mad_port_close()
3062 cleanup_recv_queue(&port_priv->qp_info[0]); in ib_mad_port_close()