Loading drivers/platform/msm/ipa/ipa_v3/ipa.c +9 −0 Original line number Diff line number Diff line Loading @@ -6845,6 +6845,13 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, result = -ENOMEM; goto fail_hdr_offset_cache; } ipa3_ctx->fnr_stats_cache = kmem_cache_create("IPA_FNR_STATS", sizeof(struct ipa_ioc_flt_rt_counter_alloc), 0, 0, NULL); if (!ipa3_ctx->fnr_stats_cache) { IPAERR(":ipa fnr stats cache create failed\n"); result = -ENOMEM; goto fail_fnr_stats_cache; } ipa3_ctx->hdr_proc_ctx_cache = kmem_cache_create("IPA_HDR_PROC_CTX", sizeof(struct ipa3_hdr_proc_ctx_entry), 0, 0, NULL); if (!ipa3_ctx->hdr_proc_ctx_cache) { Loading Loading @@ -7079,6 +7086,8 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, fail_hdr_proc_ctx_offset_cache: kmem_cache_destroy(ipa3_ctx->hdr_proc_ctx_cache); fail_hdr_proc_ctx_cache: kmem_cache_destroy(ipa3_ctx->fnr_stats_cache); fail_fnr_stats_cache: kmem_cache_destroy(ipa3_ctx->hdr_offset_cache); fail_hdr_offset_cache: kmem_cache_destroy(ipa3_ctx->hdr_cache); Loading drivers/platform/msm/ipa/ipa_v3/ipa_i.h +2 −0 Original line number Diff line number Diff line Loading @@ -1781,6 +1781,7 @@ struct ipa3_app_clock_vote { * @rt_rule_cache: routing rule cache * @hdr_cache: header cache * @hdr_offset_cache: header offset cache * @fnr_stats_cache: FnR stats cache * @hdr_proc_ctx_cache: processing context cache * @hdr_proc_ctx_offset_cache: processing context offset cache * @rt_tbl_cache: routing table cache Loading Loading @@ -1884,6 +1885,7 @@ struct ipa3_context { struct kmem_cache *rt_rule_cache; struct kmem_cache *hdr_cache; struct kmem_cache *hdr_offset_cache; struct kmem_cache *fnr_stats_cache; struct kmem_cache *hdr_proc_ctx_cache; struct kmem_cache *hdr_proc_ctx_offset_cache; struct kmem_cache *rt_tbl_cache; Loading drivers/platform/msm/ipa/ipa_v3/ipa_utils.c +22 −8 Original line number Diff line number Diff line Loading @@ -6070,12 +6070,21 @@ static int __ipa3_alloc_counter_hdl return id; } int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *counter) int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *header) { int i, unused_cnt, unused_max, unused_start_id; struct ipa_ioc_flt_rt_counter_alloc *counter; counter = kmem_cache_zalloc(ipa3_ctx->fnr_stats_cache, GFP_KERNEL); if (!counter) { IPAERR_RL("failed to alloc fnr stats counter object\n"); spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); return -ENOMEM; } idr_preload(GFP_KERNEL); spin_lock(&ipa3_ctx->flt_rt_counters.hdl_lock); memcpy(counter, header, sizeof(struct ipa_ioc_flt_rt_counter_alloc)); /* allocate hw counters */ counter->hw_counter.start_id = 0; Loading Loading @@ -6176,7 +6185,7 @@ int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *counter) unused_start_id = counter->hw_counter.start_id; if (unused_start_id < 1 || unused_start_id > IPA_FLT_RT_HW_COUNTER) { IPAERR("unexpected hw_counter start id %d\n", IPAERR_RL("unexpected hw_counter start id %d\n", unused_start_id); goto err; } Loading @@ -6191,7 +6200,7 @@ int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *counter) - IPA_FLT_RT_HW_COUNTER; if (unused_start_id < 1 || unused_start_id > IPA_FLT_RT_SW_COUNTER) { IPAERR("unexpected sw_counter start id %d\n", IPAERR_RL("unexpected sw_counter start id %d\n", unused_start_id); goto err; } Loading @@ -6203,10 +6212,12 @@ int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *counter) counter->hdl = __ipa3_alloc_counter_hdl(counter); spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); idr_preload_end(); memcpy(header, counter, sizeof(struct ipa_ioc_flt_rt_counter_alloc)); return 0; err: counter->hdl = -1; kmem_cache_free(ipa3_ctx->fnr_stats_cache, counter); spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); idr_preload_end(); return -ENOMEM; Loading @@ -6220,7 +6231,7 @@ void ipa3_counter_remove_hdl(int hdl) spin_lock(&ipa3_ctx->flt_rt_counters.hdl_lock); counter = idr_find(&ipa3_ctx->flt_rt_counters.hdl, hdl); if (counter == NULL) { IPAERR("unexpected hdl %d\n", hdl); IPAERR_RL("unexpected hdl %d\n", hdl); goto err; } /* remove counters belong to this hdl, set used back to 0 */ Loading @@ -6230,7 +6241,7 @@ void ipa3_counter_remove_hdl(int hdl) memset(&ipa3_ctx->flt_rt_counters.used_hw + offset, 0, counter->hw_counter.num_counters * sizeof(bool)); } else { IPAERR("unexpected hdl %d\n", hdl); IPAERR_RL("unexpected hdl %d\n", hdl); goto err; } offset = counter->sw_counter.start_id - 1 - IPA_FLT_RT_HW_COUNTER; Loading @@ -6239,11 +6250,12 @@ void ipa3_counter_remove_hdl(int hdl) memset(&ipa3_ctx->flt_rt_counters.used_sw + offset, 0, counter->sw_counter.num_counters * sizeof(bool)); } else { IPAERR("unexpected hdl %d\n", hdl); IPAERR_RL("unexpected hdl %d\n", hdl); goto err; } /* remove the handle */ idr_remove(&ipa3_ctx->flt_rt_counters.hdl, hdl); kmem_cache_free(ipa3_ctx->fnr_stats_cache, counter); err: spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); } Loading @@ -6260,8 +6272,10 @@ void ipa3_counter_id_remove_all(void) memset(&ipa3_ctx->flt_rt_counters.used_sw, 0, sizeof(ipa3_ctx->flt_rt_counters.used_sw)); /* remove all handles */ idr_for_each_entry(&ipa3_ctx->flt_rt_counters.hdl, counter, hdl) idr_for_each_entry(&ipa3_ctx->flt_rt_counters.hdl, counter, hdl) { idr_remove(&ipa3_ctx->flt_rt_counters.hdl, hdl); kmem_cache_free(ipa3_ctx->fnr_stats_cache, counter); } spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); } Loading Loading @@ -6802,7 +6816,7 @@ u32 ipa3_get_num_pipes(void) /** * ipa3_disable_apps_wan_cons_deaggr()- * set ipa_ctx->ipa_client_apps_wan_cons_agg_gro * set ipa3_ctx->ipa_client_apps_wan_cons_agg_gro * * Return value: 0 or negative in case of failure */ Loading Loading
drivers/platform/msm/ipa/ipa_v3/ipa.c +9 −0 Original line number Diff line number Diff line Loading @@ -6845,6 +6845,13 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, result = -ENOMEM; goto fail_hdr_offset_cache; } ipa3_ctx->fnr_stats_cache = kmem_cache_create("IPA_FNR_STATS", sizeof(struct ipa_ioc_flt_rt_counter_alloc), 0, 0, NULL); if (!ipa3_ctx->fnr_stats_cache) { IPAERR(":ipa fnr stats cache create failed\n"); result = -ENOMEM; goto fail_fnr_stats_cache; } ipa3_ctx->hdr_proc_ctx_cache = kmem_cache_create("IPA_HDR_PROC_CTX", sizeof(struct ipa3_hdr_proc_ctx_entry), 0, 0, NULL); if (!ipa3_ctx->hdr_proc_ctx_cache) { Loading Loading @@ -7079,6 +7086,8 @@ static int ipa3_pre_init(const struct ipa3_plat_drv_res *resource_p, fail_hdr_proc_ctx_offset_cache: kmem_cache_destroy(ipa3_ctx->hdr_proc_ctx_cache); fail_hdr_proc_ctx_cache: kmem_cache_destroy(ipa3_ctx->fnr_stats_cache); fail_fnr_stats_cache: kmem_cache_destroy(ipa3_ctx->hdr_offset_cache); fail_hdr_offset_cache: kmem_cache_destroy(ipa3_ctx->hdr_cache); Loading
drivers/platform/msm/ipa/ipa_v3/ipa_i.h +2 −0 Original line number Diff line number Diff line Loading @@ -1781,6 +1781,7 @@ struct ipa3_app_clock_vote { * @rt_rule_cache: routing rule cache * @hdr_cache: header cache * @hdr_offset_cache: header offset cache * @fnr_stats_cache: FnR stats cache * @hdr_proc_ctx_cache: processing context cache * @hdr_proc_ctx_offset_cache: processing context offset cache * @rt_tbl_cache: routing table cache Loading Loading @@ -1884,6 +1885,7 @@ struct ipa3_context { struct kmem_cache *rt_rule_cache; struct kmem_cache *hdr_cache; struct kmem_cache *hdr_offset_cache; struct kmem_cache *fnr_stats_cache; struct kmem_cache *hdr_proc_ctx_cache; struct kmem_cache *hdr_proc_ctx_offset_cache; struct kmem_cache *rt_tbl_cache; Loading
drivers/platform/msm/ipa/ipa_v3/ipa_utils.c +22 −8 Original line number Diff line number Diff line Loading @@ -6070,12 +6070,21 @@ static int __ipa3_alloc_counter_hdl return id; } int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *counter) int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *header) { int i, unused_cnt, unused_max, unused_start_id; struct ipa_ioc_flt_rt_counter_alloc *counter; counter = kmem_cache_zalloc(ipa3_ctx->fnr_stats_cache, GFP_KERNEL); if (!counter) { IPAERR_RL("failed to alloc fnr stats counter object\n"); spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); return -ENOMEM; } idr_preload(GFP_KERNEL); spin_lock(&ipa3_ctx->flt_rt_counters.hdl_lock); memcpy(counter, header, sizeof(struct ipa_ioc_flt_rt_counter_alloc)); /* allocate hw counters */ counter->hw_counter.start_id = 0; Loading Loading @@ -6176,7 +6185,7 @@ int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *counter) unused_start_id = counter->hw_counter.start_id; if (unused_start_id < 1 || unused_start_id > IPA_FLT_RT_HW_COUNTER) { IPAERR("unexpected hw_counter start id %d\n", IPAERR_RL("unexpected hw_counter start id %d\n", unused_start_id); goto err; } Loading @@ -6191,7 +6200,7 @@ int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *counter) - IPA_FLT_RT_HW_COUNTER; if (unused_start_id < 1 || unused_start_id > IPA_FLT_RT_SW_COUNTER) { IPAERR("unexpected sw_counter start id %d\n", IPAERR_RL("unexpected sw_counter start id %d\n", unused_start_id); goto err; } Loading @@ -6203,10 +6212,12 @@ int ipa3_alloc_counter_id(struct ipa_ioc_flt_rt_counter_alloc *counter) counter->hdl = __ipa3_alloc_counter_hdl(counter); spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); idr_preload_end(); memcpy(header, counter, sizeof(struct ipa_ioc_flt_rt_counter_alloc)); return 0; err: counter->hdl = -1; kmem_cache_free(ipa3_ctx->fnr_stats_cache, counter); spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); idr_preload_end(); return -ENOMEM; Loading @@ -6220,7 +6231,7 @@ void ipa3_counter_remove_hdl(int hdl) spin_lock(&ipa3_ctx->flt_rt_counters.hdl_lock); counter = idr_find(&ipa3_ctx->flt_rt_counters.hdl, hdl); if (counter == NULL) { IPAERR("unexpected hdl %d\n", hdl); IPAERR_RL("unexpected hdl %d\n", hdl); goto err; } /* remove counters belong to this hdl, set used back to 0 */ Loading @@ -6230,7 +6241,7 @@ void ipa3_counter_remove_hdl(int hdl) memset(&ipa3_ctx->flt_rt_counters.used_hw + offset, 0, counter->hw_counter.num_counters * sizeof(bool)); } else { IPAERR("unexpected hdl %d\n", hdl); IPAERR_RL("unexpected hdl %d\n", hdl); goto err; } offset = counter->sw_counter.start_id - 1 - IPA_FLT_RT_HW_COUNTER; Loading @@ -6239,11 +6250,12 @@ void ipa3_counter_remove_hdl(int hdl) memset(&ipa3_ctx->flt_rt_counters.used_sw + offset, 0, counter->sw_counter.num_counters * sizeof(bool)); } else { IPAERR("unexpected hdl %d\n", hdl); IPAERR_RL("unexpected hdl %d\n", hdl); goto err; } /* remove the handle */ idr_remove(&ipa3_ctx->flt_rt_counters.hdl, hdl); kmem_cache_free(ipa3_ctx->fnr_stats_cache, counter); err: spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); } Loading @@ -6260,8 +6272,10 @@ void ipa3_counter_id_remove_all(void) memset(&ipa3_ctx->flt_rt_counters.used_sw, 0, sizeof(ipa3_ctx->flt_rt_counters.used_sw)); /* remove all handles */ idr_for_each_entry(&ipa3_ctx->flt_rt_counters.hdl, counter, hdl) idr_for_each_entry(&ipa3_ctx->flt_rt_counters.hdl, counter, hdl) { idr_remove(&ipa3_ctx->flt_rt_counters.hdl, hdl); kmem_cache_free(ipa3_ctx->fnr_stats_cache, counter); } spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock); } Loading Loading @@ -6802,7 +6816,7 @@ u32 ipa3_get_num_pipes(void) /** * ipa3_disable_apps_wan_cons_deaggr()- * set ipa_ctx->ipa_client_apps_wan_cons_agg_gro * set ipa3_ctx->ipa_client_apps_wan_cons_agg_gro * * Return value: 0 or negative in case of failure */ Loading