Subject: Re: [patch net-next v2 05/10] rocker: introduce rocker switch driver

From: Jiri Pirko <[email-masked]>
Date: Tue, 11 Nov 2014 16:40:17 +0100

Tue, Nov 11, 2014 at 04:32:32PM CET, [email-masked] wrote:
>On 11/11/14 at 04:19pm, Jiri Pirko wrote:
>> Tue, Nov 11, 2014 at 03:29:46PM CET, [email-masked] wrote:
>> >On 11/10/14 at 02:04pm, John Fastabend wrote:
>> >> On 11/09/2014 02:51 AM, Jiri Pirko wrote:
>> >> >+static int rocker_port_sw_parent_id_get(struct net_device *dev,
>> >> >+					struct netdev_phys_item_id *psid)
>> >> >+{
>> >> >+	struct rocker_port *rocker_port = netdev_priv(dev);
>> >> >+	struct rocker *rocker = rocker_port->rocker;
>> >> >+
>> >> 
>> >> hmm looks like you read this out of a magic switch register :) but
>> >> my switch doesn't have this magic reg. I suposse the switch MAC address
>> >> should work.
>> >
>> >This needs more work afterwards. Either we define that the switch ID
>> >is only unique in combination with the parent ifindex or we need to
>> >introduce a notation of uniquness into the switch ID itself.
>> 
>> This is something similar to physical port id. Each driver should take
>> care of generating that id.
>
>If the ID is only unique within a driver, then the user space cannot
>rely on using the ID to group switch ports. Multiple drivers might
>come up with the same ID.

Well, as I said, it is the same as for physical port id. But if needed,
there can be added some simple mechanism for the id registration
ensuring their uniqueness.

>
>Even now, multiple rocker instances would have the same ID.

It depends on what hw returns to driver.