Lines Matching full:rf

7  * @rf: RDMA PCI function
13 int irdma_arp_table(struct irdma_pci_f *rf, u32 *ip_addr, bool ipv4, in irdma_arp_table() argument
25 spin_lock_irqsave(&rf->arp_lock, flags); in irdma_arp_table()
26 for (arp_index = 0; (u32)arp_index < rf->arp_table_size; arp_index++) { in irdma_arp_table()
27 if (!memcmp(rf->arp_table[arp_index].ip_addr, ip, sizeof(ip))) in irdma_arp_table()
33 if (arp_index != rf->arp_table_size) { in irdma_arp_table()
39 if (irdma_alloc_rsrc(rf, rf->allocated_arps, rf->arp_table_size, in irdma_arp_table()
40 (u32 *)&arp_index, &rf->next_arp_index)) { in irdma_arp_table()
45 memcpy(rf->arp_table[arp_index].ip_addr, ip, in irdma_arp_table()
46 sizeof(rf->arp_table[arp_index].ip_addr)); in irdma_arp_table()
47 ether_addr_copy(rf->arp_table[arp_index].mac_addr, mac_addr); in irdma_arp_table()
50 if (arp_index == rf->arp_table_size) in irdma_arp_table()
54 if (arp_index == rf->arp_table_size) { in irdma_arp_table()
59 memset(rf->arp_table[arp_index].ip_addr, 0, in irdma_arp_table()
60 sizeof(rf->arp_table[arp_index].ip_addr)); in irdma_arp_table()
61 eth_zero_addr(rf->arp_table[arp_index].mac_addr); in irdma_arp_table()
62 irdma_free_rsrc(rf, rf->allocated_arps, arp_index); in irdma_arp_table()
69 spin_unlock_irqrestore(&rf->arp_lock, flags); in irdma_arp_table()
75 * @rf: RDMA function
80 int irdma_add_arp(struct irdma_pci_f *rf, u32 *ip, bool ipv4, const u8 *mac) in irdma_add_arp() argument
84 arpidx = irdma_arp_table(rf, &ip[0], ipv4, NULL, IRDMA_ARP_RESOLVE); in irdma_add_arp()
86 if (ether_addr_equal(rf->arp_table[arpidx].mac_addr, mac)) in irdma_add_arp()
89 irdma_manage_arp_cache(rf, rf->arp_table[arpidx].mac_addr, ip, in irdma_add_arp()
93 irdma_manage_arp_cache(rf, mac, ip, ipv4, IRDMA_ARP_ADD); in irdma_add_arp()
95 return irdma_arp_table(rf, ip, ipv4, NULL, IRDMA_ARP_RESOLVE); in irdma_add_arp()
173 irdma_manage_arp_cache(iwdev->rf, real_dev->dev_addr, in irdma_inetaddr_event()
180 irdma_add_arp(iwdev->rf, &local_ipaddr, true, real_dev->dev_addr); in irdma_inetaddr_event()
223 irdma_manage_arp_cache(iwdev->rf, real_dev->dev_addr, in irdma_inet6addr_event()
230 irdma_add_arp(iwdev->rf, local_ipaddr6, false, in irdma_inet6addr_event()
285 irdma_add_arp(iwdev->rf, local_ipaddr, ipv4, neigh->ha); in irdma_net_event()
288 irdma_manage_arp_cache(iwdev->rf, neigh->ha, in irdma_net_event()
366 irdma_manage_arp_cache(iwdev->rf, in irdma_add_ipv6_addr()
403 irdma_manage_arp_cache(iwdev->rf, dev->dev_addr, in irdma_add_ipv4_addr()
529 * @rf: RDMA PCI function
531 void irdma_cleanup_pending_cqp_op(struct irdma_pci_f *rf) in irdma_cleanup_pending_cqp_op() argument
533 struct irdma_sc_dev *dev = &rf->sc_dev; in irdma_cleanup_pending_cqp_op()
534 struct irdma_cqp *cqp = &rf->cqp; in irdma_cleanup_pending_cqp_op()
560 * @rf: RDMA PCI function
563 static int irdma_wait_event(struct irdma_pci_f *rf, in irdma_wait_event() argument
570 cqp_timeout.compl_cqp_cmds = atomic64_read(&rf->sc_dev.cqp->completed_ops); in irdma_wait_event()
572 irdma_cqp_ce_handler(rf, &rf->ccq.sc_cq); in irdma_wait_event()
578 irdma_check_cqp_progress(&cqp_timeout, &rf->sc_dev); in irdma_wait_event()
583 if (!rf->reset) { in irdma_wait_event()
584 rf->reset = true; in irdma_wait_event()
585 rf->gen_ops.request_reset(rf); in irdma_wait_event()
597 if (!rf->reset) { in irdma_wait_event()
598 rf->reset = true; in irdma_wait_event()
599 rf->gen_ops.request_reset(rf); in irdma_wait_event()
693 * @rf: RDMA PCI function
696 int irdma_handle_cqp_op(struct irdma_pci_f *rf, in irdma_handle_cqp_op() argument
699 struct irdma_sc_dev *dev = &rf->sc_dev; in irdma_handle_cqp_op()
704 if (rf->reset) in irdma_handle_cqp_op()
714 status = irdma_wait_event(rf, cqp_request); in irdma_handle_cqp_op()
725 ibdev_err(&rf->iwdev->ibdev, in irdma_handle_cqp_op()
732 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_handle_cqp_op()
751 spin_lock_irqsave(&iwdev->rf->qptable_lock, flags); in irdma_qp_rem_ref()
753 spin_unlock_irqrestore(&iwdev->rf->qptable_lock, flags); in irdma_qp_rem_ref()
758 iwdev->rf->qp_table[qp_num] = NULL; in irdma_qp_rem_ref()
759 spin_unlock_irqrestore(&iwdev->rf->qptable_lock, flags); in irdma_qp_rem_ref()
777 spin_lock_irqsave(&iwdev->rf->cqtable_lock, flags); in irdma_cq_rem_ref()
779 spin_unlock_irqrestore(&iwdev->rf->cqtable_lock, flags); in irdma_cq_rem_ref()
783 iwdev->rf->cq_table[iwcq->cq_num] = NULL; in irdma_cq_rem_ref()
784 spin_unlock_irqrestore(&iwdev->rf->cqtable_lock, flags); in irdma_cq_rem_ref()
802 if (qpn < IW_FIRST_QPN || qpn >= iwdev->rf->max_qp) in irdma_get_qp()
805 return &iwdev->rf->qp_table[qpn]->ibqp; in irdma_get_qp()
837 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_sds_cmd() local
840 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cqp_sds_cmd()
852 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_sds_cmd()
853 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_sds_cmd()
869 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_qp_suspend_resume() local
872 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, false); in irdma_cqp_qp_suspend_resume()
882 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_qp_suspend_resume()
883 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_qp_suspend_resume()
985 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_query_fpm_val_cmd() local
988 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cqp_query_fpm_val_cmd()
1002 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_query_fpm_val_cmd()
1003 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_query_fpm_val_cmd()
1019 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_commit_fpm_val_cmd() local
1022 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cqp_commit_fpm_val_cmd()
1036 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_commit_fpm_val_cmd()
1037 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_commit_fpm_val_cmd()
1049 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_cq_create_cmd() local
1050 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_cq_create_cmd()
1065 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_cq_create_cmd()
1078 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_qp_create_cmd() local
1079 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_qp_create_cmd()
1099 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_qp_create_cmd()
1107 * @rf: RDMA PCI function
1110 static void irdma_dealloc_push_page(struct irdma_pci_f *rf, in irdma_dealloc_push_page() argument
1120 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, false); in irdma_dealloc_push_page()
1131 cqp_info->in.u.manage_push_page.cqp = &rf->cqp.sc_cqp; in irdma_dealloc_push_page()
1133 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_dealloc_push_page()
1136 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_dealloc_push_page()
1146 struct irdma_pci_f *rf = iwdev->rf; in irdma_free_qp_rsrc() local
1150 irdma_dealloc_push_page(rf, &iwqp->sc_qp); in irdma_free_qp_rsrc()
1158 irdma_free_rsrc(rf, rf->allocated_qps, qp_num); in irdma_free_qp_rsrc()
1159 dma_free_coherent(rf->sc_dev.hw->device, iwqp->q2_ctx_mem.size, in irdma_free_qp_rsrc()
1162 dma_free_coherent(rf->sc_dev.hw->device, iwqp->kqp.dma_mem.size, in irdma_free_qp_rsrc()
1171 * @rf: RDMA PCI function
1174 void irdma_cq_wq_destroy(struct irdma_pci_f *rf, struct irdma_sc_cq *cq) in irdma_cq_wq_destroy() argument
1179 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cq_wq_destroy()
1189 irdma_handle_cqp_op(rf, cqp_request); in irdma_cq_wq_destroy()
1190 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cq_wq_destroy()
1219 struct irdma_pci_f *rf = iwdev->rf; in irdma_hw_modify_qp() local
1224 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, wait); in irdma_hw_modify_qp()
1239 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_hw_modify_qp()
1240 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_hw_modify_qp()
1259 irdma_gen_ae(rf, &iwqp->sc_qp, &ae_info, false); in irdma_hw_modify_qp()
1261 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, in irdma_hw_modify_qp()
1275 irdma_handle_cqp_op(rf, cqp_request); in irdma_hw_modify_qp()
1276 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_hw_modify_qp()
1295 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_cq_destroy_cmd() local
1297 irdma_cq_wq_destroy(rf, cq); in irdma_cqp_cq_destroy_cmd()
1307 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_qp_destroy_cmd() local
1308 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_qp_destroy_cmd()
1325 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_qp_destroy_cmd()
1326 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_qp_destroy_cmd()
1339 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_ieq_mpa_crc_ae() local
1341 ibdev_dbg(&rf->iwdev->ibdev, "AEQ: Generate MPA CRC AE\n"); in irdma_ieq_mpa_crc_ae()
1344 irdma_gen_ae(rf, qp, &info, false); in irdma_ieq_mpa_crc_ae()
1756 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_gather_stats_cmd() local
1757 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_gather_stats_cmd()
1772 cqp_info->in.u.stats_gather.cqp = &rf->cqp.sc_cqp; in irdma_cqp_gather_stats_cmd()
1776 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_gather_stats_cmd()
1779 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_gather_stats_cmd()
1793 struct irdma_pci_f *rf = dev_to_rf(vsi->dev); in irdma_cqp_stats_inst_cmd() local
1794 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_stats_inst_cmd()
1812 cqp_info->in.u.stats_manage.cqp = &rf->cqp.sc_cqp; in irdma_cqp_stats_inst_cmd()
1813 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_stats_inst_cmd()
1832 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_ceq_cmd() local
1835 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cqp_ceq_cmd()
1845 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_ceq_cmd()
1846 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_ceq_cmd()
1862 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_aeq_cmd() local
1865 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cqp_aeq_cmd()
1875 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_aeq_cmd()
1876 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_aeq_cmd()
1890 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_ws_node_cmd() local
1891 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_ws_node_cmd()
1898 if (!rf->sc_dev.ceq_valid) in irdma_cqp_ws_node_cmd()
1914 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_ws_node_cmd()
1924 ibdev_dbg(&rf->iwdev->ibdev, "DCB: opcode=%d, compl_info.retval=%d\n", in irdma_cqp_ws_node_cmd()
1931 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_ws_node_cmd()
1938 * @rf: RDMA PCI function
1947 int irdma_ah_cqp_op(struct irdma_pci_f *rf, struct irdma_sc_ah *sc_ah, u8 cmd, in irdma_ah_cqp_op() argument
1959 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, wait); in irdma_ah_cqp_op()
1969 cqp_info->in.u.ah_create.cqp = &rf->cqp.sc_cqp; in irdma_ah_cqp_op()
1973 cqp_info->in.u.ah_destroy.cqp = &rf->cqp.sc_cqp; in irdma_ah_cqp_op()
1980 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_ah_cqp_op()
1981 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_ah_cqp_op()
2042 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_puda_create_ah() local
2050 err = irdma_alloc_rsrc(rf, rf->allocated_ahs, rf->max_ah, in irdma_puda_create_ah()
2051 &ah_info->ah_idx, &rf->next_ah); in irdma_puda_create_ah()
2059 err = irdma_ah_cqp_op(rf, ah, IRDMA_OP_AH_CREATE, wait, in irdma_puda_create_ah()
2062 err = irdma_ah_cqp_op(rf, ah, IRDMA_OP_AH_CREATE, wait, in irdma_puda_create_ah()
2070 irdma_free_rsrc(rf, rf->allocated_ahs, ah->ah_info.ah_idx); in irdma_puda_create_ah()
2084 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_puda_free_ah() local
2090 irdma_ah_cqp_op(rf, ah, IRDMA_OP_AH_DESTROY, false, NULL, NULL); in irdma_puda_free_ah()
2091 irdma_free_rsrc(rf, rf->allocated_ahs, ah->ah_info.ah_idx); in irdma_puda_free_ah()
2310 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_alloc_ws_node_id() local
2314 if (irdma_alloc_rsrc(rf, rf->allocated_ws_nodes, rf->max_ws_node_id, in irdma_alloc_ws_node_id()
2328 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_free_ws_node_id() local
2330 irdma_free_rsrc(rf, rf->allocated_ws_nodes, (u32)node_id); in irdma_free_ws_node_id()
2342 if (qp->iwdev->rf->reset) in irdma_modify_qp_to_err()