devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Tim Harvey <tharvey@gateworks.com>
Cc: "Pali Rohár" <pali@kernel.org>,
	"Sean Anderson" <sean.anderson@seco.com>,
	"Michal Suchánek" <msuchanek@suse.de>,
	"Stephen Hemminger" <stephen@networkplumber.org>,
	netdev <netdev@vger.kernel.org>, u-boot <u-boot@lists.denx.de>,
	"Device Tree Mailing List" <devicetree@vger.kernel.org>
Subject: Re: ethernet<n> dt aliases implications in U-Boot and Linux
Date: Wed, 10 Aug 2022 03:11:48 +0200	[thread overview]
Message-ID: <YvMF1JW3RzRbOhlx@lunn.ch> (raw)
In-Reply-To: <CAJ+vNU2xBthJHoD_-tPysycXZMchnXoMUBndLg4XCPrHOvgsDA@mail.gmail.com>

> Is something like the following really that crazy of an idea?
> diff --git a/net/core/dev.c b/net/core/dev.c
> index e0878a500aa9..a679c74a63c6 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1151,6 +1151,15 @@ static int dev_alloc_name_ns(struct net *net,
>         int ret;
> 
>         BUG_ON(!net);
> +#ifdef CONFIG_OF
> +       if (dev->dev.parent && dev->dev.parent->of_node) {
> +               const char *name =
> of_get_property(dev->dev.parent->of_node, "label", NULL);
> +               if (name) {
> +                       strlcpy(dev->name, name, IFNAMSIZ);
> +                       return 0;
> +               }
> +       }
> +#endif
>         ret = __dev_alloc_name(net, name, buf);
>         if (ret >= 0)
>                 strlcpy(dev->name, buf, IFNAMSIZ);
> 
> I still like using the index from aliases/ethernet* instead as there
> is a precedence for that in other Linux drivers as well as U-Boot

I guess you are new to the netdev list :-)

This is one of those FAQ sort of things, discussed every
year. Anything like this is always NACKed. I don't see why this time
should be any different.

DSA is somewhat special because it is very old. It comes from before
the times of DT. Its DT binding was proposed relatively earl in DT
times, and would be rejected in modern days. But the rules of ABI mean
the label property will be valid forever. But i very much doubt it
will spread to interfaces in general.

     Andrew

  reply	other threads:[~2022-08-10  1:13 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 19:18 ethernet<n> dt aliases implications in U-Boot and Linux Tim Harvey
2022-08-08 19:57 ` Sean Anderson
2022-08-08 21:09   ` Michal Suchánek
2022-08-08 21:38     ` Stephen Hemminger
2022-08-08 21:45       ` Michal Suchánek
2022-08-09 20:48         ` Sean Anderson
2022-08-09 21:31           ` Pali Rohár
2022-08-09 21:36             ` Sean Anderson
2022-08-09 21:42               ` Pali Rohár
2022-08-09 22:41                 ` Sean Anderson
2022-08-09 22:42                   ` Tim Harvey
2022-08-09 22:45                   ` Pali Rohár
2022-08-09 23:17                     ` Tim Harvey
2022-08-10  1:11                       ` Andrew Lunn [this message]
2022-08-10  7:16                         ` Michal Suchánek
2022-08-10 15:17                           ` Andrew Lunn
2022-08-10 15:35                             ` Michal Suchánek
2022-08-11 19:43                               ` Sean Anderson
2022-08-20  9:16                     ` Pali Rohár
2022-08-20 13:02                       ` Sean Anderson
2022-08-09 21:39             ` Tim Harvey
2022-08-09 21:45               ` Pali Rohár
2022-08-09 21:58               ` Stephen Hemminger
2022-08-10  9:56               ` Francesco Dolcini
2022-08-23 19:21               ` Rob Herring
2022-08-09 21:35           ` Tim Harvey
2022-08-09 21:41             ` Sean Anderson
2022-08-08 21:18   ` Tim Harvey
2022-08-08 21:18   ` Florian Fainelli
2022-08-08 21:28     ` Tim Harvey
2022-08-08 21:34       ` Florian Fainelli
2022-08-08 21:40         ` Tim Harvey

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=YvMF1JW3RzRbOhlx@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=msuchanek@suse.de \
    --cc=netdev@vger.kernel.org \
    --cc=pali@kernel.org \
    --cc=sean.anderson@seco.com \
    --cc=stephen@networkplumber.org \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /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).