Lines Matching refs:devlink
100 struct devlink *
103 struct devlink *devlink; in devlink_get_from_attrs_lock() local
114 devlinks_xa_for_each_registered_get(net, index, devlink) { in devlink_get_from_attrs_lock()
115 devl_lock(devlink); in devlink_get_from_attrs_lock()
116 if (devl_is_registered(devlink) && in devlink_get_from_attrs_lock()
117 strcmp(devlink->dev->bus->name, busname) == 0 && in devlink_get_from_attrs_lock()
118 strcmp(dev_name(devlink->dev), devname) == 0) in devlink_get_from_attrs_lock()
119 return devlink; in devlink_get_from_attrs_lock()
120 devl_unlock(devlink); in devlink_get_from_attrs_lock()
121 devlink_put(devlink); in devlink_get_from_attrs_lock()
131 struct devlink *devlink; in __devlink_nl_pre_doit() local
134 devlink = devlink_get_from_attrs_lock(genl_info_net(info), info->attrs); in __devlink_nl_pre_doit()
135 if (IS_ERR(devlink)) in __devlink_nl_pre_doit()
136 return PTR_ERR(devlink); in __devlink_nl_pre_doit()
138 info->user_ptr[0] = devlink; in __devlink_nl_pre_doit()
140 devlink_port = devlink_port_get_from_info(devlink, info); in __devlink_nl_pre_doit()
147 devlink_port = devlink_port_get_from_info(devlink, info); in __devlink_nl_pre_doit()
154 devl_unlock(devlink); in __devlink_nl_pre_doit()
155 devlink_put(devlink); in __devlink_nl_pre_doit()
181 struct devlink *devlink; in devlink_nl_post_doit() local
183 devlink = info->user_ptr[0]; in devlink_nl_post_doit()
184 devl_unlock(devlink); in devlink_nl_post_doit()
185 devlink_put(devlink); in devlink_nl_post_doit()
193 struct devlink *devlink; in devlink_nl_inst_single_dumpit() local
196 devlink = devlink_get_from_attrs_lock(sock_net(msg->sk), attrs); in devlink_nl_inst_single_dumpit()
197 if (IS_ERR(devlink)) in devlink_nl_inst_single_dumpit()
198 return PTR_ERR(devlink); in devlink_nl_inst_single_dumpit()
199 err = dump_one(msg, devlink, cb, flags | NLM_F_DUMP_FILTERED); in devlink_nl_inst_single_dumpit()
201 devl_unlock(devlink); in devlink_nl_inst_single_dumpit()
202 devlink_put(devlink); in devlink_nl_inst_single_dumpit()
214 struct devlink *devlink; in devlink_nl_inst_iter_dumpit() local
217 while ((devlink = devlinks_xa_find_get(sock_net(msg->sk), in devlink_nl_inst_iter_dumpit()
219 devl_lock(devlink); in devlink_nl_inst_iter_dumpit()
221 if (devl_is_registered(devlink)) in devlink_nl_inst_iter_dumpit()
222 err = dump_one(msg, devlink, cb, flags); in devlink_nl_inst_iter_dumpit()
226 devl_unlock(devlink); in devlink_nl_inst_iter_dumpit()
227 devlink_put(devlink); in devlink_nl_inst_iter_dumpit()