Lines Matching refs:cgr

267 	struct qm_mcc_cgr cgr;  member
1369 struct qman_cgr *cgr; in qm_congestion_task() local
1388 list_for_each_entry(cgr, &p->cgr_cbs, node) in qm_congestion_task()
1389 if (cgr->cb && qman_cgrs_get(&c, cgr->cgrid)) in qm_congestion_task()
1390 cgr->cb(p, cgr, qman_cgrs_get(&rr, cgr->cgrid)); in qm_congestion_task()
2085 static int qman_query_cgr(struct qman_cgr *cgr, in qman_query_cgr() argument
2094 mcc->cgr.cgid = cgr->cgrid; in qman_query_cgr()
2113 int qman_query_cgr_congested(struct qman_cgr *cgr, bool *result) in qman_query_cgr_congested() argument
2118 err = qman_query_cgr(cgr, &query_cgr); in qman_query_cgr_congested()
2122 *result = !!query_cgr.cgr.cs; in qman_query_cgr_congested()
2259 static int qm_modify_cgr(struct qman_cgr *cgr, u32 flags, in qm_modify_cgr() argument
2271 mcc->initcgr.cgid = cgr->cgrid; in qm_modify_cgr()
2292 static void qm_cgr_cscn_targ_set(struct __qm_mc_cgr *cgr, int pi, u32 val) in qm_cgr_cscn_targ_set() argument
2295 cgr->cscn_targ_upd_ctrl = cpu_to_be16(pi | in qm_cgr_cscn_targ_set()
2298 cgr->cscn_targ = cpu_to_be32(val | QM_CGR_TARG_PORTAL(pi)); in qm_cgr_cscn_targ_set()
2301 static void qm_cgr_cscn_targ_clear(struct __qm_mc_cgr *cgr, int pi, u32 val) in qm_cgr_cscn_targ_clear() argument
2304 cgr->cscn_targ_upd_ctrl = cpu_to_be16(pi); in qm_cgr_cscn_targ_clear()
2306 cgr->cscn_targ = cpu_to_be32(val & ~QM_CGR_TARG_PORTAL(pi)); in qm_cgr_cscn_targ_clear()
2313 struct qman_cgr cgr; in qman_init_cgr_all() local
2316 for (cgr.cgrid = 0; cgr.cgrid < CGR_NUM; cgr.cgrid++) { in qman_init_cgr_all()
2317 if (qm_modify_cgr(&cgr, QMAN_CGR_FLAG_USE_INIT, NULL)) in qman_init_cgr_all()
2326 int qman_create_cgr(struct qman_cgr *cgr, u32 flags, in qman_create_cgr() argument
2339 if (cgr->cgrid >= CGR_NUM) in qman_create_cgr()
2344 qman_cgr_cpus[cgr->cgrid] = smp_processor_id(); in qman_create_cgr()
2347 cgr->chan = p->config->channel; in qman_create_cgr()
2353 ret = qman_query_cgr(cgr, &cgr_state); in qman_create_cgr()
2357 qm_cgr_cscn_targ_set(&local_opts.cgr, PORTAL_IDX(p), in qman_create_cgr()
2358 be32_to_cpu(cgr_state.cgr.cscn_targ)); in qman_create_cgr()
2363 ret = qm_modify_cgr(cgr, QMAN_CGR_FLAG_USE_INIT, in qman_create_cgr()
2366 ret = qm_modify_cgr(cgr, 0, &local_opts); in qman_create_cgr()
2371 list_add(&cgr->node, &p->cgr_cbs); in qman_create_cgr()
2374 ret = qman_query_cgr(cgr, &cgr_state); in qman_create_cgr()
2381 if (cgr->cb && cgr_state.cgr.cscn_en && in qman_create_cgr()
2382 qman_cgrs_get(&p->cgrs[1], cgr->cgrid)) in qman_create_cgr()
2383 cgr->cb(p, cgr, 1); in qman_create_cgr()
2391 int qman_delete_cgr(struct qman_cgr *cgr) in qman_delete_cgr() argument
2400 if (cgr->chan != p->config->channel) { in qman_delete_cgr()
2404 cgr->chan, p->config->channel); in qman_delete_cgr()
2411 list_del(&cgr->node); in qman_delete_cgr()
2417 if (i->cgrid == cgr->cgrid && i->cb) in qman_delete_cgr()
2419 ret = qman_query_cgr(cgr, &cgr_state); in qman_delete_cgr()
2422 list_add(&cgr->node, &p->cgr_cbs); in qman_delete_cgr()
2427 qm_cgr_cscn_targ_clear(&local_opts.cgr, PORTAL_IDX(p), in qman_delete_cgr()
2428 be32_to_cpu(cgr_state.cgr.cscn_targ)); in qman_delete_cgr()
2430 ret = qm_modify_cgr(cgr, 0, &local_opts); in qman_delete_cgr()
2433 list_add(&cgr->node, &p->cgr_cbs); in qman_delete_cgr()
2443 struct qman_cgr *cgr; member
2452 void qman_delete_cgr_safe(struct qman_cgr *cgr) in qman_delete_cgr_safe() argument
2455 if (qman_cgr_cpus[cgr->cgrid] != smp_processor_id()) { in qman_delete_cgr_safe()
2456 smp_call_function_single(qman_cgr_cpus[cgr->cgrid], in qman_delete_cgr_safe()
2457 qman_delete_cgr_smp_call, cgr, true); in qman_delete_cgr_safe()
2462 qman_delete_cgr(cgr); in qman_delete_cgr_safe()