• Home
  • Raw
  • Download

Lines Matching full:lnk

43 static int smc_ib_modify_qp_init(struct smc_link *lnk)  in smc_ib_modify_qp_init()  argument
50 qp_attr.port_num = lnk->ibport; in smc_ib_modify_qp_init()
53 return ib_modify_qp(lnk->roce_qp, &qp_attr, in smc_ib_modify_qp_init()
58 static int smc_ib_modify_qp_rtr(struct smc_link *lnk) in smc_ib_modify_qp_rtr() argument
67 qp_attr.path_mtu = min(lnk->path_mtu, lnk->peer_mtu); in smc_ib_modify_qp_rtr()
69 rdma_ah_set_port_num(&qp_attr.ah_attr, lnk->ibport); in smc_ib_modify_qp_rtr()
70 rdma_ah_set_grh(&qp_attr.ah_attr, NULL, 0, lnk->sgid_index, 1, 0); in smc_ib_modify_qp_rtr()
71 rdma_ah_set_dgid_raw(&qp_attr.ah_attr, lnk->peer_gid); in smc_ib_modify_qp_rtr()
72 memcpy(&qp_attr.ah_attr.roce.dmac, lnk->peer_mac, in smc_ib_modify_qp_rtr()
73 sizeof(lnk->peer_mac)); in smc_ib_modify_qp_rtr()
74 qp_attr.dest_qp_num = lnk->peer_qpn; in smc_ib_modify_qp_rtr()
75 qp_attr.rq_psn = lnk->peer_psn; /* starting receive packet seq # */ in smc_ib_modify_qp_rtr()
81 return ib_modify_qp(lnk->roce_qp, &qp_attr, qp_attr_mask); in smc_ib_modify_qp_rtr()
84 int smc_ib_modify_qp_rts(struct smc_link *lnk) in smc_ib_modify_qp_rts() argument
93 qp_attr.sq_psn = lnk->psn_initial; /* starting send packet seq # */ in smc_ib_modify_qp_rts()
97 return ib_modify_qp(lnk->roce_qp, &qp_attr, in smc_ib_modify_qp_rts()
103 int smc_ib_modify_qp_error(struct smc_link *lnk) in smc_ib_modify_qp_error() argument
109 return ib_modify_qp(lnk->roce_qp, &qp_attr, IB_QP_STATE); in smc_ib_modify_qp_error()
112 int smc_ib_ready_link(struct smc_link *lnk) in smc_ib_ready_link() argument
114 struct smc_link_group *lgr = smc_get_lgr(lnk); in smc_ib_ready_link()
117 rc = smc_ib_modify_qp_init(lnk); in smc_ib_ready_link()
121 rc = smc_ib_modify_qp_rtr(lnk); in smc_ib_ready_link()
124 smc_wr_remember_qp_attr(lnk); in smc_ib_ready_link()
125 rc = ib_req_notify_cq(lnk->smcibdev->roce_cq_recv, in smc_ib_ready_link()
129 rc = smc_wr_rx_post_init(lnk); in smc_ib_ready_link()
132 smc_wr_remember_qp_attr(lnk); in smc_ib_ready_link()
135 rc = smc_ib_modify_qp_rts(lnk); in smc_ib_ready_link()
138 smc_wr_remember_qp_attr(lnk); in smc_ib_ready_link()
311 void smc_ib_dealloc_protection_domain(struct smc_link *lnk) in smc_ib_dealloc_protection_domain() argument
313 if (lnk->roce_pd) in smc_ib_dealloc_protection_domain()
314 ib_dealloc_pd(lnk->roce_pd); in smc_ib_dealloc_protection_domain()
315 lnk->roce_pd = NULL; in smc_ib_dealloc_protection_domain()
318 int smc_ib_create_protection_domain(struct smc_link *lnk) in smc_ib_create_protection_domain() argument
322 lnk->roce_pd = ib_alloc_pd(lnk->smcibdev->ibdev, 0); in smc_ib_create_protection_domain()
323 rc = PTR_ERR_OR_ZERO(lnk->roce_pd); in smc_ib_create_protection_domain()
324 if (IS_ERR(lnk->roce_pd)) in smc_ib_create_protection_domain()
325 lnk->roce_pd = NULL; in smc_ib_create_protection_domain()
331 struct smc_link *lnk = (struct smc_link *)priv; in smc_ib_qp_event_handler() local
332 struct smc_ib_device *smcibdev = lnk->smcibdev; in smc_ib_qp_event_handler()
350 void smc_ib_destroy_queue_pair(struct smc_link *lnk) in smc_ib_destroy_queue_pair() argument
352 if (lnk->roce_qp) in smc_ib_destroy_queue_pair()
353 ib_destroy_qp(lnk->roce_qp); in smc_ib_destroy_queue_pair()
354 lnk->roce_qp = NULL; in smc_ib_destroy_queue_pair()
358 int smc_ib_create_queue_pair(struct smc_link *lnk) in smc_ib_create_queue_pair() argument
362 .qp_context = lnk, in smc_ib_create_queue_pair()
363 .send_cq = lnk->smcibdev->roce_cq_send, in smc_ib_create_queue_pair()
364 .recv_cq = lnk->smcibdev->roce_cq_recv, in smc_ib_create_queue_pair()
380 lnk->roce_qp = ib_create_qp(lnk->roce_pd, &qp_attr); in smc_ib_create_queue_pair()
381 rc = PTR_ERR_OR_ZERO(lnk->roce_qp); in smc_ib_create_queue_pair()
382 if (IS_ERR(lnk->roce_qp)) in smc_ib_create_queue_pair()
383 lnk->roce_qp = NULL; in smc_ib_create_queue_pair()
385 smc_wr_remember_qp_attr(lnk); in smc_ib_create_queue_pair()
432 void smc_ib_sync_sg_for_cpu(struct smc_link *lnk, in smc_ib_sync_sg_for_cpu() argument
440 for_each_sg(buf_slot->sgt[lnk->link_idx].sgl, sg, in smc_ib_sync_sg_for_cpu()
441 buf_slot->sgt[lnk->link_idx].nents, i) { in smc_ib_sync_sg_for_cpu()
444 ib_dma_sync_single_for_cpu(lnk->smcibdev->ibdev, in smc_ib_sync_sg_for_cpu()
452 void smc_ib_sync_sg_for_device(struct smc_link *lnk, in smc_ib_sync_sg_for_device() argument
460 for_each_sg(buf_slot->sgt[lnk->link_idx].sgl, sg, in smc_ib_sync_sg_for_device()
461 buf_slot->sgt[lnk->link_idx].nents, i) { in smc_ib_sync_sg_for_device()
464 ib_dma_sync_single_for_device(lnk->smcibdev->ibdev, in smc_ib_sync_sg_for_device()
472 int smc_ib_buf_map_sg(struct smc_link *lnk, in smc_ib_buf_map_sg() argument
478 mapped_nents = ib_dma_map_sg(lnk->smcibdev->ibdev, in smc_ib_buf_map_sg()
479 buf_slot->sgt[lnk->link_idx].sgl, in smc_ib_buf_map_sg()
480 buf_slot->sgt[lnk->link_idx].orig_nents, in smc_ib_buf_map_sg()
488 void smc_ib_buf_unmap_sg(struct smc_link *lnk, in smc_ib_buf_unmap_sg() argument
492 if (!buf_slot->sgt[lnk->link_idx].sgl->dma_address) in smc_ib_buf_unmap_sg()
495 ib_dma_unmap_sg(lnk->smcibdev->ibdev, in smc_ib_buf_unmap_sg()
496 buf_slot->sgt[lnk->link_idx].sgl, in smc_ib_buf_unmap_sg()
497 buf_slot->sgt[lnk->link_idx].orig_nents, in smc_ib_buf_unmap_sg()
499 buf_slot->sgt[lnk->link_idx].sgl->dma_address = 0; in smc_ib_buf_unmap_sg()