mhop 124 drivers/infiniband/hw/hns/hns_roce_hem.c struct hns_roce_hem_mhop *mhop, mhop 131 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.qpc_buf_pg_sz mhop 133 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.qpc_ba_pg_sz mhop 135 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = hr_dev->caps.qpc_bt_num; mhop 136 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.qpc_hop_num; mhop 139 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.mpt_buf_pg_sz mhop 141 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.mpt_ba_pg_sz mhop 143 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = hr_dev->caps.mpt_bt_num; mhop 144 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.mpt_hop_num; mhop 147 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.cqc_buf_pg_sz mhop 149 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.cqc_ba_pg_sz mhop 151 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = hr_dev->caps.cqc_bt_num; mhop 152 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.cqc_hop_num; mhop 155 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.sccc_buf_pg_sz mhop 157 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.sccc_ba_pg_sz mhop 159 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = hr_dev->caps.sccc_bt_num; mhop 160 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.sccc_hop_num; mhop 163 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.qpc_timer_buf_pg_sz mhop 165 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.qpc_timer_ba_pg_sz mhop 167 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = hr_dev->caps.qpc_timer_bt_num; mhop 168 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.qpc_timer_hop_num; mhop 171 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.cqc_timer_buf_pg_sz mhop 173 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.cqc_timer_ba_pg_sz mhop 175 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = hr_dev->caps.cqc_timer_bt_num; mhop 176 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.cqc_timer_hop_num; mhop 179 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.srqc_buf_pg_sz mhop 181 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.srqc_ba_pg_sz mhop 183 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = hr_dev->caps.srqc_bt_num; mhop 184 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.srqc_hop_num; mhop 187 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.mtt_buf_pg_sz mhop 189 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.mtt_ba_pg_sz mhop 191 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = mhop->bt_chunk_size / BA_BYTE_LEN; mhop 192 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.mtt_hop_num; mhop 195 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.cqe_buf_pg_sz mhop 197 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.cqe_ba_pg_sz mhop 199 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = mhop->bt_chunk_size / BA_BYTE_LEN; mhop 200 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.cqe_hop_num; mhop 203 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.srqwqe_buf_pg_sz mhop 205 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.srqwqe_ba_pg_sz mhop 207 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = mhop->bt_chunk_size / BA_BYTE_LEN; mhop 208 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.srqwqe_hop_num; mhop 211 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->buf_chunk_size = 1 << (hr_dev->caps.idx_buf_pg_sz mhop 213 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size = 1 << (hr_dev->caps.idx_ba_pg_sz mhop 215 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->ba_l0_num = mhop->bt_chunk_size / BA_BYTE_LEN; mhop 216 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->hop_num = hr_dev->caps.idx_hop_num; mhop 229 drivers/infiniband/hw/hns/hns_roce_hem.c struct hns_roce_hem_mhop *mhop) mhop 237 drivers/infiniband/hw/hns/hns_roce_hem.c if (get_hem_table_config(hr_dev, mhop, table->type)) mhop 247 drivers/infiniband/hw/hns/hns_roce_hem.c bt_num = hns_roce_get_bt_num(table->type, mhop->hop_num); mhop 248 drivers/infiniband/hw/hns/hns_roce_hem.c chunk_ba_num = mhop->bt_chunk_size / BA_BYTE_LEN; mhop 249 drivers/infiniband/hw/hns/hns_roce_hem.c chunk_size = table->type < HEM_TYPE_MTT ? mhop->buf_chunk_size : mhop 250 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->bt_chunk_size; mhop 255 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->l2_idx = table_idx & (chunk_ba_num - 1); mhop 256 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->l1_idx = table_idx / chunk_ba_num & (chunk_ba_num - 1); mhop 257 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->l0_idx = (table_idx / chunk_ba_num) / chunk_ba_num; mhop 260 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->l1_idx = table_idx & (chunk_ba_num - 1); mhop 261 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->l0_idx = table_idx / chunk_ba_num; mhop 264 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->l0_idx = table_idx; mhop 268 drivers/infiniband/hw/hns/hns_roce_hem.c table->type, mhop->hop_num); mhop 271 drivers/infiniband/hw/hns/hns_roce_hem.c if (mhop->l0_idx >= mhop->ba_l0_num) mhop 272 drivers/infiniband/hw/hns/hns_roce_hem.c mhop->l0_idx %= mhop->ba_l0_num; mhop 442 drivers/infiniband/hw/hns/hns_roce_hem.c struct hns_roce_hem_mhop mhop; mhop 460 drivers/infiniband/hw/hns/hns_roce_hem.c ret = hns_roce_calc_hem_mhop(hr_dev, table, &mhop_obj, &mhop); mhop 464 drivers/infiniband/hw/hns/hns_roce_hem.c buf_chunk_size = mhop.buf_chunk_size; mhop 465 drivers/infiniband/hw/hns/hns_roce_hem.c bt_chunk_size = mhop.bt_chunk_size; mhop 466 drivers/infiniband/hw/hns/hns_roce_hem.c hop_num = mhop.hop_num; mhop 472 drivers/infiniband/hw/hns/hns_roce_hem.c hem_idx = mhop.l0_idx * chunk_ba_num * chunk_ba_num + mhop 473 drivers/infiniband/hw/hns/hns_roce_hem.c mhop.l1_idx * chunk_ba_num + mhop.l2_idx; mhop 474 drivers/infiniband/hw/hns/hns_roce_hem.c bt_l1_idx = mhop.l0_idx * chunk_ba_num + mhop.l1_idx; mhop 475 drivers/infiniband/hw/hns/hns_roce_hem.c bt_l0_idx = mhop.l0_idx; mhop 478 drivers/infiniband/hw/hns/hns_roce_hem.c hem_idx = mhop.l0_idx * chunk_ba_num + mhop.l1_idx; mhop 479 drivers/infiniband/hw/hns/hns_roce_hem.c bt_l0_idx = mhop.l0_idx; mhop 482 drivers/infiniband/hw/hns/hns_roce_hem.c hem_idx = mhop.l0_idx; mhop 538 drivers/infiniband/hw/hns/hns_roce_hem.c *(table->bt_l0[bt_l0_idx] + mhop.l1_idx) = mhop 570 drivers/infiniband/hw/hns/hns_roce_hem.c *(table->bt_l1[bt_l1_idx] + mhop.l2_idx) = bt_ba; mhop 573 drivers/infiniband/hw/hns/hns_roce_hem.c *(table->bt_l0[bt_l0_idx] + mhop.l1_idx) = bt_ba; mhop 589 drivers/infiniband/hw/hns/hns_roce_hem.c *(table->bt_l0[bt_l0_idx] + mhop.l1_idx) = bt_ba; mhop 665 drivers/infiniband/hw/hns/hns_roce_hem.c struct hns_roce_hem_mhop mhop; mhop 676 drivers/infiniband/hw/hns/hns_roce_hem.c ret = hns_roce_calc_hem_mhop(hr_dev, table, &mhop_obj, &mhop); mhop 680 drivers/infiniband/hw/hns/hns_roce_hem.c bt_chunk_size = mhop.bt_chunk_size; mhop 681 drivers/infiniband/hw/hns/hns_roce_hem.c hop_num = mhop.hop_num; mhop 687 drivers/infiniband/hw/hns/hns_roce_hem.c hem_idx = mhop.l0_idx * chunk_ba_num * chunk_ba_num + mhop 688 drivers/infiniband/hw/hns/hns_roce_hem.c mhop.l1_idx * chunk_ba_num + mhop.l2_idx; mhop 689 drivers/infiniband/hw/hns/hns_roce_hem.c bt_l1_idx = mhop.l0_idx * chunk_ba_num + mhop.l1_idx; mhop 692 drivers/infiniband/hw/hns/hns_roce_hem.c hem_idx = mhop.l0_idx * chunk_ba_num + mhop.l1_idx; mhop 695 drivers/infiniband/hw/hns/hns_roce_hem.c hem_idx = mhop.l0_idx; mhop 730 drivers/infiniband/hw/hns/hns_roce_hem.c start_idx = mhop.l0_idx * chunk_ba_num; mhop 738 drivers/infiniband/hw/hns/hns_roce_hem.c table->bt_l0[mhop.l0_idx], mhop 739 drivers/infiniband/hw/hns/hns_roce_hem.c table->bt_l0_dma_addr[mhop.l0_idx]); mhop 740 drivers/infiniband/hw/hns/hns_roce_hem.c table->bt_l0[mhop.l0_idx] = NULL; mhop 743 drivers/infiniband/hw/hns/hns_roce_hem.c start_idx = mhop.l0_idx * chunk_ba_num * chunk_ba_num + mhop 744 drivers/infiniband/hw/hns/hns_roce_hem.c mhop.l1_idx * chunk_ba_num; mhop 755 drivers/infiniband/hw/hns/hns_roce_hem.c start_idx = mhop.l0_idx * chunk_ba_num; mhop 763 drivers/infiniband/hw/hns/hns_roce_hem.c table->bt_l0[mhop.l0_idx], mhop 764 drivers/infiniband/hw/hns/hns_roce_hem.c table->bt_l0_dma_addr[mhop.l0_idx]); mhop 765 drivers/infiniband/hw/hns/hns_roce_hem.c table->bt_l0[mhop.l0_idx] = NULL; mhop 806 drivers/infiniband/hw/hns/hns_roce_hem.c struct hns_roce_hem_mhop mhop; mhop 830 drivers/infiniband/hw/hns/hns_roce_hem.c if (hns_roce_calc_hem_mhop(hr_dev, table, &mhop_obj, &mhop)) mhop 833 drivers/infiniband/hw/hns/hns_roce_hem.c i = mhop.l0_idx; mhop 834 drivers/infiniband/hw/hns/hns_roce_hem.c j = mhop.l1_idx; mhop 835 drivers/infiniband/hw/hns/hns_roce_hem.c if (mhop.hop_num == 2) mhop 836 drivers/infiniband/hw/hns/hns_roce_hem.c hem_idx = i * (mhop.bt_chunk_size / BA_BYTE_LEN) + j; mhop 837 drivers/infiniband/hw/hns/hns_roce_hem.c else if (mhop.hop_num == 1 || mhop 838 drivers/infiniband/hw/hns/hns_roce_hem.c mhop.hop_num == HNS_ROCE_HOP_NUM_0) mhop 843 drivers/infiniband/hw/hns/hns_roce_hem.c mhop.bt_chunk_size; mhop 844 drivers/infiniband/hw/hns/hns_roce_hem.c if (mhop.hop_num == 2) mhop 878 drivers/infiniband/hw/hns/hns_roce_hem.c struct hns_roce_hem_mhop mhop; mhop 884 drivers/infiniband/hw/hns/hns_roce_hem.c ret = hns_roce_calc_hem_mhop(hr_dev, table, NULL, &mhop); mhop 887 drivers/infiniband/hw/hns/hns_roce_hem.c inc = mhop.bt_chunk_size / table->obj_size; mhop 911 drivers/infiniband/hw/hns/hns_roce_hem.c struct hns_roce_hem_mhop mhop; mhop 916 drivers/infiniband/hw/hns/hns_roce_hem.c if (hns_roce_calc_hem_mhop(hr_dev, table, NULL, &mhop)) mhop 918 drivers/infiniband/hw/hns/hns_roce_hem.c inc = mhop.bt_chunk_size / table->obj_size; mhop 942 drivers/infiniband/hw/hns/hns_roce_hem.c struct hns_roce_hem_mhop mhop = {}; mhop 949 drivers/infiniband/hw/hns/hns_roce_hem.c if (get_hem_table_config(hr_dev, &mhop, type)) mhop 952 drivers/infiniband/hw/hns/hns_roce_hem.c buf_chunk_size = mhop.buf_chunk_size; mhop 953 drivers/infiniband/hw/hns/hns_roce_hem.c bt_chunk_size = mhop.bt_chunk_size; mhop 954 drivers/infiniband/hw/hns/hns_roce_hem.c num_bt_l0 = mhop.ba_l0_num; mhop 955 drivers/infiniband/hw/hns/hns_roce_hem.c hop_num = mhop.hop_num; mhop 1034 drivers/infiniband/hw/hns/hns_roce_hem.c struct hns_roce_hem_mhop mhop; mhop 1039 drivers/infiniband/hw/hns/hns_roce_hem.c if (hns_roce_calc_hem_mhop(hr_dev, table, NULL, &mhop)) mhop 1041 drivers/infiniband/hw/hns/hns_roce_hem.c buf_chunk_size = table->type < HEM_TYPE_MTT ? mhop.buf_chunk_size : mhop 1042 drivers/infiniband/hw/hns/hns_roce_hem.c mhop.bt_chunk_size; mhop 133 drivers/infiniband/hw/hns/hns_roce_hem.h struct hns_roce_hem_mhop *mhop); mhop 3042 drivers/infiniband/hw/hns/hns_roce_hw_v2.c struct hns_roce_hem_mhop mhop; mhop 3057 drivers/infiniband/hw/hns/hns_roce_hw_v2.c hns_roce_calc_hem_mhop(hr_dev, table, &mhop_obj, &mhop); mhop 3058 drivers/infiniband/hw/hns/hns_roce_hw_v2.c i = mhop.l0_idx; mhop 3059 drivers/infiniband/hw/hns/hns_roce_hw_v2.c j = mhop.l1_idx; mhop 3060 drivers/infiniband/hw/hns/hns_roce_hw_v2.c k = mhop.l2_idx; mhop 3061 drivers/infiniband/hw/hns/hns_roce_hw_v2.c hop_num = mhop.hop_num; mhop 3062 drivers/infiniband/hw/hns/hns_roce_hw_v2.c chunk_ba_num = mhop.bt_chunk_size / 8; mhop 3083 drivers/infiniband/hw/hns/hns_roce_hw_v2.c obj = mhop.l0_idx;