Lines Matching refs:ctx_pg

6749 		struct bnxt_ctx_pg_info *ctx_pg;  in bnxt_hwrm_func_backing_store_qcaps()  local
6795 ctx_pg = kcalloc(tqm_rings, sizeof(*ctx_pg), GFP_KERNEL); in bnxt_hwrm_func_backing_store_qcaps()
6796 if (!ctx_pg) { in bnxt_hwrm_func_backing_store_qcaps()
6801 for (i = 0; i < tqm_rings; i++, ctx_pg++) in bnxt_hwrm_func_backing_store_qcaps()
6802 ctx->tqm_mem[i] = ctx_pg; in bnxt_hwrm_func_backing_store_qcaps()
6845 struct bnxt_ctx_pg_info *ctx_pg; in bnxt_hwrm_func_backing_store_cfg() local
6860 ctx_pg = &ctx->qp_mem; in bnxt_hwrm_func_backing_store_cfg()
6861 req.qp_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6865 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6870 ctx_pg = &ctx->srq_mem; in bnxt_hwrm_func_backing_store_cfg()
6871 req.srq_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6874 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6879 ctx_pg = &ctx->cq_mem; in bnxt_hwrm_func_backing_store_cfg()
6880 req.cq_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6883 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, &req.cq_pg_size_cq_lvl, in bnxt_hwrm_func_backing_store_cfg()
6887 ctx_pg = &ctx->vnic_mem; in bnxt_hwrm_func_backing_store_cfg()
6893 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6898 ctx_pg = &ctx->stat_mem; in bnxt_hwrm_func_backing_store_cfg()
6901 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6906 ctx_pg = &ctx->mrav_mem; in bnxt_hwrm_func_backing_store_cfg()
6907 req.mrav_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6912 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6917 ctx_pg = &ctx->tim_mem; in bnxt_hwrm_func_backing_store_cfg()
6918 req.tim_num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6920 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, in bnxt_hwrm_func_backing_store_cfg()
6933 ctx_pg = ctx->tqm_mem[i]; in bnxt_hwrm_func_backing_store_cfg()
6934 *num_entries = cpu_to_le32(ctx_pg->entries); in bnxt_hwrm_func_backing_store_cfg()
6935 bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem, pg_attr, pg_dir); in bnxt_hwrm_func_backing_store_cfg()
6942 struct bnxt_ctx_pg_info *ctx_pg) in bnxt_alloc_ctx_mem_blk() argument
6944 struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; in bnxt_alloc_ctx_mem_blk()
6947 rmem->pg_arr = ctx_pg->ctx_pg_arr; in bnxt_alloc_ctx_mem_blk()
6948 rmem->dma_arr = ctx_pg->ctx_dma_arr; in bnxt_alloc_ctx_mem_blk()
6956 struct bnxt_ctx_pg_info *ctx_pg, u32 mem_size, in bnxt_alloc_ctx_pg_tbls() argument
6959 struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; in bnxt_alloc_ctx_pg_tbls()
6965 ctx_pg->nr_pages = DIV_ROUND_UP(mem_size, BNXT_PAGE_SIZE); in bnxt_alloc_ctx_pg_tbls()
6966 if (ctx_pg->nr_pages > MAX_CTX_TOTAL_PAGES) { in bnxt_alloc_ctx_pg_tbls()
6967 ctx_pg->nr_pages = 0; in bnxt_alloc_ctx_pg_tbls()
6970 if (ctx_pg->nr_pages > MAX_CTX_PAGES || depth > 1) { in bnxt_alloc_ctx_pg_tbls()
6974 ctx_pg->ctx_pg_tbl = kcalloc(MAX_CTX_PAGES, sizeof(ctx_pg), in bnxt_alloc_ctx_pg_tbls()
6976 if (!ctx_pg->ctx_pg_tbl) in bnxt_alloc_ctx_pg_tbls()
6978 nr_tbls = DIV_ROUND_UP(ctx_pg->nr_pages, MAX_CTX_PAGES); in bnxt_alloc_ctx_pg_tbls()
6980 rc = bnxt_alloc_ctx_mem_blk(bp, ctx_pg); in bnxt_alloc_ctx_pg_tbls()
6989 ctx_pg->ctx_pg_tbl[i] = pg_tbl; in bnxt_alloc_ctx_pg_tbls()
6991 rmem->pg_tbl = ctx_pg->ctx_pg_arr[i]; in bnxt_alloc_ctx_pg_tbls()
6992 rmem->pg_tbl_map = ctx_pg->ctx_dma_arr[i]; in bnxt_alloc_ctx_pg_tbls()
6998 int rem = ctx_pg->nr_pages % MAX_CTX_PAGES; in bnxt_alloc_ctx_pg_tbls()
7013 rc = bnxt_alloc_ctx_mem_blk(bp, ctx_pg); in bnxt_alloc_ctx_pg_tbls()
7019 struct bnxt_ctx_pg_info *ctx_pg) in bnxt_free_ctx_pg_tbls() argument
7021 struct bnxt_ring_mem_info *rmem = &ctx_pg->ring_mem; in bnxt_free_ctx_pg_tbls()
7023 if (rmem->depth > 1 || ctx_pg->nr_pages > MAX_CTX_PAGES || in bnxt_free_ctx_pg_tbls()
7024 ctx_pg->ctx_pg_tbl) { in bnxt_free_ctx_pg_tbls()
7031 pg_tbl = ctx_pg->ctx_pg_tbl[i]; in bnxt_free_ctx_pg_tbls()
7036 ctx_pg->ctx_pg_arr[i] = NULL; in bnxt_free_ctx_pg_tbls()
7038 ctx_pg->ctx_pg_tbl[i] = NULL; in bnxt_free_ctx_pg_tbls()
7040 kfree(ctx_pg->ctx_pg_tbl); in bnxt_free_ctx_pg_tbls()
7041 ctx_pg->ctx_pg_tbl = NULL; in bnxt_free_ctx_pg_tbls()
7044 ctx_pg->nr_pages = 0; in bnxt_free_ctx_pg_tbls()
7074 struct bnxt_ctx_pg_info *ctx_pg; in bnxt_alloc_ctx_mem() local
7100 ctx_pg = &ctx->qp_mem; in bnxt_alloc_ctx_mem()
7101 ctx_pg->entries = ctx->qp_min_qp1_entries + ctx->qp_max_l2_entries + in bnxt_alloc_ctx_mem()
7103 mem_size = ctx->qp_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7104 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, pg_lvl, true); in bnxt_alloc_ctx_mem()
7108 ctx_pg = &ctx->srq_mem; in bnxt_alloc_ctx_mem()
7109 ctx_pg->entries = ctx->srq_max_l2_entries + extra_srqs; in bnxt_alloc_ctx_mem()
7110 mem_size = ctx->srq_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7111 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, pg_lvl, true); in bnxt_alloc_ctx_mem()
7115 ctx_pg = &ctx->cq_mem; in bnxt_alloc_ctx_mem()
7116 ctx_pg->entries = ctx->cq_max_l2_entries + extra_qps * 2; in bnxt_alloc_ctx_mem()
7117 mem_size = ctx->cq_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7118 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, pg_lvl, true); in bnxt_alloc_ctx_mem()
7122 ctx_pg = &ctx->vnic_mem; in bnxt_alloc_ctx_mem()
7123 ctx_pg->entries = ctx->vnic_max_vnic_entries + in bnxt_alloc_ctx_mem()
7125 mem_size = ctx->vnic_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7126 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1, true); in bnxt_alloc_ctx_mem()
7130 ctx_pg = &ctx->stat_mem; in bnxt_alloc_ctx_mem()
7131 ctx_pg->entries = ctx->stat_max_entries; in bnxt_alloc_ctx_mem()
7132 mem_size = ctx->stat_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7133 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1, true); in bnxt_alloc_ctx_mem()
7141 ctx_pg = &ctx->mrav_mem; in bnxt_alloc_ctx_mem()
7147 ctx_pg->entries = num_mr + num_ah; in bnxt_alloc_ctx_mem()
7148 mem_size = ctx->mrav_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7149 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 2, true); in bnxt_alloc_ctx_mem()
7154 ctx_pg->entries = in bnxt_alloc_ctx_mem()
7158 ctx_pg = &ctx->tim_mem; in bnxt_alloc_ctx_mem()
7159 ctx_pg->entries = ctx->qp_mem.entries; in bnxt_alloc_ctx_mem()
7160 mem_size = ctx->tim_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7161 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1, false); in bnxt_alloc_ctx_mem()
7175 ctx_pg = ctx->tqm_mem[i]; in bnxt_alloc_ctx_mem()
7176 ctx_pg->entries = i ? entries : entries_sp; in bnxt_alloc_ctx_mem()
7177 mem_size = ctx->tqm_entry_size * ctx_pg->entries; in bnxt_alloc_ctx_mem()
7178 rc = bnxt_alloc_ctx_pg_tbls(bp, ctx_pg, mem_size, 1, false); in bnxt_alloc_ctx_mem()