Lines Matching refs:health

43 	struct nsim_dev_health *health = devlink_health_reporter_priv(reporter);  in nsim_dev_dummy_reporter_recover()  local
46 if (health->fail_recover) { in nsim_dev_dummy_reporter_recover()
54 kfree(health->recovered_break_msg); in nsim_dev_dummy_reporter_recover()
55 health->recovered_break_msg = kstrdup(ctx->break_msg, in nsim_dev_dummy_reporter_recover()
57 if (!health->recovered_break_msg) in nsim_dev_dummy_reporter_recover()
112 struct nsim_dev_health *health = devlink_health_reporter_priv(reporter); in nsim_dev_dummy_reporter_dump() local
118 return nsim_dev_dummy_fmsg_put(fmsg, health->binary_len); in nsim_dev_dummy_reporter_dump()
126 struct nsim_dev_health *health = devlink_health_reporter_priv(reporter); in nsim_dev_dummy_reporter_diagnose() local
128 if (health->recovered_break_msg) in nsim_dev_dummy_reporter_diagnose()
130 health->recovered_break_msg); in nsim_dev_dummy_reporter_diagnose()
132 return nsim_dev_dummy_fmsg_put(fmsg, health->binary_len); in nsim_dev_dummy_reporter_diagnose()
147 struct nsim_dev_health *health = file->private_data; in nsim_dev_health_break_write() local
162 err = devlink_health_report(health->dummy_reporter, break_msg, &ctx); in nsim_dev_health_break_write()
180 struct nsim_dev_health *health = &nsim_dev->health; in nsim_dev_health_init() local
183 health->empty_reporter = in nsim_dev_health_init()
186 0, health); in nsim_dev_health_init()
187 if (IS_ERR(health->empty_reporter)) in nsim_dev_health_init()
188 return PTR_ERR(health->empty_reporter); in nsim_dev_health_init()
190 health->dummy_reporter = in nsim_dev_health_init()
193 0, health); in nsim_dev_health_init()
194 if (IS_ERR(health->dummy_reporter)) { in nsim_dev_health_init()
195 err = PTR_ERR(health->dummy_reporter); in nsim_dev_health_init()
199 health->ddir = debugfs_create_dir("health", nsim_dev->ddir); in nsim_dev_health_init()
200 if (IS_ERR(health->ddir)) { in nsim_dev_health_init()
201 err = PTR_ERR(health->ddir); in nsim_dev_health_init()
205 health->recovered_break_msg = NULL; in nsim_dev_health_init()
206 debugfs_create_file("break_health", 0200, health->ddir, health, in nsim_dev_health_init()
208 health->binary_len = 16; in nsim_dev_health_init()
209 debugfs_create_u32("binary_len", 0600, health->ddir, in nsim_dev_health_init()
210 &health->binary_len); in nsim_dev_health_init()
211 health->fail_recover = false; in nsim_dev_health_init()
212 debugfs_create_bool("fail_recover", 0600, health->ddir, in nsim_dev_health_init()
213 &health->fail_recover); in nsim_dev_health_init()
217 devl_health_reporter_destroy(health->dummy_reporter); in nsim_dev_health_init()
219 devl_health_reporter_destroy(health->empty_reporter); in nsim_dev_health_init()
225 struct nsim_dev_health *health = &nsim_dev->health; in nsim_dev_health_exit() local
227 debugfs_remove_recursive(health->ddir); in nsim_dev_health_exit()
228 kfree(health->recovered_break_msg); in nsim_dev_health_exit()
229 devl_health_reporter_destroy(health->dummy_reporter); in nsim_dev_health_exit()
230 devl_health_reporter_destroy(health->empty_reporter); in nsim_dev_health_exit()