Lines Matching refs:ctx_pg

7061 		struct bnxt_ctx_pg_info *ctx_pg;  in bnxt_hwrm_func_backing_store_qcaps()  local
7111 ctx_pg = kcalloc(tqm_rings, sizeof(*ctx_pg), GFP_KERNEL); in bnxt_hwrm_func_backing_store_qcaps()
7112 if (!ctx_pg) { in bnxt_hwrm_func_backing_store_qcaps()
7117 for (i = 0; i < tqm_rings; i++, ctx_pg++) in bnxt_hwrm_func_backing_store_qcaps()
7118 ctx->tqm_mem[i] = ctx_pg; in bnxt_hwrm_func_backing_store_qcaps()
7157 struct bnxt_ctx_pg_info *ctx_pg; in bnxt_hwrm_func_backing_store_cfg() local
7179 ctx_pg = &ctx->qp_mem; in bnxt_hwrm_func_backing_store_cfg()
7180 req->qp_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
7184 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
7189 ctx_pg = &ctx->srq_mem; in bnxt_hwrm_func_backing_store_cfg()
7190 req->srq_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
7193 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
7198 ctx_pg = &ctx->cq_mem; in bnxt_hwrm_func_backing_store_cfg()
7199 req->cq_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
7202 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
7207 ctx_pg = &ctx->vnic_mem; in bnxt_hwrm_func_backing_store_cfg()
7213 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
7218 ctx_pg = &ctx->stat_mem; in bnxt_hwrm_func_backing_store_cfg()
7221 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
7226 ctx_pg = &ctx->mrav_mem; in bnxt_hwrm_func_backing_store_cfg()
7227 req->mrav_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
7232 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
7237 ctx_pg = &ctx->tim_mem; in bnxt_hwrm_func_backing_store_cfg()
7238 req->tim_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
7240 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
7254 ctx_pg = ctx->tqm_mem[i]; in bnxt_hwrm_func_backing_store_cfg()
7255 *num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
7256 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, pg_attr, pg_dir); in bnxt_hwrm_func_backing_store_cfg()
7263 struct bnxt_ctx_pg_info *ctx_pg) in bnxt_alloc_ctx_mem_blk() argument
7265 struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; in bnxt_alloc_ctx_mem_blk()
7268 rmem->pg_arr = ctx_pg->ctx_pg_arr; in bnxt_alloc_ctx_mem_blk()
7269 rmem->dma_arr = ctx_pg->ctx_dma_arr; in bnxt_alloc_ctx_mem_blk()
7277 struct bnxt_ctx_pg_info *ctx_pg, u32 mem_size, in bnxt_alloc_ctx_pg_tbls() argument
7280 struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; in bnxt_alloc_ctx_pg_tbls()
7286 ctx_pg->nr_pages = DIV_ROUND_UP(mem_size, BNXT_PAGE_SIZE); in bnxt_alloc_ctx_pg_tbls()
7287 if (ctx_pg->nr_pages > MAX_CTX_TOTAL_PAGES) { in bnxt_alloc_ctx_pg_tbls()
7288 ctx_pg->nr_pages = 0; in bnxt_alloc_ctx_pg_tbls()
7291 if (ctx_pg->nr_pages > MAX_CTX_PAGES || depth > 1) { in bnxt_alloc_ctx_pg_tbls()
7295 ctx_pg->ctx_pg_tbl = kcalloc(MAX_CTX_PAGES, sizeof(ctx_pg), in bnxt_alloc_ctx_pg_tbls()
7297 if (!ctx_pg->ctx_pg_tbl) in bnxt_alloc_ctx_pg_tbls()
7299 nr_tbls = DIV_ROUND_UP(ctx_pg->nr_pages, MAX_CTX_PAGES); in bnxt_alloc_ctx_pg_tbls()
7301 rc = bnxt_alloc_ctx_mem_blk(bp, ctx_pg); in bnxt_alloc_ctx_pg_tbls()
7310 ctx_pg->ctx_pg_tbl[i] = pg_tbl; in bnxt_alloc_ctx_pg_tbls()
7312 rmem->pg_tbl = ctx_pg->ctx_pg_arr[i]; in bnxt_alloc_ctx_pg_tbls()
7313 rmem->pg_tbl_map = ctx_pg->ctx_dma_arr[i]; in bnxt_alloc_ctx_pg_tbls()
7318 int rem = ctx_pg->nr_pages % MAX_CTX_PAGES; in bnxt_alloc_ctx_pg_tbls()
7332 rc = bnxt_alloc_ctx_mem_blk(bp, ctx_pg); in bnxt_alloc_ctx_pg_tbls()
7338 struct bnxt_ctx_pg_info *ctx_pg) in bnxt_free_ctx_pg_tbls() argument
7340 struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; in bnxt_free_ctx_pg_tbls()
7342 if (rmem->depth > 1 || ctx_pg->nr_pages > MAX_CTX_PAGES || in bnxt_free_ctx_pg_tbls()
7343 ctx_pg->ctx_pg_tbl) { in bnxt_free_ctx_pg_tbls()
7350 pg_tbl = ctx_pg->ctx_pg_tbl[i]; in bnxt_free_ctx_pg_tbls()
7355 ctx_pg->ctx_pg_arr[i] = NULL; in bnxt_free_ctx_pg_tbls()
7357 ctx_pg->ctx_pg_tbl[i] = NULL; in bnxt_free_ctx_pg_tbls()
7359 kfree(ctx_pg->ctx_pg_tbl); in bnxt_free_ctx_pg_tbls()
7360 ctx_pg->ctx_pg_tbl = NULL; in bnxt_free_ctx_pg_tbls()
7363 ctx_pg->nr_pages = 0; in bnxt_free_ctx_pg_tbls()
7393 struct bnxt_ctx_pg_info *ctx_pg; in bnxt_alloc_ctx_mem() local
7420 ctx_pg = &ctx->qp_mem; in bnxt_alloc_ctx_mem()
7421 ctx_pg->entries = ctx->qp_min_qp1_entries + ctx->qp_max_l2_entries + in bnxt_alloc_ctx_mem()
7424 mem_size = ctx->qp_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7426 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, pg_lvl, init); in bnxt_alloc_ctx_mem()
7431 ctx_pg = &ctx->srq_mem; in bnxt_alloc_ctx_mem()
7432 ctx_pg->entries = ctx->srq_max_l2_entries + extra_srqs; in bnxt_alloc_ctx_mem()
7434 mem_size = ctx->srq_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7436 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, pg_lvl, init); in bnxt_alloc_ctx_mem()
7441 ctx_pg = &ctx->cq_mem; in bnxt_alloc_ctx_mem()
7442 ctx_pg->entries = ctx->cq_max_l2_entries + extra_qps * 2; in bnxt_alloc_ctx_mem()
7444 mem_size = ctx->cq_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7446 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, pg_lvl, init); in bnxt_alloc_ctx_mem()
7451 ctx_pg = &ctx->vnic_mem; in bnxt_alloc_ctx_mem()
7452 ctx_pg->entries = ctx->vnic_max_vnic_entries + in bnxt_alloc_ctx_mem()
7455 mem_size = ctx->vnic_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7457 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1, init); in bnxt_alloc_ctx_mem()
7462 ctx_pg = &ctx->stat_mem; in bnxt_alloc_ctx_mem()
7463 ctx_pg->entries = ctx->stat_max_entries; in bnxt_alloc_ctx_mem()
7465 mem_size = ctx->stat_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7467 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1, init); in bnxt_alloc_ctx_mem()
7476 ctx_pg = &ctx->mrav_mem; in bnxt_alloc_ctx_mem()
7482 ctx_pg->entries = num_mr + num_ah; in bnxt_alloc_ctx_mem()
7484 mem_size = ctx->mrav_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7486 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 2, init); in bnxt_alloc_ctx_mem()
7492 ctx_pg->entries = in bnxt_alloc_ctx_mem()
7496 ctx_pg = &ctx->tim_mem; in bnxt_alloc_ctx_mem()
7497 ctx_pg->entries = ctx->qp_mem.entries; in bnxt_alloc_ctx_mem()
7499 mem_size = ctx->tim_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7500 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1, NULL); in bnxt_alloc_ctx_mem()
7515 ctx_pg = ctx->tqm_mem[i]; in bnxt_alloc_ctx_mem()
7516 ctx_pg->entries = i ? entries : entries_sp; in bnxt_alloc_ctx_mem()
7518 mem_size = ctx->tqm_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7519 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1, in bnxt_alloc_ctx_mem()