Lines Matching refs:devlink

39 devlink_resource_find(struct devlink *devlink,  in devlink_resource_find()  argument
47 resource_list = &devlink->resource_list; in devlink_resource_find()
55 child_resource = devlink_resource_find(devlink, resource, in devlink_resource_find()
110 struct devlink *devlink = info->user_ptr[0]; in devlink_nl_resource_set_doit() local
121 resource = devlink_resource_find(devlink, NULL, resource_id); in devlink_nl_resource_set_doit()
165 static int devlink_resource_put(struct devlink *devlink, struct sk_buff *skb, in devlink_resource_put() argument
203 if (devlink_resource_put(devlink, skb, child_resource)) in devlink_resource_put()
222 struct devlink *devlink = info->user_ptr[0]; in devlink_resource_fill() local
232 resource = list_first_entry(&devlink->resource_list, in devlink_resource_fill()
246 if (devlink_nl_put_handle(skb, devlink)) in devlink_resource_fill()
256 list_for_each_entry_from(resource, &devlink->resource_list, list) { in devlink_resource_fill()
257 err = devlink_resource_put(devlink, skb, resource); in devlink_resource_fill()
290 struct devlink *devlink = info->user_ptr[0]; in devlink_nl_resource_dump_doit() local
292 if (list_empty(&devlink->resource_list)) in devlink_nl_resource_dump_doit()
298 int devlink_resources_validate(struct devlink *devlink, in devlink_resources_validate() argument
308 resource_list = &devlink->resource_list; in devlink_resources_validate()
313 err = devlink_resources_validate(devlink, resource, info); in devlink_resources_validate()
334 int devl_resource_register(struct devlink *devlink, in devl_resource_register() argument
345 lockdep_assert_held(&devlink->lock); in devl_resource_register()
349 resource = devlink_resource_find(devlink, NULL, resource_id); in devl_resource_register()
358 resource_list = &devlink->resource_list; in devl_resource_register()
362 parent_resource = devlink_resource_find(devlink, NULL, in devl_resource_register()
403 int devlink_resource_register(struct devlink *devlink, in devlink_resource_register() argument
412 devl_lock(devlink); in devlink_resource_register()
413 err = devl_resource_register(devlink, resource_name, resource_size, in devlink_resource_register()
415 devl_unlock(devlink); in devlink_resource_register()
420 static void devlink_resource_unregister(struct devlink *devlink, in devlink_resource_unregister() argument
427 devlink_resource_unregister(devlink, child_resource); in devlink_resource_unregister()
438 void devl_resources_unregister(struct devlink *devlink) in devl_resources_unregister() argument
442 lockdep_assert_held(&devlink->lock); in devl_resources_unregister()
444 list_for_each_entry_safe(child_resource, tmp, &devlink->resource_list, in devl_resources_unregister()
446 devlink_resource_unregister(devlink, child_resource); in devl_resources_unregister()
460 void devlink_resources_unregister(struct devlink *devlink) in devlink_resources_unregister() argument
462 devl_lock(devlink); in devlink_resources_unregister()
463 devl_resources_unregister(devlink); in devlink_resources_unregister()
464 devl_unlock(devlink); in devlink_resources_unregister()
475 int devl_resource_size_get(struct devlink *devlink, in devl_resource_size_get() argument
481 lockdep_assert_held(&devlink->lock); in devl_resource_size_get()
483 resource = devlink_resource_find(devlink, NULL, resource_id); in devl_resource_size_get()
500 void devl_resource_occ_get_register(struct devlink *devlink, in devl_resource_occ_get_register() argument
507 lockdep_assert_held(&devlink->lock); in devl_resource_occ_get_register()
509 resource = devlink_resource_find(devlink, NULL, resource_id); in devl_resource_occ_get_register()
529 void devlink_resource_occ_get_register(struct devlink *devlink, in devlink_resource_occ_get_register() argument
534 devl_lock(devlink); in devlink_resource_occ_get_register()
535 devl_resource_occ_get_register(devlink, resource_id, in devlink_resource_occ_get_register()
537 devl_unlock(devlink); in devlink_resource_occ_get_register()
547 void devl_resource_occ_get_unregister(struct devlink *devlink, in devl_resource_occ_get_unregister() argument
552 lockdep_assert_held(&devlink->lock); in devl_resource_occ_get_unregister()
554 resource = devlink_resource_find(devlink, NULL, resource_id); in devl_resource_occ_get_unregister()
572 void devlink_resource_occ_get_unregister(struct devlink *devlink, in devlink_resource_occ_get_unregister() argument
575 devl_lock(devlink); in devlink_resource_occ_get_unregister()
576 devl_resource_occ_get_unregister(devlink, resource_id); in devlink_resource_occ_get_unregister()
577 devl_unlock(devlink); in devlink_resource_occ_get_unregister()