Lines Matching refs:ctx_pg

6433 		struct bnxt_ctx_pg_info *ctx_pg;  in bnxt_hwrm_func_backing_store_qcaps()  local
6442 ctx_pg = kzalloc(sizeof(*ctx_pg) * (bp->max_q + 1), GFP_KERNEL); in bnxt_hwrm_func_backing_store_qcaps()
6443 if (!ctx_pg) { in bnxt_hwrm_func_backing_store_qcaps()
6448 for (i = 0; i < bp->max_q + 1; i++, ctx_pg++) in bnxt_hwrm_func_backing_store_qcaps()
6449 ctx->tqm_mem[i] = ctx_pg; in bnxt_hwrm_func_backing_store_qcaps()
6524 struct bnxt_ctx_pg_info *ctx_pg; in bnxt_hwrm_func_backing_store_cfg() local
6539 ctx_pg = &ctx->qp_mem; in bnxt_hwrm_func_backing_store_cfg()
6540 req.qp_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6544 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6549 ctx_pg = &ctx->srq_mem; in bnxt_hwrm_func_backing_store_cfg()
6550 req.srq_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6553 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6558 ctx_pg = &ctx->cq_mem; in bnxt_hwrm_func_backing_store_cfg()
6559 req.cq_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6562 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, &req.cq_pg_size_cq_lvl, in bnxt_hwrm_func_backing_store_cfg()
6566 ctx_pg = &ctx->vnic_mem; in bnxt_hwrm_func_backing_store_cfg()
6572 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6577 ctx_pg = &ctx->stat_mem; in bnxt_hwrm_func_backing_store_cfg()
6580 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6585 ctx_pg = &ctx->mrav_mem; in bnxt_hwrm_func_backing_store_cfg()
6586 req.mrav_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6591 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6596 ctx_pg = &ctx->tim_mem; in bnxt_hwrm_func_backing_store_cfg()
6597 req.tim_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6599 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6612 ctx_pg = ctx->tqm_mem[i]; in bnxt_hwrm_func_backing_store_cfg()
6613 *num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6614 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, pg_attr, pg_dir); in bnxt_hwrm_func_backing_store_cfg()
6622 struct bnxt_ctx_pg_info *ctx_pg) in bnxt_alloc_ctx_mem_blk() argument
6624 struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; in bnxt_alloc_ctx_mem_blk()
6627 rmem->pg_arr = ctx_pg->ctx_pg_arr; in bnxt_alloc_ctx_mem_blk()
6628 rmem->dma_arr = ctx_pg->ctx_dma_arr; in bnxt_alloc_ctx_mem_blk()
6636 struct bnxt_ctx_pg_info *ctx_pg, u32 mem_size, in bnxt_alloc_ctx_pg_tbls() argument
6639 struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; in bnxt_alloc_ctx_pg_tbls()
6645 ctx_pg->nr_pages = DIV_ROUND_UP(mem_size, BNXT_PAGE_SIZE); in bnxt_alloc_ctx_pg_tbls()
6646 if (ctx_pg->nr_pages > MAX_CTX_TOTAL_PAGES) { in bnxt_alloc_ctx_pg_tbls()
6647 ctx_pg->nr_pages = 0; in bnxt_alloc_ctx_pg_tbls()
6650 if (ctx_pg->nr_pages > MAX_CTX_PAGES || depth > 1) { in bnxt_alloc_ctx_pg_tbls()
6654 ctx_pg->ctx_pg_tbl = kcalloc(MAX_CTX_PAGES, sizeof(ctx_pg), in bnxt_alloc_ctx_pg_tbls()
6656 if (!ctx_pg->ctx_pg_tbl) in bnxt_alloc_ctx_pg_tbls()
6658 nr_tbls = DIV_ROUND_UP(ctx_pg->nr_pages, MAX_CTX_PAGES); in bnxt_alloc_ctx_pg_tbls()
6660 rc = bnxt_alloc_ctx_mem_blk(bp, ctx_pg); in bnxt_alloc_ctx_pg_tbls()
6669 ctx_pg->ctx_pg_tbl[i] = pg_tbl; in bnxt_alloc_ctx_pg_tbls()
6671 rmem->pg_tbl = ctx_pg->ctx_pg_arr[i]; in bnxt_alloc_ctx_pg_tbls()
6672 rmem->pg_tbl_map = ctx_pg->ctx_dma_arr[i]; in bnxt_alloc_ctx_pg_tbls()
6676 int rem = ctx_pg->nr_pages % MAX_CTX_PAGES; in bnxt_alloc_ctx_pg_tbls()
6689 rc = bnxt_alloc_ctx_mem_blk(bp, ctx_pg); in bnxt_alloc_ctx_pg_tbls()
6695 struct bnxt_ctx_pg_info *ctx_pg) in bnxt_free_ctx_pg_tbls() argument
6697 struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; in bnxt_free_ctx_pg_tbls()
6699 if (rmem->depth > 1 || ctx_pg->nr_pages > MAX_CTX_PAGES || in bnxt_free_ctx_pg_tbls()
6700 ctx_pg->ctx_pg_tbl) { in bnxt_free_ctx_pg_tbls()
6707 pg_tbl = ctx_pg->ctx_pg_tbl[i]; in bnxt_free_ctx_pg_tbls()
6712 ctx_pg->ctx_pg_arr[i] = NULL; in bnxt_free_ctx_pg_tbls()
6714 ctx_pg->ctx_pg_tbl[i] = NULL; in bnxt_free_ctx_pg_tbls()
6716 kfree(ctx_pg->ctx_pg_tbl); in bnxt_free_ctx_pg_tbls()
6717 ctx_pg->ctx_pg_tbl = NULL; in bnxt_free_ctx_pg_tbls()
6720 ctx_pg->nr_pages = 0; in bnxt_free_ctx_pg_tbls()
6750 struct bnxt_ctx_pg_info *ctx_pg; in bnxt_alloc_ctx_mem() local
6775 ctx_pg = &ctx->qp_mem; in bnxt_alloc_ctx_mem()
6776 ctx_pg->entries = ctx->qp_min_qp1_entries + ctx->qp_max_l2_entries + in bnxt_alloc_ctx_mem()
6778 mem_size = ctx->qp_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
6779 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, pg_lvl); in bnxt_alloc_ctx_mem()
6783 ctx_pg = &ctx->srq_mem; in bnxt_alloc_ctx_mem()
6784 ctx_pg->entries = ctx->srq_max_l2_entries + extra_srqs; in bnxt_alloc_ctx_mem()
6785 mem_size = ctx->srq_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
6786 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, pg_lvl); in bnxt_alloc_ctx_mem()
6790 ctx_pg = &ctx->cq_mem; in bnxt_alloc_ctx_mem()
6791 ctx_pg->entries = ctx->cq_max_l2_entries + extra_qps * 2; in bnxt_alloc_ctx_mem()
6792 mem_size = ctx->cq_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
6793 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, pg_lvl); in bnxt_alloc_ctx_mem()
6797 ctx_pg = &ctx->vnic_mem; in bnxt_alloc_ctx_mem()
6798 ctx_pg->entries = ctx->vnic_max_vnic_entries + in bnxt_alloc_ctx_mem()
6800 mem_size = ctx->vnic_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
6801 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1); in bnxt_alloc_ctx_mem()
6805 ctx_pg = &ctx->stat_mem; in bnxt_alloc_ctx_mem()
6806 ctx_pg->entries = ctx->stat_max_entries; in bnxt_alloc_ctx_mem()
6807 mem_size = ctx->stat_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
6808 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1); in bnxt_alloc_ctx_mem()
6816 ctx_pg = &ctx->mrav_mem; in bnxt_alloc_ctx_mem()
6822 ctx_pg->entries = num_mr + num_ah; in bnxt_alloc_ctx_mem()
6823 mem_size = ctx->mrav_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
6824 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 2); in bnxt_alloc_ctx_mem()
6829 ctx_pg->entries = in bnxt_alloc_ctx_mem()
6833 ctx_pg = &ctx->tim_mem; in bnxt_alloc_ctx_mem()
6834 ctx_pg->entries = ctx->qp_mem.entries; in bnxt_alloc_ctx_mem()
6835 mem_size = ctx->tim_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
6836 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1); in bnxt_alloc_ctx_mem()
6847 ctx_pg = ctx->tqm_mem[i]; in bnxt_alloc_ctx_mem()
6848 ctx_pg->entries = entries; in bnxt_alloc_ctx_mem()
6850 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1); in bnxt_alloc_ctx_mem()