Page MenuHomeFreeBSD

Bug 223722 add sys/class/net data to linsysfs
ClosedPublic

Authored by cneirabustos_gmail.com on Dec 27 2017, 7:17 PM.
Referenced Files
Unknown Object (File)
Sun, Mar 17, 7:54 PM
Unknown Object (File)
Feb 8 2024, 4:33 AM
Unknown Object (File)
Feb 6 2024, 12:56 PM
Unknown Object (File)
Jan 28 2024, 4:29 AM
Unknown Object (File)
Jan 8 2024, 2:17 AM
Unknown Object (File)
Jan 3 2024, 9:27 AM
Unknown Object (File)
Dec 26 2023, 8:23 PM
Unknown Object (File)
Dec 21 2023, 3:09 AM

Details

Summary

Adds sys/class/net devices to linsysfs. Only two interfaces are created eth0 and lo and they expose the following properties:
address, addr_len, flags, ifindex, mty, tx_queue_len and type.

Test Plan

Mount linsysfs in a jail or in the host system and check if devices are created under sys/class/net and if properties are available.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Thanks, I will try to take a detailed look at this soon. For future changes, and if you have reason to upload a new diff to this review, please upload with full context as described in https://wiki.freebsd.org/action/show/Phabricator

cem requested changes to this revision.Jan 29 2018, 12:07 AM
cem added a subscriber: cem.

The patch does not conform to style(9).

This revision now requires changes to proceed.Jan 29 2018, 12:07 AM
cneirabustos_gmail.com edited the summary of this revision. (Show Details)
cneirabustos_gmail.com edited the test plan for this revision. (Show Details)

Fixed style.

style (9)

sys/compat/linsysfs/linsysfs.c
125 ↗(On Diff #55321)

tab until }?

141 ↗(On Diff #55321)

extra line

163 ↗(On Diff #55321)

remove '\n'

165 ↗(On Diff #55321)

whitespace

169 ↗(On Diff #55321)

add '\n'

187 ↗(On Diff #55321)

same

200 ↗(On Diff #55321)

same

235 ↗(On Diff #55321)

whitespace in function, below too

updated patch to address style(9) issues.

ok, btw, what is the reason to create only 2 devices (eth0 and lo0)?

ok, btw, what is the reason to create only 2 devices (eth0 and lo0)?

Hi,

The only reason is that two devices are the minimum needed to expose to applications that use sys/class/net data.

For future updates (to this review, if any, or other reviews) please include context e.g. git diff -U9999

sys/compat/linsysfs/linsysfs.c
268 ↗(On Diff #55423)

btw, why lo instead of lo0?

sys/compat/linsysfs/linsysfs.c
268 ↗(On Diff #55423)

It's Linux's name for the loopback interface (not lo0).

cneirabustos_gmail.com added inline comments.
sys/compat/linsysfs/linsysfs.c
268 ↗(On Diff #55423)

As @cem explained, the loopback device is named lo in Linux.

268 ↗(On Diff #55423)

That's correct.

This revision was not accepted when it landed; it landed in state Needs Review.May 6 2019, 8:01 PM
This revision was automatically updated to reflect the committed changes.
head/sys/compat/linsysfs/linsysfs.c
5

Ar you really need this line? As I rewrote most of the patch? )

cneirabustos_gmail.com added inline comments.
head/sys/compat/linsysfs/linsysfs.c
5

Thank you very much @dchagin, the patch looks nicer now!. Thanks for your help on this one.
You could remove that line if needed.