devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Wells Lu 呂芳騰" <wells.lu@sunplus.com>
Cc: Jakub Kicinski <kuba@kernel.org>, Wells Lu <wellslutw@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"roopa@nvidia.com" <roopa@nvidia.com>,
	"edumazet@google.com" <edumazet@google.com>
Subject: Re: [PATCH net-next v8 2/2] net: ethernet: Add driver for Sunplus SP7021
Date: Tue, 19 Apr 2022 15:03:03 +0200	[thread overview]
Message-ID: <Yl6zBwiJ2O1ALnjs@lunn.ch> (raw)
In-Reply-To: <e784ab5356aa4b6e93765b54bdefea0a@sphcmbx02.sunplus.com.tw>

On Tue, Apr 19, 2022 at 10:07:55AM +0000, Wells Lu 呂芳騰 wrote:
> > > > +		/* Get mac-address from nvmem. */
> > > > +		ret = spl2sw_nvmem_get_mac_address(&pdev->dev, port_np, mac_addr);
> > > > +		if (ret) {
> > > > +			dev_info(&pdev->dev, "Generate a random mac address!\n");
> > > > +
> > > > +			/* Generate a mac address using OUI of Sunplus Technology
> > > > +			 * and random controller number.
> > > > +			 */
> > > > +			mac_addr[0] = 0xfc; /* OUI of Sunplus: fc:4b:bc */
> > > > +			mac_addr[1] = 0x4b;
> > > > +			mac_addr[2] = 0xbc;
> > > > +			mac_addr[3] = get_random_int() % 256;
> > > > +			mac_addr[4] = get_random_int() % 256;
> > > > +			mac_addr[5] = get_random_int() % 256;
> > >
> > > I don't think you can do that. Either you use your OUI and assign the
> > > address at manufacture or you must use a locally administered address.
> > > And if locally administered address is used it better be completely
> > > random to lower the probability of collision to absolute minimum.
> > 
> > I commented about that in an earlier version of these patches. We probably need a quote
> > from the 802.1 or 802.3 which says this is O.K.
> > 
> > 	 Andrew
> 
> Hi Andrew,
> 
> I plan to replace above statements with:
> 
> 	eth_random_addr(mac_addr);

O.K, that is good.

> Do you mean I can keep use the mac address: "OUI + random number"?

If you can show us text in an IEEE 802.1, IEEE 802.3, or some other
IEEE document which says this is allowed.

> Only need to add comment for it.

Add a comment which points to a document which says you are allowed to
do this. This is very unusual, so questions will be asked, and if you
point people at the answer it will help.

      Andrew

  reply	other threads:[~2022-04-19 13:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13  2:31 [PATCH net-next v8 0/2] This is a patch series for Ethernet driver of Sunplus SP7021 SoC Wells Lu
2022-04-13  2:31 ` [PATCH net-next v8 1/2] devicetree: bindings: net: Add bindings doc for Sunplus SP7021 Wells Lu
2022-04-13  2:31 ` [PATCH net-next v8 2/2] net: ethernet: Add driver " Wells Lu
2022-04-14 12:18   ` Jakub Kicinski
2022-04-14 13:36     ` Andrew Lunn
2022-04-19 10:07       ` Wells Lu 呂芳騰
2022-04-19 13:03         ` Andrew Lunn [this message]
2022-04-19  9:49     ` Wells Lu 呂芳騰

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=Yl6zBwiJ2O1ALnjs@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=roopa@nvidia.com \
    --cc=wells.lu@sunplus.com \
    --cc=wellslutw@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).