Page MenuHomeFreeBSD

linsysfs(4): Refactor to avoid referencing an unstable interfaces
ClosedPublic

Authored by dchagin on Feb 26 2023, 9:44 AM.
Referenced Files
F169495347: D38790.id118310.diff
Tue, Sep 1, 5:14 PM
F169417302: D38790.id118168.diff
Tue, Sep 1, 12:04 PM
F169283089: D38790.id117954.diff
Tue, Sep 1, 3:17 AM
Unknown Object (File)
Mon, Aug 31, 11:28 AM
Unknown Object (File)
Mon, Aug 31, 11:17 AM
Unknown Object (File)
Sun, Aug 30, 2:51 PM
Unknown Object (File)
Sun, Aug 30, 5:46 AM
Unknown Object (File)
Sat, Aug 29, 11:40 AM
Subscribers

Details

Summary

Enter the net epoch when traversing a list of interfaces. For that
split the ifname_linux_to_bsd() function on two counterparts, where
the ifname_linux_to_ifp() intended to use in epoch, while the
ifname_linux_to_bsd() intended to be a self-contained.
Until the linux_ioctl_coket() function is refactored, the
ifname_linux_to_bsd() temporarily returns interface outside
of the epoch.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 50098
Build 46990: arc lint + arc unit

Event Timeline

melifaro added inline comments.
sys/compat/linsysfs/linsysfs.c
214

Maybe the other way round? In that case, you don't need to have an additional epoch exit.

215

Nit: IIRC sbuf_printf() cannot sleep, so it's worth writing ifindex inside the epoch and avoid using a temporary variable.

233

Nit: same as previous one: do everything inside ifp != NULL condition

This revision is now accepted and ready to land.Feb 27 2023, 11:24 AM

done, btw, you are right, sbuf here don't sleep,
also vnet context stored as V_ifnet is not iniitalized without it

This revision now requires review to proceed.Mar 2 2023, 9:20 AM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 4 2023, 9:13 AM
This revision was automatically updated to reflect the committed changes.