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()
363 irdma_manage_arp_cache(iwdev->rf, in irdma_add_ipv6_addr()
400 irdma_manage_arp_cache(iwdev->rf, dev->dev_addr, in irdma_add_ipv4_addr()
526 * @rf: RDMA PCI function
528 void irdma_cleanup_pending_cqp_op(struct irdma_pci_f *rf) in irdma_cleanup_pending_cqp_op() argument
530 struct irdma_sc_dev *dev = &rf->sc_dev; in irdma_cleanup_pending_cqp_op()
531 struct irdma_cqp *cqp = &rf->cqp; in irdma_cleanup_pending_cqp_op()
557 * @rf: RDMA PCI function
560 static int irdma_wait_event(struct irdma_pci_f *rf, in irdma_wait_event() argument
567 cqp_timeout.compl_cqp_cmds = atomic64_read(&rf->sc_dev.cqp->completed_ops); in irdma_wait_event()
569 irdma_cqp_ce_handler(rf, &rf->ccq.sc_cq); in irdma_wait_event()
575 irdma_check_cqp_progress(&cqp_timeout, &rf->sc_dev); in irdma_wait_event()
580 if (!rf->reset) { in irdma_wait_event()
581 rf->reset = true; in irdma_wait_event()
582 rf->gen_ops.request_reset(rf); in irdma_wait_event()
594 if (!rf->reset) { in irdma_wait_event()
595 rf->reset = true; in irdma_wait_event()
596 rf->gen_ops.request_reset(rf); in irdma_wait_event()
690 * @rf: RDMA PCI function
693 int irdma_handle_cqp_op(struct irdma_pci_f *rf, in irdma_handle_cqp_op() argument
696 struct irdma_sc_dev *dev = &rf->sc_dev; in irdma_handle_cqp_op()
701 if (rf->reset) in irdma_handle_cqp_op()
711 status = irdma_wait_event(rf, cqp_request); in irdma_handle_cqp_op()
722 ibdev_err(&rf->iwdev->ibdev, in irdma_handle_cqp_op()
729 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_handle_cqp_op()
748 spin_lock_irqsave(&iwdev->rf->qptable_lock, flags); in irdma_qp_rem_ref()
750 spin_unlock_irqrestore(&iwdev->rf->qptable_lock, flags); in irdma_qp_rem_ref()
755 iwdev->rf->qp_table[qp_num] = NULL; in irdma_qp_rem_ref()
756 spin_unlock_irqrestore(&iwdev->rf->qptable_lock, flags); in irdma_qp_rem_ref()
774 spin_lock_irqsave(&iwdev->rf->cqtable_lock, flags); in irdma_cq_rem_ref()
776 spin_unlock_irqrestore(&iwdev->rf->cqtable_lock, flags); in irdma_cq_rem_ref()
780 iwdev->rf->cq_table[iwcq->cq_num] = NULL; in irdma_cq_rem_ref()
781 spin_unlock_irqrestore(&iwdev->rf->cqtable_lock, flags); in irdma_cq_rem_ref()
799 if (qpn < IW_FIRST_QPN || qpn >= iwdev->rf->max_qp) in irdma_get_qp()
802 return &iwdev->rf->qp_table[qpn]->ibqp; in irdma_get_qp()
834 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_sds_cmd() local
837 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cqp_sds_cmd()
849 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_sds_cmd()
850 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_sds_cmd()
866 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_qp_suspend_resume() local
869 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, false); in irdma_cqp_qp_suspend_resume()
879 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_qp_suspend_resume()
880 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_qp_suspend_resume()
978 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_cq_create_cmd() local
979 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_cq_create_cmd()
994 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_cq_create_cmd()
1007 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_qp_create_cmd() local
1008 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_qp_create_cmd()
1028 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_qp_create_cmd()
1036 * @rf: RDMA PCI function
1039 static void irdma_dealloc_push_page(struct irdma_pci_f *rf, in irdma_dealloc_push_page() argument
1049 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, false); in irdma_dealloc_push_page()
1060 cqp_info->in.u.manage_push_page.cqp = &rf->cqp.sc_cqp; in irdma_dealloc_push_page()
1062 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_dealloc_push_page()
1065 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_dealloc_push_page()
1075 struct irdma_pci_f *rf = iwdev->rf; in irdma_free_qp_rsrc() local
1079 irdma_dealloc_push_page(rf, &iwqp->sc_qp); in irdma_free_qp_rsrc()
1087 irdma_free_rsrc(rf, rf->allocated_qps, qp_num); in irdma_free_qp_rsrc()
1088 dma_free_coherent(rf->sc_dev.hw->device, iwqp->q2_ctx_mem.size, in irdma_free_qp_rsrc()
1091 dma_free_coherent(rf->sc_dev.hw->device, iwqp->kqp.dma_mem.size, in irdma_free_qp_rsrc()
1100 * @rf: RDMA PCI function
1103 void irdma_cq_wq_destroy(struct irdma_pci_f *rf, struct irdma_sc_cq *cq) in irdma_cq_wq_destroy() argument
1108 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cq_wq_destroy()
1118 irdma_handle_cqp_op(rf, cqp_request); in irdma_cq_wq_destroy()
1119 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cq_wq_destroy()
1148 struct irdma_pci_f *rf = iwdev->rf; in irdma_hw_modify_qp() local
1153 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, wait); in irdma_hw_modify_qp()
1168 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_hw_modify_qp()
1169 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_hw_modify_qp()
1188 irdma_gen_ae(rf, &iwqp->sc_qp, &ae_info, false); in irdma_hw_modify_qp()
1190 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, in irdma_hw_modify_qp()
1204 irdma_handle_cqp_op(rf, cqp_request); in irdma_hw_modify_qp()
1205 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_hw_modify_qp()
1224 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_cq_destroy_cmd() local
1226 irdma_cq_wq_destroy(rf, cq); in irdma_cqp_cq_destroy_cmd()
1236 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_qp_destroy_cmd() local
1237 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_qp_destroy_cmd()
1254 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_qp_destroy_cmd()
1255 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_qp_destroy_cmd()
1268 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_ieq_mpa_crc_ae() local
1270 ibdev_dbg(&rf->iwdev->ibdev, "AEQ: Generate MPA CRC AE\n"); in irdma_ieq_mpa_crc_ae()
1273 irdma_gen_ae(rf, qp, &info, false); in irdma_ieq_mpa_crc_ae()
1642 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_gather_stats_cmd() local
1643 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_gather_stats_cmd()
1658 cqp_info->in.u.stats_gather.cqp = &rf->cqp.sc_cqp; in irdma_cqp_gather_stats_cmd()
1662 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_gather_stats_cmd()
1665 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_gather_stats_cmd()
1679 struct irdma_pci_f *rf = dev_to_rf(vsi->dev); in irdma_cqp_stats_inst_cmd() local
1680 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_stats_inst_cmd()
1698 cqp_info->in.u.stats_manage.cqp = &rf->cqp.sc_cqp; in irdma_cqp_stats_inst_cmd()
1699 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_stats_inst_cmd()
1718 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_ceq_cmd() local
1721 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cqp_ceq_cmd()
1731 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_ceq_cmd()
1732 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_ceq_cmd()
1748 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_aeq_cmd() local
1751 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, true); in irdma_cqp_aeq_cmd()
1761 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_aeq_cmd()
1762 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_aeq_cmd()
1776 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_cqp_ws_node_cmd() local
1777 struct irdma_cqp *iwcqp = &rf->cqp; in irdma_cqp_ws_node_cmd()
1784 if (!rf->sc_dev.ceq_valid) in irdma_cqp_ws_node_cmd()
1800 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_cqp_ws_node_cmd()
1810 ibdev_dbg(&rf->iwdev->ibdev, "DCB: opcode=%d, compl_info.retval=%d\n", in irdma_cqp_ws_node_cmd()
1817 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_cqp_ws_node_cmd()
1824 * @rf: RDMA PCI function
1833 int irdma_ah_cqp_op(struct irdma_pci_f *rf, struct irdma_sc_ah *sc_ah, u8 cmd, in irdma_ah_cqp_op() argument
1845 cqp_request = irdma_alloc_and_get_cqp_request(&rf->cqp, wait); in irdma_ah_cqp_op()
1855 cqp_info->in.u.ah_create.cqp = &rf->cqp.sc_cqp; in irdma_ah_cqp_op()
1859 cqp_info->in.u.ah_destroy.cqp = &rf->cqp.sc_cqp; in irdma_ah_cqp_op()
1866 status = irdma_handle_cqp_op(rf, cqp_request); in irdma_ah_cqp_op()
1867 irdma_put_cqp_request(&rf->cqp, cqp_request); in irdma_ah_cqp_op()
1928 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_puda_create_ah() local
1936 err = irdma_alloc_rsrc(rf, rf->allocated_ahs, rf->max_ah, in irdma_puda_create_ah()
1937 &ah_info->ah_idx, &rf->next_ah); in irdma_puda_create_ah()
1945 err = irdma_ah_cqp_op(rf, ah, IRDMA_OP_AH_CREATE, wait, in irdma_puda_create_ah()
1948 err = irdma_ah_cqp_op(rf, ah, IRDMA_OP_AH_CREATE, wait, in irdma_puda_create_ah()
1956 irdma_free_rsrc(rf, rf->allocated_ahs, ah->ah_info.ah_idx); in irdma_puda_create_ah()
1970 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_puda_free_ah() local
1976 irdma_ah_cqp_op(rf, ah, IRDMA_OP_AH_DESTROY, false, NULL, NULL); in irdma_puda_free_ah()
1977 irdma_free_rsrc(rf, rf->allocated_ahs, ah->ah_info.ah_idx); in irdma_puda_free_ah()
2196 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_alloc_ws_node_id() local
2200 if (irdma_alloc_rsrc(rf, rf->allocated_ws_nodes, rf->max_ws_node_id, in irdma_alloc_ws_node_id()
2214 struct irdma_pci_f *rf = dev_to_rf(dev); in irdma_free_ws_node_id() local
2216 irdma_free_rsrc(rf, rf->allocated_ws_nodes, (u32)node_id); in irdma_free_ws_node_id()
2228 if (qp->iwdev->rf->reset) in irdma_modify_qp_to_err()