netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: David Laight <David.Laight@ACULAB.COM>
Cc: Jiri Pirko <jiri@resnulli.us>,
	"netdev\@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem\@davemloft.net" <davem@davemloft.net>,
	"nhorman\@tuxdriver.com" <nhorman@tuxdriver.com>,
	"andy\@greyhouse.net" <andy@greyhouse.net>,
	"tgraf\@suug.ch" <tgraf@suug.ch>,
	"dborkman\@redhat.com" <dborkman@redhat.com>,
	"ogerlitz\@mellanox.com" <ogerlitz@mellanox.com>,
	"jesse\@nicira.com" <jesse@nicira.com>,
	"pshelar\@nicira.com" <pshelar@nicira.com>,
	"azhou\@nicira.com" <azhou@nicira.com>,
	"ben\@decadent.org.uk" <ben@decadent.org.uk>,
	"stephen\@networkplumber.org" <stephen@networkplumber.org>,
	"jeffrey.t.kirsher\@intel.com" <jeffrey.t.kirsher@intel.com>,
	"vyasevic\@redhat.com" <vyasevic@redhat.com>,
	"xiyou.wangcong\@gmail.com" <xiyou.wangcong@gmail.com>,
	"john.r.fastabend\@intel.com" <john.r.fastabend@intel.com>,
	"edumazet\@google.com" <edumazet@google.com>,
	"jhs\@mojatatu.com" <jhs@
