Sysfs is too restrictive

From: Stephen Hemminger
Date: Fri Feb 27 2004 - 13:09:11 EST


I have been experimenting with using sysfs to manage Ethernet bridge devices
but have to conclude that sysfs is too restrictive to be useful for doing
it. Maybe for 2.7, some of the implementation restrictions that tie kobjects
directly to the file hierarchy can be lifted.

Here is what I want to do. Assume there are only two kobject's related to
bridging. The first is the class device (inside the net_device) that contains
"br0". The other is the bridge port which represents an interface in a bridge.
The hack method of adding kobjects to create subdirectories would make the already
painful ref count issues worse.

It is too hard to get the desired directory layout without re-implementing most
of sysfs in the driver. This is what I want, and don't have Pat to kick around
anymore.

class
`-- net
|-- br0
| |-- addr_len
| |-- address
| |-- bridge
| | |-- forward_delay
| | |-- hello_time
| | |-- id
| | |-- max_age
| | |-- port
| | | |-- cost
| | | |-- eth0 -> ../../../eth0
| | | |-- priority
| | | `-- stp
| | `-- priority
| |-- broadcast
| |-- features
| |-- flags
| |-- ifindex
| |-- mtu
| |-- statistics
| | |-- collisions
| | |-- multicast
| | |-- rx_bytes
| | |-- rx_compressed
| | |-- rx_crc_errors
| | |-- rx_dropped
| | |-- rx_errors
| | |-- rx_fifo_errors
| | |-- rx_frame_errors
| | |-- rx_length_errors
| | |-- rx_missed_errors
| | |-- rx_over_errors
| | |-- rx_packets
| | |-- tx_aborted_errors
| | |-- tx_bytes
| | |-- tx_carrier_errors
| | |-- tx_compressed
| | |-- tx_dropped
| | |-- tx_errors
| | |-- tx_fifo_errors
| | |-- tx_heartbeat_errors
| | |-- tx_packets
| | `-- tx_window_errors
| |-- tx_queue_len
| `-- type
`-- eth0
|-- addr_len
|-- address
|-- broadcast
|-- device -> ../../../devices/pci0000:00/0000:00:1e.0/0000:04:04.0
|-- driver -> ../../../bus/pci/drivers/e100
|-- features
|-- flags
|-- ifindex
|-- iflink
|-- mtu
|-- statistics
| |-- collisions
| |-- multicast
| |-- rx_bytes
| |-- rx_compressed
| |-- rx_crc_errors
| |-- rx_dropped
| |-- rx_errors
| |-- rx_fifo_errors
| |-- rx_frame_errors
| |-- rx_length_errors
| |-- rx_missed_errors
| |-- rx_over_errors
| |-- rx_packets
| |-- tx_aborted_errors
| |-- tx_bytes
| |-- tx_carrier_errors
| |-- tx_compressed
| |-- tx_dropped
| |-- tx_errors
| |-- tx_fifo_errors
| |-- tx_heartbeat_errors
| |-- tx_packets
| `-- tx_window_errors
|-- tx_queue_len
`-- type

8 directories, 75 files
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/