| /Linux-v5.15/drivers/infiniband/hw/hns/ |
| D | hns_roce_main.c | 45 static int hns_roce_set_mac(struct hns_roce_dev *hr_dev, u32 port, u8 *addr) in hns_roce_set_mac() argument 50 if (hr_dev->pci_dev->revision >= PCI_REVISION_ID_HIP09) in hns_roce_set_mac() 53 if (!memcmp(hr_dev->dev_addr[port], addr, ETH_ALEN)) in hns_roce_set_mac() 57 hr_dev->dev_addr[port][i] = addr[i]; in hns_roce_set_mac() 59 phy_port = hr_dev->iboe.phy_port[port]; in hns_roce_set_mac() 60 return hr_dev->hw->set_mac(hr_dev, phy_port, addr); in hns_roce_set_mac() 65 struct hns_roce_dev *hr_dev = to_hr_dev(attr->device); in hns_roce_add_gid() local 69 if (port >= hr_dev->caps.num_ports) in hns_roce_add_gid() 72 ret = hr_dev->hw->set_gid(hr_dev, port, attr->index, &attr->gid, attr); in hns_roce_add_gid() 79 struct hns_roce_dev *hr_dev = to_hr_dev(attr->device); in hns_roce_del_gid() local [all …]
|
| D | hns_roce_cmd.c | 42 static int hns_roce_cmd_mbox_post_hw(struct hns_roce_dev *hr_dev, u64 in_param, in hns_roce_cmd_mbox_post_hw() argument 47 return hr_dev->hw->post_mbox(hr_dev, in_param, out_param, in_modifier, in hns_roce_cmd_mbox_post_hw() 52 static int __hns_roce_cmd_mbox_poll(struct hns_roce_dev *hr_dev, u64 in_param, in __hns_roce_cmd_mbox_poll() argument 59 ret = hns_roce_cmd_mbox_post_hw(hr_dev, in_param, out_param, in __hns_roce_cmd_mbox_poll() 63 dev_err_ratelimited(hr_dev->dev, in __hns_roce_cmd_mbox_poll() 69 return hr_dev->hw->poll_mbox_done(hr_dev, timeout); in __hns_roce_cmd_mbox_poll() 72 static int hns_roce_cmd_mbox_poll(struct hns_roce_dev *hr_dev, u64 in_param, in hns_roce_cmd_mbox_poll() argument 78 down(&hr_dev->cmd.poll_sem); in hns_roce_cmd_mbox_poll() 79 ret = __hns_roce_cmd_mbox_poll(hr_dev, in_param, out_param, in_modifier, in hns_roce_cmd_mbox_poll() 81 up(&hr_dev->cmd.poll_sem); in hns_roce_cmd_mbox_poll() [all …]
|
| D | hns_roce_qp.c | 49 struct device *dev = flush_work->hr_dev->dev; in flush_work_handle() 72 void init_flush_work(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp) in init_flush_work() argument 76 flush_work->hr_dev = hr_dev; in init_flush_work() 79 queue_work(hr_dev->irq_workq, &flush_work->work); in init_flush_work() 97 void hns_roce_qp_event(struct hns_roce_dev *hr_dev, u32 qpn, int event_type) in hns_roce_qp_event() argument 99 struct device *dev = hr_dev->dev; in hns_roce_qp_event() 102 xa_lock(&hr_dev->qp_table_xa); in hns_roce_qp_event() 103 qp = __hns_roce_qp_lookup(hr_dev, qpn); in hns_roce_qp_event() 106 xa_unlock(&hr_dev->qp_table_xa); in hns_roce_qp_event() 113 if (hr_dev->hw_rev != HNS_ROCE_HW_VER1 && in hns_roce_qp_event() [all …]
|
| D | hns_roce_cq.c | 59 static int alloc_cqn(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq) in alloc_cqn() argument 61 struct hns_roce_cq_table *cq_table = &hr_dev->cq_table; in alloc_cqn() 90 static void free_cqn(struct hns_roce_dev *hr_dev, unsigned long cqn) in free_cqn() argument 92 struct hns_roce_cq_table *cq_table = &hr_dev->cq_table; in free_cqn() 104 static int alloc_cqc(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq) in alloc_cqc() argument 106 struct hns_roce_cq_table *cq_table = &hr_dev->cq_table; in alloc_cqc() 107 struct ib_device *ibdev = &hr_dev->ib_dev; in alloc_cqc() 113 ret = hns_roce_mtr_find(hr_dev, &hr_cq->mtr, 0, mtts, ARRAY_SIZE(mtts), in alloc_cqc() 121 ret = hns_roce_table_get(hr_dev, &cq_table->table, hr_cq->cqn); in alloc_cqc() 135 mailbox = hns_roce_alloc_cmd_mailbox(hr_dev); in alloc_cqc() [all …]
|
| D | hns_roce_mr.c | 51 static int hns_roce_hw_create_mpt(struct hns_roce_dev *hr_dev, in hns_roce_hw_create_mpt() argument 55 return hns_roce_cmd_mbox(hr_dev, mailbox->dma, 0, mpt_index, 0, in hns_roce_hw_create_mpt() 60 int hns_roce_hw_destroy_mpt(struct hns_roce_dev *hr_dev, in hns_roce_hw_destroy_mpt() argument 64 return hns_roce_cmd_mbox(hr_dev, 0, mailbox ? mailbox->dma : 0, in hns_roce_hw_destroy_mpt() 69 static int alloc_mr_key(struct hns_roce_dev *hr_dev, struct hns_roce_mr *mr) in alloc_mr_key() argument 71 struct hns_roce_ida *mtpt_ida = &hr_dev->mr_table.mtpt_ida; in alloc_mr_key() 72 struct ib_device *ibdev = &hr_dev->ib_dev; in alloc_mr_key() 86 err = hns_roce_table_get(hr_dev, &hr_dev->mr_table.mtpt_table, in alloc_mr_key() 99 static void free_mr_key(struct hns_roce_dev *hr_dev, struct hns_roce_mr *mr) in free_mr_key() argument 103 hns_roce_table_put(hr_dev, &hr_dev->mr_table.mtpt_table, obj); in free_mr_key() [all …]
|
| D | hns_roce_hem.c | 49 bool hns_roce_check_whether_mhop(struct hns_roce_dev *hr_dev, u32 type) in hns_roce_check_whether_mhop() argument 55 hop_num = hr_dev->caps.qpc_hop_num; in hns_roce_check_whether_mhop() 58 hop_num = hr_dev->caps.mpt_hop_num; in hns_roce_check_whether_mhop() 61 hop_num = hr_dev->caps.cqc_hop_num; in hns_roce_check_whether_mhop() 64 hop_num = hr_dev->caps.srqc_hop_num; in hns_roce_check_whether_mhop() 67 hop_num = hr_dev->caps.sccc_hop_num; in hns_roce_check_whether_mhop() 70 hop_num = hr_dev->caps.qpc_timer_hop_num; in hns_roce_check_whether_mhop() 73 hop_num = hr_dev->caps.cqc_timer_hop_num; in hns_roce_check_whether_mhop() 76 hop_num = hr_dev->caps.gmv_hop_num; in hns_roce_check_whether_mhop() 123 static int get_hem_table_config(struct hns_roce_dev *hr_dev, in get_hem_table_config() argument [all …]
|
| D | hns_roce_srq.c | 12 void hns_roce_srq_event(struct hns_roce_dev *hr_dev, u32 srqn, int event_type) in hns_roce_srq_event() argument 14 struct hns_roce_srq_table *srq_table = &hr_dev->srq_table; in hns_roce_srq_event() 18 srq = xa_load(&srq_table->xa, srqn & (hr_dev->caps.num_srqs - 1)); in hns_roce_srq_event() 24 dev_warn(hr_dev->dev, "Async event for bogus SRQ %08x\n", srqn); in hns_roce_srq_event() 37 struct hns_roce_dev *hr_dev = to_hr_dev(srq->ibsrq.device); in hns_roce_ib_srq_event() local 52 dev_err(hr_dev->dev, in hns_roce_ib_srq_event() 80 static int alloc_srqc(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq) in alloc_srqc() argument 82 struct hns_roce_srq_table *srq_table = &hr_dev->srq_table; in alloc_srqc() 83 struct hns_roce_ida *srq_ida = &hr_dev->srq_table.srq_ida; in alloc_srqc() 84 struct ib_device *ibdev = &hr_dev->ib_dev; in alloc_srqc() [all …]
|
| D | hns_roce_pd.c | 37 void hns_roce_init_pd_table(struct hns_roce_dev *hr_dev) in hns_roce_init_pd_table() argument 39 struct hns_roce_ida *pd_ida = &hr_dev->pd_ida; in hns_roce_init_pd_table() 42 pd_ida->max = hr_dev->caps.num_pds - 1; in hns_roce_init_pd_table() 43 pd_ida->min = hr_dev->caps.reserved_pds; in hns_roce_init_pd_table() 49 struct hns_roce_dev *hr_dev = to_hr_dev(ib_dev); in hns_roce_alloc_pd() local 50 struct hns_roce_ida *pd_ida = &hr_dev->pd_ida; in hns_roce_alloc_pd() 79 struct hns_roce_dev *hr_dev = to_hr_dev(pd->device); in hns_roce_dealloc_pd() local 81 ida_free(&hr_dev->pd_ida.ida, (int)to_hr_pd(pd)->pdn); in hns_roce_dealloc_pd() 86 int hns_roce_uar_alloc(struct hns_roce_dev *hr_dev, struct hns_roce_uar *uar) in hns_roce_uar_alloc() argument 88 struct hns_roce_ida *uar_ida = &hr_dev->uar_ida; in hns_roce_uar_alloc() [all …]
|
| D | hns_roce_hw_v2.c | 237 struct hns_roce_dev *hr_dev = to_hr_dev(qp->ibqp.device); in check_inl_data_len() local 241 ibdev_err(&hr_dev->ib_dev, in check_inl_data_len() 254 struct hns_roce_dev *hr_dev = to_hr_dev(qp->ibqp.device); in set_rc_inl() local 256 struct ib_device *ibdev = &hr_dev->ib_dev; in set_rc_inl() 348 static int check_send_valid(struct hns_roce_dev *hr_dev, in check_send_valid() argument 351 struct ib_device *ibdev = &hr_dev->ib_dev; in check_send_valid() 366 } else if (unlikely(hr_dev->state >= HNS_ROCE_DEVICE_STATE_RST_DOWN)) { in check_send_valid() 368 hr_dev->state); in check_send_valid() 424 struct hns_roce_dev *hr_dev = to_hr_dev(ib_dev); in fill_ud_av() local 447 if (hr_dev->pci_dev->revision >= PCI_REVISION_ID_HIP09) in fill_ud_av() [all …]
|
| D | hns_roce_hw_v1.c | 57 u8 hns_get_gid_index(struct hns_roce_dev *hr_dev, u32 port, int gid_index) in hns_get_gid_index() argument 59 return gid_index * hr_dev->caps.num_ports + port; in hns_get_gid_index() 81 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v1_post_send() local 87 struct device *dev = &hr_dev->pdev->dev; in hns_roce_v1_post_send() 157 smac = (u8 *)hr_dev->dev_addr[qp->port]; in hns_roce_v1_post_send() 203 hns_get_gid_index(hr_dev, qp->phy_port, in hns_roce_v1_post_send() 303 hr_dev->caps.max_sq_inline) { in hns_roce_v1_post_send() 308 hr_dev->caps.max_sq_inline); in hns_roce_v1_post_send() 363 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device); in hns_roce_v1_post_recv() local 364 struct device *dev = &hr_dev->pdev->dev; in hns_roce_v1_post_recv() [all …]
|
| D | hns_roce_alloc.c | 39 void hns_roce_buf_free(struct hns_roce_dev *hr_dev, struct hns_roce_buf *buf) in hns_roce_buf_free() argument 51 dma_free_coherent(hr_dev->dev, 1 << buf->trunk_shift, in hns_roce_buf_free() 67 struct hns_roce_buf *hns_roce_buf_alloc(struct hns_roce_dev *hr_dev, u32 size, in hns_roce_buf_alloc() argument 106 trunks[i].buf = dma_alloc_coherent(hr_dev->dev, trunk_size, in hns_roce_buf_alloc() 119 dma_free_coherent(hr_dev->dev, trunk_size, in hns_roce_buf_alloc() 133 int hns_roce_get_kmem_bufs(struct hns_roce_dev *hr_dev, dma_addr_t *bufs, in hns_roce_get_kmem_bufs() argument 142 dev_err(hr_dev->dev, "failed to check kmem buf shift %u > %u\n", in hns_roce_get_kmem_bufs() 157 int hns_roce_get_umem_bufs(struct hns_roce_dev *hr_dev, dma_addr_t *bufs, in hns_roce_get_umem_bufs() argument 175 void hns_roce_cleanup_bitmap(struct hns_roce_dev *hr_dev) in hns_roce_cleanup_bitmap() argument 177 if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_XRC) in hns_roce_cleanup_bitmap() [all …]
|
| D | hns_roce_device.h | 610 struct hns_roce_dev *hr_dev; member 704 struct hns_roce_dev *hr_dev; member 876 int (*query_cqc_info)(struct hns_roce_dev *hr_dev, u32 cqn, 887 int (*reset)(struct hns_roce_dev *hr_dev, bool enable); 888 int (*cmq_init)(struct hns_roce_dev *hr_dev); 889 void (*cmq_exit)(struct hns_roce_dev *hr_dev); 890 int (*hw_profile)(struct hns_roce_dev *hr_dev); 891 int (*hw_init)(struct hns_roce_dev *hr_dev); 892 void (*hw_exit)(struct hns_roce_dev *hr_dev); 893 int (*post_mbox)(struct hns_roce_dev *hr_dev, u64 in_param, [all …]
|
| D | hns_roce_hem.h | 104 void hns_roce_free_hem(struct hns_roce_dev *hr_dev, struct hns_roce_hem *hem); 105 int hns_roce_table_get(struct hns_roce_dev *hr_dev, 107 void hns_roce_table_put(struct hns_roce_dev *hr_dev, 109 void *hns_roce_table_find(struct hns_roce_dev *hr_dev, 112 int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, 116 void hns_roce_cleanup_hem_table(struct hns_roce_dev *hr_dev, 118 void hns_roce_cleanup_hem(struct hns_roce_dev *hr_dev); 119 int hns_roce_calc_hem_mhop(struct hns_roce_dev *hr_dev, 122 bool hns_roce_check_whether_mhop(struct hns_roce_dev *hr_dev, u32 type); 127 int hns_roce_hem_list_request(struct hns_roce_dev *hr_dev, [all …]
|
| D | hns_roce_hw_v2_dfx.c | 9 int hns_roce_v2_query_cqc_info(struct hns_roce_dev *hr_dev, u32 cqn, in hns_roce_v2_query_cqc_info() argument 16 mailbox = hns_roce_alloc_cmd_mailbox(hr_dev); in hns_roce_v2_query_cqc_info() 21 ret = hns_roce_cmd_mbox(hr_dev, 0, mailbox->dma, cqn, 0, in hns_roce_v2_query_cqc_info() 25 dev_err(hr_dev->dev, "QUERY cqc cmd process error\n"); in hns_roce_v2_query_cqc_info() 32 hns_roce_free_cmd_mailbox(hr_dev, mailbox); in hns_roce_v2_query_cqc_info()
|
| D | hns_roce_db.c | 125 int hns_roce_alloc_db(struct hns_roce_dev *hr_dev, struct hns_roce_db *db, in hns_roce_alloc_db() argument 131 mutex_lock(&hr_dev->pgdir_mutex); in hns_roce_alloc_db() 133 list_for_each_entry(pgdir, &hr_dev->pgdir_list, list) in hns_roce_alloc_db() 137 pgdir = hns_roce_alloc_db_pgdir(hr_dev->dev); in hns_roce_alloc_db() 143 list_add(&pgdir->list, &hr_dev->pgdir_list); in hns_roce_alloc_db() 149 mutex_unlock(&hr_dev->pgdir_mutex); in hns_roce_alloc_db() 154 void hns_roce_free_db(struct hns_roce_dev *hr_dev, struct hns_roce_db *db) in hns_roce_free_db() argument 159 mutex_lock(&hr_dev->pgdir_mutex); in hns_roce_free_db() 174 dma_free_coherent(hr_dev->dev, PAGE_SIZE, db->u.pgdir->page, in hns_roce_free_db() 180 mutex_unlock(&hr_dev->pgdir_mutex); in hns_roce_free_db()
|
| D | hns_roce_restrack.c | 82 struct hns_roce_dev *hr_dev = to_hr_dev(ib_cq->device); in hns_roce_fill_res_cq_entry() local 88 if (!hr_dev->dfx->query_cqc_info) in hns_roce_fill_res_cq_entry() 95 ret = hr_dev->dfx->query_cqc_info(hr_dev, hr_cq->cqn, (int *)context); in hns_roce_fill_res_cq_entry()
|
| D | hns_roce_cmd.h | 142 int hns_roce_cmd_mbox(struct hns_roce_dev *hr_dev, u64 in_param, u64 out_param, 147 hns_roce_alloc_cmd_mailbox(struct hns_roce_dev *hr_dev); 148 void hns_roce_free_cmd_mailbox(struct hns_roce_dev *hr_dev,
|
| D | hns_roce_ah.c | 60 struct hns_roce_dev *hr_dev = to_hr_dev(ibah->device); in hns_roce_create_ah() local 64 if (hr_dev->pci_dev->revision <= PCI_REVISION_ID_HIP08 && udata) in hns_roce_create_ah() 83 if (hr_dev->pci_dev->revision <= PCI_REVISION_ID_HIP08) { in hns_roce_create_ah()
|
| D | hns_roce_hw_v2.h | 1562 int hns_roce_v2_query_cqc_info(struct hns_roce_dev *hr_dev, u32 cqn, 1565 static inline void hns_roce_write64(struct hns_roce_dev *hr_dev, __le32 val[2], in hns_roce_write64() argument 1568 struct hns_roce_v2_priv *priv = hr_dev->priv; in hns_roce_write64() 1572 if (!hr_dev->dis_db && !ops->get_hw_reset_stat(handle)) in hns_roce_write64()
|