* Question about phys_port_id
@ 2014-12-17 16:09 Joshua Watt
2014-12-17 16:47 ` Dan Williams
0 siblings, 1 reply; 6+ messages in thread
From: Joshua Watt @ 2014-12-17 16:09 UTC (permalink / raw)
To: netdev
Hello,
I had a question regarding the phys_port_id attribute of net_device.
Is that identifier supposed to be globally unique or just unique among
devices that share a common device? For example, we have a single
device that create two net_device s (one for each of it's macs). Would
it be sufficient for this device to return a phys_port_id of 0 for the
first net_device and 1 for the second? I noticed that the other
implementations that use phys_port_id copy their mac address into the
phys_port_id, but I'm not sure if that is just because that is an easy
way to get a unique number or if it is because the ID needs to be
globally unique.
If you're wondering the driver in question is the TI cpsw driver
(drivers/net/ethernet/ti/cpsw.c). We are running the device in
dual-emac mode and need to uniquely identify which emac is which in
userspace (specifically, udev rules). The physical port identifier
seems to be the logical choice to me, but I'm not sure if I'm missing
something.
Thanks,
Joshua Watt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about phys_port_id
2014-12-17 16:09 Question about phys_port_id Joshua Watt
@ 2014-12-17 16:47 ` Dan Williams
2014-12-17 16:59 ` [PATCH] Documentation: clarify phys_port_id Dan Williams
0 siblings, 1 reply; 6+ messages in thread
From: Dan Williams @ 2014-12-17 16:47 UTC (permalink / raw)
To: Joshua Watt; +Cc: netdev
On Wed, 2014-12-17 at 10:09 -0600, Joshua Watt wrote:
> Hello,
>
> I had a question regarding the phys_port_id attribute of net_device.
> Is that identifier supposed to be globally unique or just unique among
> devices that share a common device? For example, we have a single
> device that create two net_device s (one for each of it's macs). Would
Do the two net_device's share hardware or firmware resources? Can they
be used independently at maximum capability, or when both are in use do
they have degraded capability?
> it be sufficient for this device to return a phys_port_id of 0 for the
> first net_device and 1 for the second? I noticed that the other
If the two netdevs share resources, then they should have the *same*
phys_port_id. If they do not have the same physical hardware or shared
resources and are completely independent from each other at all levels,
then you can either skip phy_port_id altogether.
One good use for this (and why it was originally added) was to indicate
to userspace that it was pointless to bond two interfaces with the same
underlying hardware or resources, because that totally defeats the
purpose of both failover and aggregation.
> implementations that use phys_port_id copy their mac address into the
> phys_port_id, but I'm not sure if that is just because that is an easy
> way to get a unique number or if it is because the ID needs to be
> globally unique.
Say you have two netdevs that share the same hardware or resources. You
assign them both a phys_port_id of "1" to indicate this. What if
there's a second cpsw device on the system, do both of its netdevs also
get "1", or "2", or? Or how about a card from another vendor, how do
you ensure that your device's phys_port_id won't conflict with that
vendor's device/driver?
That's why most drivers currently use the MAC address or a GUID.
Dan
> If you're wondering the driver in question is the TI cpsw driver
> (drivers/net/ethernet/ti/cpsw.c). We are running the device in
> dual-emac mode and need to uniquely identify which emac is which in
> userspace (specifically, udev rules). The physical port identifier
> seems to be the logical choice to me, but I'm not sure if I'm missing
> something.
>
> Thanks,
> Joshua Watt
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] Documentation: clarify phys_port_id
2014-12-17 16:47 ` Dan Williams
@ 2014-12-17 16:59 ` Dan Williams
2014-12-17 23:24 ` Florian Fainelli
2014-12-18 5:57 ` Sathya Perla
0 siblings, 2 replies; 6+ messages in thread
From: Dan Williams @ 2014-12-17 16:59 UTC (permalink / raw)
To: netdev; +Cc: Joshua Watt, jpirko, Florian Fainelli
Signed-off-by: Dan Williams <dcbw@redhat.com>
---
Documentation/ABI/testing/sysfs-class-net | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Documentation/ABI/testing/sysfs-class-net b/Documentation/ABI/testing/sysfs-class-net
index e1b2e78..7fe823a 100644
--- a/Documentation/ABI/testing/sysfs-class-net
+++ b/Documentation/ABI/testing/sysfs-class-net
@@ -186,7 +186,12 @@ KernelVersion: 3.12
Contact: netdev@vger.kernel.org
Description:
Indicates the interface unique physical port identifier within
- the NIC, as a string.
+ the NIC, as a string. If two net_device objects share physical
+ hardware or other resources, and/or do not operate independently
+ both net_device objects should be assigned the
+ same phys_port_id. phys_port_id should be as globally unique
+ as possible to prevent conflicts between different drivers and
+ vendors, eg with MAC addresses or hardware GUIDs.
What: /sys/class/net/<iface>/speed
Date: October 2009
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Documentation: clarify phys_port_id
2014-12-17 16:59 ` [PATCH] Documentation: clarify phys_port_id Dan Williams
@ 2014-12-17 23:24 ` Florian Fainelli
2014-12-18 5:57 ` Sathya Perla
1 sibling, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2014-12-17 23:24 UTC (permalink / raw)
To: Dan Williams, netdev; +Cc: Joshua Watt, jpirko
On 17/12/14 08:59, Dan Williams wrote:
> Signed-off-by: Dan Williams <dcbw@redhat.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> Documentation/ABI/testing/sysfs-class-net | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-class-net b/Documentation/ABI/testing/sysfs-class-net
> index e1b2e78..7fe823a 100644
> --- a/Documentation/ABI/testing/sysfs-class-net
> +++ b/Documentation/ABI/testing/sysfs-class-net
> @@ -186,7 +186,12 @@ KernelVersion: 3.12
> Contact: netdev@vger.kernel.org
> Description:
> Indicates the interface unique physical port identifier within
> - the NIC, as a string.
> + the NIC, as a string. If two net_device objects share physical
> + hardware or other resources, and/or do not operate independently
> + both net_device objects should be assigned the
> + same phys_port_id. phys_port_id should be as globally unique
> + as possible to prevent conflicts between different drivers and
> + vendors, eg with MAC addresses or hardware GUIDs.
>
> What: /sys/class/net/<iface>/speed
> Date: October 2009
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] Documentation: clarify phys_port_id
2014-12-17 16:59 ` [PATCH] Documentation: clarify phys_port_id Dan Williams
2014-12-17 23:24 ` Florian Fainelli
@ 2014-12-18 5:57 ` Sathya Perla
2014-12-18 15:35 ` Dan Williams
1 sibling, 1 reply; 6+ messages in thread
From: Sathya Perla @ 2014-12-18 5:57 UTC (permalink / raw)
To: Dan Williams, netdev@vger.kernel.org
Cc: Joshua Watt, jpirko@redhat.com, Florian Fainelli
> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
>
> Signed-off-by: Dan Williams <dcbw@redhat.com>
> ---
> Documentation/ABI/testing/sysfs-class-net | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-class-net
> b/Documentation/ABI/testing/sysfs-class-net
> index e1b2e78..7fe823a 100644
> --- a/Documentation/ABI/testing/sysfs-class-net
> +++ b/Documentation/ABI/testing/sysfs-class-net
> @@ -186,7 +186,12 @@ KernelVersion: 3.12
> Contact: netdev@vger.kernel.org
> Description:
> Indicates the interface unique physical port identifier within
> - the NIC, as a string.
> + the NIC, as a string. If two net_device objects share physical
> + hardware or other resources, and/or do not operate
> independently
> + both net_device objects should be assigned the
> + same phys_port_id. phys_port_id should be as globally
> unique
> + as possible to prevent conflicts between different drivers
> and
> + vendors, eg with MAC addresses or hardware GUIDs.
Dan, two interfaces -- on the same card/chip -- may share some chip resources,
but as long as they use *separate* physical ports, it would be OK to bond them.
So, in this case, it would be valid to report a different phys_port_id for these netdevs.
The text -- "share physical hardware or other resources" becomes too restrictive
^^^^^^^^^^^^^^^
and will not even allow bonding of two physical ports on a NIC card.
thks,
-Sathya
>
> What: /sys/class/net/<iface>/speed
> Date: October 2009
> --
> 1.9.3
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Documentation: clarify phys_port_id
2014-12-18 5:57 ` Sathya Perla
@ 2014-12-18 15:35 ` Dan Williams
0 siblings, 0 replies; 6+ messages in thread
From: Dan Williams @ 2014-12-18 15:35 UTC (permalink / raw)
To: Sathya Perla
Cc: netdev@vger.kernel.org, Joshua Watt, jpirko@redhat.com,
Florian Fainelli
On Thu, 2014-12-18 at 05:57 +0000, Sathya Perla wrote:
> > -----Original Message-----
> > From: netdev-owner@vger.kernel.org [mailto:netdev-
> >
> > Signed-off-by: Dan Williams <dcbw@redhat.com>
> > ---
> > Documentation/ABI/testing/sysfs-class-net | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/ABI/testing/sysfs-class-net
> > b/Documentation/ABI/testing/sysfs-class-net
> > index e1b2e78..7fe823a 100644
> > --- a/Documentation/ABI/testing/sysfs-class-net
> > +++ b/Documentation/ABI/testing/sysfs-class-net
> > @@ -186,7 +186,12 @@ KernelVersion: 3.12
> > Contact: netdev@vger.kernel.org
> > Description:
> > Indicates the interface unique physical port identifier within
> > - the NIC, as a string.
> > + the NIC, as a string. If two net_device objects share physical
> > + hardware or other resources, and/or do not operate
> > independently
> > + both net_device objects should be assigned the
> > + same phys_port_id. phys_port_id should be as globally
> > unique
> > + as possible to prevent conflicts between different drivers
> > and
> > + vendors, eg with MAC addresses or hardware GUIDs.
>
> Dan, two interfaces -- on the same card/chip -- may share some chip resources,
> but as long as they use *separate* physical ports, it would be OK to bond them.
> So, in this case, it would be valid to report a different phys_port_id for these netdevs.
>
> The text -- "share physical hardware or other resources" becomes too restrictive
> ^^^^^^^^^^^^^^^
> and will not even allow bonding of two physical ports on a NIC card.
Fair enough, I will reword and resubmit.
Dan
> thks,
> -Sathya
> >
> > What: /sys/class/net/<iface>/speed
> > Date: October 2009
> > --
> > 1.9.3
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-12-18 15:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-17 16:09 Question about phys_port_id Joshua Watt
2014-12-17 16:47 ` Dan Williams
2014-12-17 16:59 ` [PATCH] Documentation: clarify phys_port_id Dan Williams
2014-12-17 23:24 ` Florian Fainelli
2014-12-18 5:57 ` Sathya Perla
2014-12-18 15:35 ` Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).