Subject: Re: [patch iproute2 1/6] iproute2: ipa: show switch id
Date: Mon, 08 Dec 2014 15:56:06 -0600	[thread overview]
Message-ID: <8761dlst55.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D1CA0339B@AcuExch.aculab.com> (David Laight's message of "Fri, 5 Dec 2014 09:54:33 +0000")

David Laight <David.Laight@ACULAB.COM> writes:

> From: Eric W. Biederman
>> Jiri Pirko <jiri@resnulli.us> writes:
>> 
>> > Thu, Dec 04, 2014 at 09:06:14PM CET, ebiederm@xmission.com wrote:
>> >>ebiederm@xmission.com (Eric W. Biederman) writes:
>> >>
>> >>> Jiri Pirko <jiri@resnulli.us> writes:
>> >>>
>> >>>>>So this id needs to be globally unique?
>> >>>>
>> >>>> No. It is enough to be unique within a single system. It serves for no
>> >>>> more than to find out 2 ids are same or not, no other info value.
>> >>>>
>> >>>> So when the drivers uses sane ids (like mac for example, or in case of
>> >>>> rocker an id which is passed by qemu command line), the chances of
>> >>>> collision are very very close to none (never say never).
>> >>
>> >>Thinking about what you said a little more.
>> >>
>> >>Two different sources of persistent numbers picking numbers by
>> >>completely different algorithms can give you no assurance that you don't
>> >>produce conflicts.
>> >>
>> >>The switch id as desisgned can not work.
>> >>
>> >>There are expected to be between 2**36 to 2**40 devices in this world.
>> >>Your first switch id is a 64it number.  At the very best by the birthday
>> >>pardox predicts there will be a conflict ever 2**32 devices or between
>> >>2**4 and 2**8 devices in the world with conflicts.  If the ids are not
>> >>randomly distributed (which they won't be) things could easily be much
>> >>much worse.
>> >>
>> >>That is just good enough the code could get out there and run for years
>> >>before you have the nightmare of having to fix all of userspace.   That
>> >>is a nightmare no one needs.
>> >>
>> >>So please remove this broken code, and this broken concept from the
>> >>kernel and go back to the drawing board.
>> >
>> > In that case the phys port id is broken in the same way. Let's rather
>> > think about how to avoid conflicts for both. Given the fact the
>> > conflicts should be avoided only on a single baremetal, that should be
>> > doable (for (bad) example using driver name mixed with driver created
>> > id).
>> 
>> No.  phys_port_id is not broken in the same way, and phys_port_id does
>> not have the same set of properties.
>> 
>> phys_port_id's in practice all have an IEEE prefix that identifies the
>> manufacturer and a manufacture assigned serial number.  Aka a mac
>> address or a EUID-64.  What the mlx4 ethernet driver is doing retunring
>> a 64bit EUID-64 I don't know.  If there are problems in the worst
>> case issues with phys_port_id are fixable by simple driver tweaks,
>> because fundamentally we are working with globally uniuqe identifiers.
>> Well globally unique baring manufacturing bugs in eeproms.
>
> Manufacturers have to generate unique MAC addresses - otherwise people complain.
> But can't be assumed to put different 'serial numbers' in other devices.
> If you look at USB memory sticks you are likely to find that the serial
> number in the (equivalent of the) ATA identify response isn't unique.
> So I doubt you can use the value to distinguish between devices.

When I said serial number I was talking about MAC addresses.

> You also get the situation where ethernet MAC addresses only have to be
> unique within a collision domain. Many old sun systems used a single MAC
> address - valid because they assumed/required that multiple interfaces
> be connected to different networks.
> So even MAC addresses aren't per-interface.

The old sun system issue does not apply to switches and switch like
devices.

There are common layer two protocls (Spanning Tree? LACP?) that require
each switch port to have a unique mac address.  So people will complain
and software will break if there is not a mac address per port.  So for
switches and things that strongly resemble switches assuming a unique
mac address per port is a reasonable assumption.

Eric

  reply	other threads:[~2014-12-08 21:58 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04  8:57 [patch iproute2 0/6] iproute2: add changes for switchdev Jiri Pirko
2014-12-04  8:57 ` [patch iproute2 1/6] iproute2: ipa: show switch id Jiri Pirko
2014-12-04 13:17   ` Jamal Hadi Salim
2014-12-04 14:20   ` Andy Gospodarek
2014-12-04 14:29     ` Roopa Prabhu
2014-12-04 14:33     ` Jiri Pirko
2014-12-04 14:57       ` Andy Gospodarek
2014-12-04 15:12         ` Jiri Pirko
2014-12-04 15:15         ` Jiri Pirko
2014-12-04 15:28           ` Andy Gospodarek
2014-12-04 15:37         ` Thomas Graf
2014-12-04 16:15   ` Eric W. Biederman
2014-12-04 16:30     ` Jiri Pirko
2014-12-04 17:52       ` Eric W. Biederman
2014-12-04 17:59         ` Roopa Prabhu
2014-12-04 18:24         ` Jiri Pirko
2014-12-04 18:57           ` Eric W. Biederman
2014-12-04 19:19             ` Jiri Pirko
2014-12-04 19:26               ` Eric W. Biederman
2014-12-04 19:54                 ` Jiri Pirko
2014-12-04 20:06                 ` Eric W. Biederman
2014-12-04 20:27                   ` Jiri Pirko
2014-12-04 20:55                     ` Eric W. Biederman
2014-12-04 21:10                       ` Jiri Pirko
2014-12-04 21:24                         ` Eric W. Biederman
2014-12-04 22:07                         ` Thomas Graf
2014-12-05  9:54                       ` David Laight
2014-12-08 21:56                         ` Eric W. Biederman [this message]
2014-12-04  8:57 ` [patch iproute2 2/6] bridge/fdb: fix statistics output spacing Jiri Pirko
2014-12-10  0:32   ` Stephen Hemminger
2014-12-04  8:57 ` [patch iproute2 3/6] bridge/fdb: add flag/indication for FDB entry synced from offload device Jiri Pirko
2014-12-04 13:19   ` Jamal Hadi Salim
2014-12-24 20:39   ` Stephen Hemminger
2014-12-04  8:57 ` [patch iproute2 4/6] bridge/link: add new offload hwmode swdev Jiri Pirko
2014-12-04 13:23   ` Jamal Hadi Salim
2014-12-04 20:55     ` Scott Feldman
2014-12-24 20:37   ` Stephen Hemminger
2014-12-04  8:57 ` [patch iproute2 5/6] link: add missing IFLA_BRPORT_PROXYARP Jiri Pirko
2014-12-04 18:53   ` Stephen Hemminger
2014-12-04  8:57 ` [patch iproute2 6/6] bridge/link: add learning_sync policy flag Jiri Pirko
2014-12-04 13:26   ` Jamal Hadi Salim
2014-12-04 14:15     ` Jamal Hadi Salim
2014-12-04 13:16 ` [patch iproute2 0/6] iproute2: add changes for switchdev Jamal Hadi Salim
2014-12-04 13:56   ` Andy Gospodarek
2014-12-04 14:22     ` Roopa Prabhu
2014-12-04 14:31       ` Jamal Hadi Salim
2014-12-04 14:26 ` Roopa Prabhu
2014-12-04 14:34   ` Jiri Pirko
2014-12-04 14:45     ` Roopa Prabhu
2014-12-04 16:04       ` Jiri Pirko
2014-12-04 16:55         ` Roopa Prabhu
2014-12-04 20:49           ` Scott Feldman
2014-12-05  2:28             ` Roopa Prabhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761dlst55.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=andy@greyhouse.net \
    --cc=azhou@nicira.com \
    --cc=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=edumazet@google.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse@nicira.com \
    --cc=jiri@resnulli.us \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=ogerlitz@mellanox.com \
    --cc=pshelar@nicira.com \
    --cc=stephen@networkplumber.org \
    --cc=tgraf@suug.ch \
    --cc=vyasevic@redhat.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).