[lkml]   [2007]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2.6.21-rc1] ehea: dynamic add / remove port

I agree with most points. Here the new design proposal:

On Wednesday 14 February 2007 23:25, John Rose wrote:
> Hi-
> A few high level comments, then some really insignificant ones.
> First, is there a reason why we shouldn't have a sysfs entry/kobject for
> each logical port? How is it possible to determine, from the adapter
> sysfs directory, the current number of ports for that adapter? A port
> sysfs directory could include attributes like the OF path to the port,
> the state of the port, etc etc.

I think it is not necessary to have a special entry/kobject for each logical
port. I suggest we use SET_NETDEV_DEV to create links to all ethernet devices
that represent each a logical port. This should be in sync with all other
ethernet drivers. Port attributes like the "logical port id" that might be
need by the userspace application can be added to the net:ethX entry
(link created with SET_NETDEV_DEV) as additional attributes.
Thus we have a simple and consistent way to determine
all currently available network interfaces (logical ports) and its
corresponding IDs.

> Second, the probe and remove functions do not communicate whether an add
> or remove was successful. Combine this with the lack of port
> information in the adapter sysfs directory, and the userspace tool has
> no way of verifying a dynamic add/remove.

True. I suggest we return error codes (-EIO / -EINVAL) in case the adding
or removing of ports fails. This is possible as we know instantly if the
operation failed or not. It is a synchronus operation.

> + ehea_info("%s -> logial port id #%d",
> Spelling :)
true, fixed

> if (port_setup_ok)
> - ret = 0; /* At least some ports are setup correctly */
> + return 0; /* At least some ports are setup correctly */
> else
> - ret = -EINVAL;
> + return -EINVAL;
> The else is unnecessary.

agreed, fixed

> static int __devexit ehea_remove(struct ibmebus_dev *dev)
> {
> struct ehea_adapter *adapter = dev->;
> u64 hret;
> int i;
> - for (i = 0; i < adapter->num_ports; i++)
> + for (i = 0; i < EHEA_MAX_PORTS; i++)
> if (adapter->port[i]) {
> ehea_shutdown_single_port(adapter->port[i]);
> adapter->port[i] = NULL;
> }
> Else break?
no break wanted here as "remove_port" might cause situations where
not all currently available ports are in a row

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-02-16 16:13    [W:0.090 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site