Page MenuHomeFreeBSD

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

Authored by cneirabustos_gmail.com on Dec 27 2017, 7:17 PM.

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

Lint
Lint Skipped
Unit
Unit Tests Skipped

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
124

tab until }?

140

extra line

162

remove '\n'

164

whitespace

168

add '\n'

186

same

199

same

234

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

btw, why lo instead of lo0?

sys/compat/linsysfs/linsysfs.c
268

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

cneirabustos_gmail.com added inline comments.
sys/compat/linsysfs/linsysfs.c
268

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

268

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 ↗(On Diff #57105)

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 ↗(On Diff #57105)

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