Page MenuHomeFreeBSD

iflib: Add an admin task detach fail point
ClosedPublic

Authored by kbowling on Sat, Aug 8, 6:22 AM.
Tags
None
Referenced Files
F169611981: D58720.id183655.diff
Wed, Sep 2, 1:45 AM
F169572960: D58720.diff
Tue, Sep 1, 11:12 PM
F169524716: D58720.diff
Tue, Sep 1, 7:45 PM
Unknown Object (File)
Mon, Aug 31, 7:04 AM
Unknown Object (File)
Mon, Aug 31, 6:45 AM
Unknown Object (File)
Mon, Aug 31, 6:28 AM
Unknown Object (File)
Sun, Aug 30, 7:21 PM
Unknown Object (File)
Sun, Aug 30, 11:02 AM

Details

Summary
Add an exact-device fail point immediately after the admin task checks
IFC_IN_DETACH.  This makes the detach race reproducible without
affecting another interface.

Use a bounded delay because the taskqueue lock remains held while the
task runs.  Mark the point nonsleepable as a safety backstop, and
document a one-shot test for verifying that deregistration drains an
already-running task before ether_ifdetach().

MFC after:      2 weeks
Test Plan

sysctl debug.fail_point.iflib.admin_task_device=igc1
sysctl debug.fail_point.iflib.admin_task_after_detach_check='1*print(1)->1*delay(5000000)'

You will see: fail point admin_task_after_detach_check executing

Then immediately run:
time devctl detach igc1

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This is really cool. I had never know about fail(9)

This revision is now accepted and ready to land.Tue, Aug 11, 2:14 PM

This is really cool. I had never know about fail(9)

Me neither! Would've saved me a ton of injecting faults during some driver work

kgalazka added a subscriber: kgalazka.

This is great! Both as a patch and as an advertisement for the fail(9). Thank you!