Lines Matching refs:occ_item
2146 struct occ_item { struct
2171 static struct occ_item *occ_item_alloc(void) in occ_item_alloc() argument
2173 return calloc(1, sizeof(struct occ_item)); in occ_item_alloc()
2176 static void occ_item_free(struct occ_item *occ_item) in occ_item_free() argument
2178 free(occ_item); in occ_item_free()
2197 struct occ_item *occ_item, *tmp; in occ_port_free() local
2199 list_for_each_entry_safe(occ_item, tmp, &occ_port->pool_list, list) in occ_port_free()
2200 occ_item_free(occ_item); in occ_port_free()
2201 list_for_each_entry_safe(occ_item, tmp, &occ_port->ing_tc_list, list) in occ_port_free()
2202 occ_item_free(occ_item); in occ_port_free()
2203 list_for_each_entry_safe(occ_item, tmp, &occ_port->eg_tc_list, list) in occ_port_free()
2204 occ_item_free(occ_item); in occ_port_free()
2249 struct occ_item *occ_item; in pr_out_occ_show_item_list() local
2253 list_for_each_entry(occ_item, list, list) { in pr_out_occ_show_item_list()
2257 pr_out_sp(7, "%2u(%u):", occ_item->index, in pr_out_occ_show_item_list()
2258 occ_item->bound_pool_index); in pr_out_occ_show_item_list()
2260 pr_out_sp(7, "%2u:", occ_item->index); in pr_out_occ_show_item_list()
2261 pr_out_sp(15, "%7u/%u", occ_item->cur, occ_item->max); in pr_out_occ_show_item_list()
2273 struct occ_item *occ_item; in pr_out_json_occ_show_item_list() local
2278 list_for_each_entry(occ_item, list, list) { in pr_out_json_occ_show_item_list()
2279 sprintf(buf, "%u", occ_item->index); in pr_out_json_occ_show_item_list()
2284 occ_item->bound_pool_index); in pr_out_json_occ_show_item_list()
2285 jsonw_uint_field(dl->jw, "current", occ_item->cur); in pr_out_json_occ_show_item_list()
2286 jsonw_uint_field(dl->jw, "max", occ_item->max); in pr_out_json_occ_show_item_list()
2327 struct occ_item *occ_item; in cmd_sb_occ_port_pool_process() local
2338 occ_item = occ_item_alloc(); in cmd_sb_occ_port_pool_process()
2339 if (!occ_item) { in cmd_sb_occ_port_pool_process()
2343 occ_item->index = mnl_attr_get_u16(tb[DEVLINK_ATTR_SB_POOL_INDEX]); in cmd_sb_occ_port_pool_process()
2344 occ_item->cur = mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_OCC_CUR]); in cmd_sb_occ_port_pool_process()
2345 occ_item->max = mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_OCC_MAX]); in cmd_sb_occ_port_pool_process()
2346 list_add_tail(&occ_item->list, &occ_port->pool_list); in cmd_sb_occ_port_pool_process()
2369 struct occ_item *occ_item; in cmd_sb_occ_tc_pool_process() local
2381 occ_item = occ_item_alloc(); in cmd_sb_occ_tc_pool_process()
2382 if (!occ_item) { in cmd_sb_occ_tc_pool_process()
2386 occ_item->index = mnl_attr_get_u16(tb[DEVLINK_ATTR_SB_TC_INDEX]); in cmd_sb_occ_tc_pool_process()
2387 occ_item->cur = mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_OCC_CUR]); in cmd_sb_occ_tc_pool_process()
2388 occ_item->max = mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_OCC_MAX]); in cmd_sb_occ_tc_pool_process()
2389 occ_item->bound_pool_index = in cmd_sb_occ_tc_pool_process()
2393 list_add_tail(&occ_item->list, &occ_port->ing_tc_list); in cmd_sb_occ_tc_pool_process()
2395 list_add_tail(&occ_item->list, &occ_port->eg_tc_list); in cmd_sb_occ_tc_pool_process()
2397 occ_item_free(occ_item); in cmd_sb_occ_tc_pool_process()