Lines Matching refs:devlink
134 struct devlink *devlink, int attrtype) in devlink_nl_put_nested_handle() argument
142 if (devlink_nl_put_handle(msg, devlink)) in devlink_nl_put_nested_handle()
146 devl_net = read_pnet_rcu(&devlink->_net); in devlink_nl_put_nested_handle()
180 struct devlink *
184 struct devlink *devlink; in devlink_get_from_attrs_lock() local
195 devlinks_xa_for_each_registered_get(net, index, devlink) { in devlink_get_from_attrs_lock()
196 if (strcmp(devlink->dev->bus->name, busname) == 0 && in devlink_get_from_attrs_lock()
197 strcmp(dev_name(devlink->dev), devname) == 0) { in devlink_get_from_attrs_lock()
198 devl_dev_lock(devlink, dev_lock); in devlink_get_from_attrs_lock()
199 if (devl_is_registered(devlink)) in devlink_get_from_attrs_lock()
200 return devlink; in devlink_get_from_attrs_lock()
201 devl_dev_unlock(devlink, dev_lock); in devlink_get_from_attrs_lock()
203 devlink_put(devlink); in devlink_get_from_attrs_lock()
214 struct devlink *devlink; in __devlink_nl_pre_doit() local
217 devlink = devlink_get_from_attrs_lock(genl_info_net(info), info->attrs, in __devlink_nl_pre_doit()
219 if (IS_ERR(devlink)) in __devlink_nl_pre_doit()
220 return PTR_ERR(devlink); in __devlink_nl_pre_doit()
222 info->user_ptr[0] = devlink; in __devlink_nl_pre_doit()
224 devlink_port = devlink_port_get_from_info(devlink, info); in __devlink_nl_pre_doit()
231 devlink_port = devlink_port_get_from_info(devlink, info); in __devlink_nl_pre_doit()
238 devl_dev_unlock(devlink, dev_lock); in __devlink_nl_pre_doit()
239 devlink_put(devlink); in __devlink_nl_pre_doit()
272 struct devlink *devlink; in __devlink_nl_post_doit() local
274 devlink = info->user_ptr[0]; in __devlink_nl_post_doit()
275 devl_dev_unlock(devlink, dev_lock); in __devlink_nl_post_doit()
276 devlink_put(devlink); in __devlink_nl_post_doit()
297 struct devlink *devlink; in devlink_nl_inst_single_dumpit() local
300 devlink = devlink_get_from_attrs_lock(sock_net(msg->sk), attrs, false); in devlink_nl_inst_single_dumpit()
301 if (IS_ERR(devlink)) in devlink_nl_inst_single_dumpit()
302 return PTR_ERR(devlink); in devlink_nl_inst_single_dumpit()
303 err = dump_one(msg, devlink, cb, flags | NLM_F_DUMP_FILTERED); in devlink_nl_inst_single_dumpit()
305 devl_unlock(devlink); in devlink_nl_inst_single_dumpit()
306 devlink_put(devlink); in devlink_nl_inst_single_dumpit()
318 struct devlink *devlink; in devlink_nl_inst_iter_dumpit() local
321 while ((devlink = devlinks_xa_find_get(sock_net(msg->sk), in devlink_nl_inst_iter_dumpit()
323 devl_lock(devlink); in devlink_nl_inst_iter_dumpit()
325 if (devl_is_registered(devlink)) in devlink_nl_inst_iter_dumpit()
326 err = dump_one(msg, devlink, cb, flags); in devlink_nl_inst_iter_dumpit()
330 devl_unlock(devlink); in devlink_nl_inst_iter_dumpit()
331 devlink_put(devlink); in devlink_nl_inst_iter_dumpit()