• Home
  • Raw
  • Download

Lines Matching refs:rf

16 	struct irdma_pci_f *rf = iwdev->rf;  in irdma_query_device()  local
17 struct pci_dev *pcidev = iwdev->rf->pcidev; in irdma_query_device()
18 struct irdma_hw_attrs *hw_attrs = &rf->sc_dev.hw_attrs; in irdma_query_device()
26 props->fw_ver = (u64)irdma_fw_major_ver(&rf->sc_dev) << 32 | in irdma_query_device()
27 irdma_fw_minor_ver(&rf->sc_dev); in irdma_query_device()
34 props->hw_ver = rf->pcidev->revision; in irdma_query_device()
37 props->max_qp = rf->max_qp - rf->used_qps; in irdma_query_device()
41 props->max_cq = rf->max_cq - rf->used_cqs; in irdma_query_device()
42 props->max_cqe = rf->max_cqe - 1; in irdma_query_device()
43 props->max_mr = rf->max_mr - rf->used_mrs; in irdma_query_device()
45 props->max_pd = rf->max_pd - rf->used_pds; in irdma_query_device()
54 props->max_ah = rf->max_ah; in irdma_query_device()
55 props->max_mcast_grp = rf->max_mcg; in irdma_query_device()
57 props->max_total_mcast_qp_attach = rf->max_qp * IRDMA_MAX_MGS_PER_CTX; in irdma_query_device()
106 props->max_msg_sz = iwdev->rf->sc_dev.hw_attrs.max_hw_outbound_msg_size; in irdma_query_port()
128 pfn = ((uintptr_t)ucontext->iwdev->rf->sc_dev.hw_regs[IRDMA_DB_ADDR_OFFSET] + in irdma_mmap_legacy()
129 pci_resource_start(ucontext->iwdev->rf->pcidev, 0)) >> PAGE_SHIFT; in irdma_mmap_legacy()
199 pci_resource_start(ucontext->iwdev->rf->pcidev, 0)) >> PAGE_SHIFT; in irdma_mmap()
237 cqp_request = irdma_alloc_and_get_cqp_request(&iwdev->rf->cqp, true); in irdma_alloc_push_page()
249 cqp_info->in.u.manage_push_page.cqp = &iwdev->rf->cqp.sc_cqp; in irdma_alloc_push_page()
252 status = irdma_handle_cqp_op(iwdev->rf, cqp_request); in irdma_alloc_push_page()
254 iwdev->rf->sc_dev.hw_attrs.max_hw_device_pages) { in irdma_alloc_push_page()
259 irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request); in irdma_alloc_push_page()
295 uk_attrs = &iwdev->rf->sc_dev.hw_attrs.uk_attrs; in irdma_alloc_ucontext()
302 uresp.max_qps = iwdev->rf->max_qp; in irdma_alloc_ucontext()
303 uresp.max_pds = iwdev->rf->sc_dev.hw_attrs.max_hw_pds; in irdma_alloc_ucontext()
304 uresp.wq_size = iwdev->rf->sc_dev.hw_attrs.max_qp_wr * 2; in irdma_alloc_ucontext()
310 u64 bar_off = (uintptr_t)iwdev->rf->sc_dev.hw_regs[IRDMA_DB_ADDR_OFFSET]; in irdma_alloc_ucontext()
372 struct irdma_sc_dev *dev = &iwdev->rf->sc_dev; in irdma_alloc_pd()
373 struct irdma_pci_f *rf = iwdev->rf; in irdma_alloc_pd() local
382 err = irdma_alloc_rsrc(rf, rf->allocated_pds, rf->max_pd, &pd_id, in irdma_alloc_pd()
383 &rf->next_pd); in irdma_alloc_pd()
405 irdma_free_rsrc(rf, rf->allocated_pds, pd_id); in irdma_alloc_pd()
420 irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_pds, iwpd->sc_pd.pd_id); in irdma_dealloc_pd()
483 bar_off = (uintptr_t)iwdev->rf->sc_dev.hw_regs[IRDMA_DB_ADDR_OFFSET]; in irdma_setup_push_mmap_entries()
536 irdma_cqp_qp_destroy_cmd(&iwdev->rf->sc_dev, &iwqp->sc_qp); in irdma_destroy_qp()
587 struct irdma_uk_attrs *uk_attrs = &iwdev->rf->sc_dev.hw_attrs.uk_attrs; in irdma_setup_kmode_qp()
629 mem->va = dma_alloc_coherent(iwdev->rf->hw.device, mem->size, in irdma_setup_kmode_qp()
657 struct irdma_pci_f *rf = iwqp->iwdev->rf; in irdma_cqp_create_qp_cmd() local
663 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cqp_create_qp_cmd()
678 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_create_qp_cmd()
679 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_create_qp_cmd()
688 struct irdma_sc_dev *dev = &iwdev->rf->sc_dev; in irdma_roce_fill_and_set_qpctx_info()
728 struct irdma_sc_dev *dev = &iwdev->rf->sc_dev; in irdma_iw_fill_and_set_qpctx_info()
757 struct irdma_sc_dev *dev = &iwdev->rf->sc_dev; in irdma_validate_qp_attrs()
806 struct irdma_pci_f *rf = iwdev->rf; in irdma_create_qp() local
815 struct irdma_sc_dev *dev = &rf->sc_dev; in irdma_create_qp()
862 err_code = irdma_alloc_rsrc(rf, rf->allocated_qps, rf->max_qp, in irdma_create_qp()
863 &qp_num, &rf->next_qp); in irdma_create_qp()
968 rf->qp_table[qp_num] = iwqp; in irdma_create_qp()
974 irdma_cqp_qp_destroy_cmd(&rf->sc_dev, &iwqp->sc_qp); in irdma_create_qp()
1133 struct irdma_sc_dev *dev = &iwdev->rf->sc_dev; in irdma_modify_qp_roce()
1247 udp_info->arp_idx = irdma_arp_table(iwdev->rf, in irdma_modify_qp_roce()
1269 irdma_add_arp(iwdev->rf, local_ip, udp_info->ipv4, in irdma_modify_qp_roce()
1487 struct irdma_sc_dev *dev = &iwdev->rf->sc_dev; in irdma_modify_qp()
1724 static void irdma_cq_free_rsrc(struct irdma_pci_f *rf, struct irdma_cq *iwcq) in irdma_cq_free_rsrc() argument
1729 dma_free_coherent(rf->sc_dev.hw->device, iwcq->kmem.size, in irdma_cq_free_rsrc()
1732 dma_free_coherent(rf->sc_dev.hw->device, in irdma_cq_free_rsrc()
1738 irdma_free_rsrc(rf, rf->allocated_cqs, cq->cq_uk.cq_id); in irdma_cq_free_rsrc()
1804 irdma_cq_wq_destroy(iwdev->rf, cq); in irdma_destroy_cq()
1809 irdma_cq_free_rsrc(iwdev->rf, iwcq); in irdma_destroy_cq()
1834 struct irdma_pci_f *rf; in irdma_resize_cq() local
1840 rf = iwdev->rf; in irdma_resize_cq()
1842 if (!(rf->sc_dev.hw_attrs.uk_attrs.feature_flags & in irdma_resize_cq()
1849 if (entries > rf->max_cqe) in irdma_resize_cq()
1854 if (rf->sc_dev.hw_attrs.uk_attrs.hw_rev >= IRDMA_GEN_2) in irdma_resize_cq()
1914 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_resize_cq()
1931 ret = irdma_handle_cqp_op(rf, cqp_request); in irdma_resize_cq()
1932 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_resize_cq()
1985 struct irdma_pci_f *rf = iwdev->rf; in irdma_create_cq() local
1989 struct irdma_sc_dev *dev = &rf->sc_dev; in irdma_create_cq()
2006 err_code = irdma_alloc_rsrc(rf, rf->allocated_cqs, rf->max_cq, &cq_num, in irdma_create_cq()
2007 &rf->next_cq); in irdma_create_cq()
2020 if (attr->comp_vector < rf->ceqs_count) in irdma_create_cq()
2058 if (rf->sc_dev.hw_attrs.uk_attrs.feature_flags & in irdma_create_cq()
2088 if (entries < 1 || entries > rf->max_cqe) { in irdma_create_cq()
2133 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_create_cq()
2145 err_code = irdma_handle_cqp_op(rf, cqp_request); in irdma_create_cq()
2146 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_create_cq()
2165 irdma_cq_wq_destroy(rf, cq); in irdma_create_cq()
2167 irdma_cq_free_rsrc(rf, iwcq); in irdma_create_cq()
2204 stag_idx = (stag & iwdev->rf->mr_stagmask) >> IRDMA_CQPSQ_STAG_IDX_S; in irdma_free_stag()
2205 irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_mrs, stag_idx); in irdma_free_stag()
2225 driver_key = random & ~iwdev->rf->mr_stagmask; in irdma_create_stag()
2226 next_stag_index = (random & iwdev->rf->mr_stagmask) >> 8; in irdma_create_stag()
2227 next_stag_index %= iwdev->rf->max_mr; in irdma_create_stag()
2229 ret = irdma_alloc_rsrc(iwdev->rf, iwdev->rf->allocated_mrs, in irdma_create_stag()
2230 iwdev->rf->max_mr, &stag_index, in irdma_create_stag()
2351 static int irdma_setup_pbles(struct irdma_pci_f *rf, struct irdma_mr *iwmr, in irdma_setup_pbles() argument
2362 status = irdma_get_pble(rf->pble_rsrc, palloc, iwmr->page_cnt, in irdma_setup_pbles()
2406 err = irdma_setup_pbles(iwdev->rf, iwmr, use_pbles, true); in irdma_handle_q_mem()
2459 irdma_free_pble(iwdev->rf->pble_rsrc, palloc); in irdma_handle_q_mem()
2479 cqp_request = irdma_alloc_and_get_cqp_request(&iwdev->rf->cqp, true); in irdma_hw_alloc_mw()
2495 cqp_info->in.u.mw_alloc.dev = &iwdev->rf->sc_dev; in irdma_hw_alloc_mw()
2497 status = irdma_handle_cqp_op(iwdev->rf, cqp_request); in irdma_hw_alloc_mw()
2498 irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request); in irdma_hw_alloc_mw()
2545 cqp_request = irdma_alloc_and_get_cqp_request(&iwdev->rf->cqp, true); in irdma_dealloc_mw()
2557 cqp_info->in.u.dealloc_stag.dev = &iwdev->rf->sc_dev; in irdma_dealloc_mw()
2559 irdma_handle_cqp_op(iwdev->rf, cqp_request); in irdma_dealloc_mw()
2560 irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request); in irdma_dealloc_mw()
2581 cqp_request = irdma_alloc_and_get_cqp_request(&iwdev->rf->cqp, true); in irdma_hw_alloc_stag()
2596 cqp_info->in.u.alloc_stag.dev = &iwdev->rf->sc_dev; in irdma_hw_alloc_stag()
2598 status = irdma_handle_cqp_op(iwdev->rf, cqp_request); in irdma_hw_alloc_stag()
2599 irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request); in irdma_hw_alloc_stag()
2642 err_code = irdma_get_pble(iwdev->rf->pble_rsrc, palloc, iwmr->page_cnt, in irdma_alloc_mr()
2655 irdma_free_pble(iwdev->rf->pble_rsrc, palloc); in irdma_alloc_mr()
2728 cqp_request = irdma_alloc_and_get_cqp_request(&iwdev->rf->cqp, true); in irdma_hwreg_mr()
2762 cqp_info->in.u.mr_reg_non_shared.dev = &iwdev->rf->sc_dev; in irdma_hwreg_mr()
2764 ret = irdma_handle_cqp_op(iwdev->rf, cqp_request); in irdma_hwreg_mr()
2765 irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request); in irdma_hwreg_mr()
2798 if (len > iwdev->rf->sc_dev.hw_attrs.max_mr_size) in irdma_reg_user_mr()
2833 iwdev->rf->sc_dev.hw_attrs.page_size_cap, in irdma_reg_user_mr()
2875 if (iwdev->rf->sc_dev.hw_attrs.uk_attrs.feature_flags & IRDMA_FEATURE_CQ_RESIZE) in irdma_reg_user_mr()
2898 err = irdma_setup_pbles(iwdev->rf, iwmr, use_pbles, false); in irdma_reg_user_mr()
2906 irdma_free_pble(iwdev->rf->pble_rsrc, palloc); in irdma_reg_user_mr()
2937 irdma_free_pble(iwdev->rf->pble_rsrc, palloc); in irdma_reg_user_mr()
3074 cqp_request = irdma_alloc_and_get_cqp_request(&iwdev->rf->cqp, true); in irdma_dereg_mr()
3089 cqp_info->in.u.dealloc_stag.dev = &iwdev->rf->sc_dev; in irdma_dereg_mr()
3091 status = irdma_handle_cqp_op(iwdev->rf, cqp_request); in irdma_dereg_mr()
3092 irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request); in irdma_dereg_mr()
3099 irdma_free_pble(iwdev->rf->pble_rsrc, palloc); in irdma_dereg_mr()
3127 dev = &iwqp->iwdev->rf->sc_dev; in irdma_post_send()
3725 irdma_fw_major_ver(&iwdev->rf->sc_dev), in irdma_get_dev_fw_str()
3726 irdma_fw_minor_ver(&iwdev->rf->sc_dev)); in irdma_get_dev_fw_str()
3762 if (iwdev->rf->rdma_ver >= IRDMA_GEN_2) in irdma_get_hw_stats()
3763 irdma_cqp_gather_stats_cmd(&iwdev->rf->sc_dev, iwdev->vsi.pestat, true); in irdma_get_hw_stats()
3765 irdma_cqp_gather_stats_gen1(&iwdev->rf->sc_dev, iwdev->vsi.pestat); in irdma_get_hw_stats()
3795 static void mcast_list_add(struct irdma_pci_f *rf, in mcast_list_add() argument
3798 list_add(&new_elem->list, &rf->mc_qht_list.list); in mcast_list_add()
3816 static struct mc_table_list *mcast_list_lookup_ip(struct irdma_pci_f *rf, in mcast_list_lookup_ip() argument
3822 list_for_each_safe (pos, q, &rf->mc_qht_list.list) { in mcast_list_lookup_ip()
3847 cqp_request = irdma_alloc_and_get_cqp_request(&iwdev->rf->cqp, true); in irdma_mcast_cqp_op()
3856 cqp_info->in.u.mc_create.cqp = &iwdev->rf->cqp.sc_cqp; in irdma_mcast_cqp_op()
3857 status = irdma_handle_cqp_op(iwdev->rf, cqp_request); in irdma_mcast_cqp_op()
3858 irdma_put_cqp_request(&iwdev->rf->cqp, cqp_request); in irdma_mcast_cqp_op()
3906 struct irdma_pci_f *rf = iwdev->rf; in irdma_attach_mcast() local
3940 spin_lock_irqsave(&rf->qh_list_lock, flags); in irdma_attach_mcast()
3941 mc_qht_elem = mcast_list_lookup_ip(rf, ip_addr); in irdma_attach_mcast()
3945 spin_unlock_irqrestore(&rf->qh_list_lock, flags); in irdma_attach_mcast()
3953 ret = irdma_alloc_rsrc(rf, rf->allocated_mcgs, rf->max_mcg, in irdma_attach_mcast()
3954 &mgn, &rf->next_mcg); in irdma_attach_mcast()
3964 dma_mem_mc->va = dma_alloc_coherent(rf->hw.device, in irdma_attach_mcast()
3969 irdma_free_rsrc(rf, rf->allocated_mcgs, mgn); in irdma_attach_mcast()
3986 spin_lock_irqsave(&rf->qh_list_lock, flags); in irdma_attach_mcast()
3987 mcast_list_add(rf, mc_qht_elem); in irdma_attach_mcast()
3991 spin_unlock_irqrestore(&rf->qh_list_lock, flags); in irdma_attach_mcast()
3999 spin_unlock_irqrestore(&rf->qh_list_lock, flags); in irdma_attach_mcast()
4021 dma_free_coherent(rf->hw.device, in irdma_attach_mcast()
4026 irdma_free_rsrc(rf, rf->allocated_mcgs, in irdma_attach_mcast()
4046 struct irdma_pci_f *rf = iwdev->rf; in irdma_detach_mcast() local
4061 spin_lock_irqsave(&rf->qh_list_lock, flags); in irdma_detach_mcast()
4062 mc_qht_elem = mcast_list_lookup_ip(rf, ip_addr); in irdma_detach_mcast()
4064 spin_unlock_irqrestore(&rf->qh_list_lock, flags); in irdma_detach_mcast()
4074 spin_unlock_irqrestore(&rf->qh_list_lock, flags); in irdma_detach_mcast()
4080 spin_lock_irqsave(&rf->qh_list_lock, flags); in irdma_detach_mcast()
4081 mcast_list_add(rf, mc_qht_elem); in irdma_detach_mcast()
4082 spin_unlock_irqrestore(&rf->qh_list_lock, flags); in irdma_detach_mcast()
4086 dma_free_coherent(rf->hw.device, in irdma_detach_mcast()
4091 irdma_free_rsrc(rf, rf->allocated_mcgs, in irdma_detach_mcast()
4095 spin_unlock_irqrestore(&rf->qh_list_lock, flags); in irdma_detach_mcast()
4110 struct irdma_pci_f *rf = iwdev->rf; in irdma_create_hw_ah() local
4113 err = irdma_alloc_rsrc(rf, rf->allocated_ahs, rf->max_ah, &ah->sc_ah.ah_info.ah_idx, in irdma_create_hw_ah()
4114 &rf->next_ah); in irdma_create_hw_ah()
4118 err = irdma_ah_cqp_op(rf, &ah->sc_ah, IRDMA_OP_AH_CREATE, sleep, in irdma_create_hw_ah()
4130 irdma_cqp_ce_handler(rf, &rf->ccq.sc_cq); in irdma_create_hw_ah()
4143 irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_ahs, ah->sc_ah.ah_info.ah_idx); in irdma_create_hw_ah()
4155 struct irdma_pci_f *rf = iwdev->rf; in irdma_setup_ah() local
4165 irdma_sc_init_ah(&rf->sc_dev, sc_ah); in irdma_setup_ah()
4212 ah_info->dst_arpindex = irdma_add_arp(iwdev->rf, ah_info->dest_ip_addr, in irdma_setup_ah()
4282 irdma_ah_cqp_op(iwdev->rf, &ah->sc_ah, IRDMA_OP_AH_DESTROY, in irdma_destroy_ah()
4285 irdma_free_rsrc(iwdev->rf, iwdev->rf->allocated_ahs, in irdma_destroy_ah()
4504 struct pci_dev *pcidev = iwdev->rf->pcidev; in irdma_init_rdma_device()
4515 iwdev->ibdev.num_comp_vectors = iwdev->rf->ceqs_count; in irdma_init_rdma_device()
4564 dma_set_max_seg_size(iwdev->rf->hw.device, UINT_MAX); in irdma_ib_register_device()
4565 ret = ib_register_device(&iwdev->ibdev, "irdma%d", iwdev->rf->hw.device); in irdma_ib_register_device()
4593 irdma_ctrl_deinit_hw(iwdev->rf); in irdma_ib_dealloc_device()
4594 kfree(iwdev->rf); in irdma_ib_dealloc_device()