• Home
  • Raw
  • Download

Lines Matching refs:lnk

44 static int smc_ib_modify_qp_init(struct smc_link *lnk)  in smc_ib_modify_qp_init()  argument
51 qp_attr.port_num = lnk->ibport; in smc_ib_modify_qp_init()
54 return ib_modify_qp(lnk->roce_qp, &qp_attr, in smc_ib_modify_qp_init()
59 static int smc_ib_modify_qp_rtr(struct smc_link *lnk) in smc_ib_modify_qp_rtr() argument
68 qp_attr.path_mtu = min(lnk->path_mtu, lnk->peer_mtu); in smc_ib_modify_qp_rtr()
70 rdma_ah_set_port_num(&qp_attr.ah_attr, lnk->ibport); in smc_ib_modify_qp_rtr()
71 rdma_ah_set_grh(&qp_attr.ah_attr, NULL, 0, lnk->sgid_index, 1, 0); in smc_ib_modify_qp_rtr()
72 rdma_ah_set_dgid_raw(&qp_attr.ah_attr, lnk->peer_gid); in smc_ib_modify_qp_rtr()
73 memcpy(&qp_attr.ah_attr.roce.dmac, lnk->peer_mac, in smc_ib_modify_qp_rtr()
74 sizeof(lnk->peer_mac)); in smc_ib_modify_qp_rtr()
75 qp_attr.dest_qp_num = lnk->peer_qpn; in smc_ib_modify_qp_rtr()
76 qp_attr.rq_psn = lnk->peer_psn; /* starting receive packet seq # */ in smc_ib_modify_qp_rtr()
82 return ib_modify_qp(lnk->roce_qp, &qp_attr, qp_attr_mask); in smc_ib_modify_qp_rtr()
85 int smc_ib_modify_qp_rts(struct smc_link *lnk) in smc_ib_modify_qp_rts() argument
94 qp_attr.sq_psn = lnk->psn_initial; /* starting send packet seq # */ in smc_ib_modify_qp_rts()
98 return ib_modify_qp(lnk->roce_qp, &qp_attr, in smc_ib_modify_qp_rts()
104 int smc_ib_modify_qp_error(struct smc_link *lnk) in smc_ib_modify_qp_error() argument
110 return ib_modify_qp(lnk->roce_qp, &qp_attr, IB_QP_STATE); in smc_ib_modify_qp_error()
113 int smc_ib_ready_link(struct smc_link *lnk) in smc_ib_ready_link() argument
115 struct smc_link_group *lgr = smc_get_lgr(lnk); in smc_ib_ready_link()
118 rc = smc_ib_modify_qp_init(lnk); in smc_ib_ready_link()
122 rc = smc_ib_modify_qp_rtr(lnk); in smc_ib_ready_link()
125 smc_wr_remember_qp_attr(lnk); in smc_ib_ready_link()
126 rc = ib_req_notify_cq(lnk->smcibdev->roce_cq_recv, in smc_ib_ready_link()
130 rc = smc_wr_rx_post_init(lnk); in smc_ib_ready_link()
133 smc_wr_remember_qp_attr(lnk); in smc_ib_ready_link()
136 rc = smc_ib_modify_qp_rts(lnk); in smc_ib_ready_link()
139 smc_wr_remember_qp_attr(lnk); in smc_ib_ready_link()
312 void smc_ib_dealloc_protection_domain(struct smc_link *lnk) in smc_ib_dealloc_protection_domain() argument
314 if (lnk->roce_pd) in smc_ib_dealloc_protection_domain()
315 ib_dealloc_pd(lnk->roce_pd); in smc_ib_dealloc_protection_domain()
316 lnk->roce_pd = NULL; in smc_ib_dealloc_protection_domain()
319 int smc_ib_create_protection_domain(struct smc_link *lnk) in smc_ib_create_protection_domain() argument
323 lnk->roce_pd = ib_alloc_pd(lnk->smcibdev->ibdev, 0); in smc_ib_create_protection_domain()
324 rc = PTR_ERR_OR_ZERO(lnk->roce_pd); in smc_ib_create_protection_domain()
325 if (IS_ERR(lnk->roce_pd)) in smc_ib_create_protection_domain()
326 lnk->roce_pd = NULL; in smc_ib_create_protection_domain()
342 if (lgr->lnk[i].state == SMC_LNK_UNUSED || in smcr_diag_is_dev_critical()
343 lgr->lnk[i].smcibdev != smcibdev) in smcr_diag_is_dev_critical()
497 struct smc_link *lnk = (struct smc_link *)priv; in smc_ib_qp_event_handler() local
498 struct smc_ib_device *smcibdev = lnk->smcibdev; in smc_ib_qp_event_handler()
516 void smc_ib_destroy_queue_pair(struct smc_link *lnk) in smc_ib_destroy_queue_pair() argument
518 if (lnk->roce_qp) in smc_ib_destroy_queue_pair()
519 ib_destroy_qp(lnk->roce_qp); in smc_ib_destroy_queue_pair()
520 lnk->roce_qp = NULL; in smc_ib_destroy_queue_pair()
524 int smc_ib_create_queue_pair(struct smc_link *lnk) in smc_ib_create_queue_pair() argument
528 .qp_context = lnk, in smc_ib_create_queue_pair()
529 .send_cq = lnk->smcibdev->roce_cq_send, in smc_ib_create_queue_pair()
530 .recv_cq = lnk->smcibdev->roce_cq_recv, in smc_ib_create_queue_pair()
546 lnk->roce_qp = ib_create_qp(lnk->roce_pd, &qp_attr); in smc_ib_create_queue_pair()
547 rc = PTR_ERR_OR_ZERO(lnk->roce_qp); in smc_ib_create_queue_pair()
548 if (IS_ERR(lnk->roce_qp)) in smc_ib_create_queue_pair()
549 lnk->roce_qp = NULL; in smc_ib_create_queue_pair()
551 smc_wr_remember_qp_attr(lnk); in smc_ib_create_queue_pair()
598 void smc_ib_sync_sg_for_cpu(struct smc_link *lnk, in smc_ib_sync_sg_for_cpu() argument
606 for_each_sg(buf_slot->sgt[lnk->link_idx].sgl, sg, in smc_ib_sync_sg_for_cpu()
607 buf_slot->sgt[lnk->link_idx].nents, i) { in smc_ib_sync_sg_for_cpu()
610 ib_dma_sync_single_for_cpu(lnk->smcibdev->ibdev, in smc_ib_sync_sg_for_cpu()
618 void smc_ib_sync_sg_for_device(struct smc_link *lnk, in smc_ib_sync_sg_for_device() argument
626 for_each_sg(buf_slot->sgt[lnk->link_idx].sgl, sg, in smc_ib_sync_sg_for_device()
627 buf_slot->sgt[lnk->link_idx].nents, i) { in smc_ib_sync_sg_for_device()
630 ib_dma_sync_single_for_device(lnk->smcibdev->ibdev, in smc_ib_sync_sg_for_device()
638 int smc_ib_buf_map_sg(struct smc_link *lnk, in smc_ib_buf_map_sg() argument
644 mapped_nents = ib_dma_map_sg(lnk->smcibdev->ibdev, in smc_ib_buf_map_sg()
645 buf_slot->sgt[lnk->link_idx].sgl, in smc_ib_buf_map_sg()
646 buf_slot->sgt[lnk->link_idx].orig_nents, in smc_ib_buf_map_sg()
654 void smc_ib_buf_unmap_sg(struct smc_link *lnk, in smc_ib_buf_unmap_sg() argument
658 if (!buf_slot->sgt[lnk->link_idx].sgl->dma_address) in smc_ib_buf_unmap_sg()
661 ib_dma_unmap_sg(lnk->smcibdev->ibdev, in smc_ib_buf_unmap_sg()
662 buf_slot->sgt[lnk->link_idx].sgl, in smc_ib_buf_unmap_sg()
663 buf_slot->sgt[lnk->link_idx].orig_nents, in smc_ib_buf_unmap_sg()
665 buf_slot->sgt[lnk->link_idx].sgl->dma_address = 0; in smc_ib_buf_unmap_sg()