Page MenuHomeFreeBSD

ifnet: add if_foreach_sleep() to allow ifnet iterations with sleep.

Authored by melifaro on Mar 4 2023, 10:10 AM.
Referenced Files
F88508304: D38904.diff
Mon, Jul 15, 8:52 PM
Unknown Object (File)
Wed, Jul 10, 2:16 AM
Unknown Object (File)
Wed, Jul 3, 8:06 PM
Unknown Object (File)
Sat, Jun 29, 2:24 PM
Unknown Object (File)
Fri, Jun 28, 6:29 AM
Unknown Object (File)
Thu, Jun 27, 12:38 AM
Unknown Object (File)
Mon, Jun 24, 8:57 PM
Unknown Object (File)
Fri, Jun 21, 5:13 AM



Some kernel customers exporting network interfaces may require sleep during the iteration. Netlink and linsysfs can be the examples.

This change adds the generic iteration interface, similar to if_foreach(), but allowing the callback to sleep.

Diff Detail

rG FreeBSD src repository
Lint Passed
No Test Coverage
Build Status
Buildable 50141
Build 47033: arc lint + arc unit

Event Timeline

Update match function signature.


seems should be error = cb();

This revision was not accepted when it landed; it landed in state Needs Review.Mar 6 2023, 3:09 PM
This revision was automatically updated to reflect the committed changes.

As discussed in email, if_foreach_sleep() sounds like the loop itself inserts a delay. I suggest changing it to if_foreach_sleepable(), which more accurately conveys that it can sleep (or use callbacks that can sleep), not that that it does sleep.