linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Uwe Kleine-König" <uwe@kleine-koenig.org>,
	"Andrey Smirnov" <andrew.smirnov@gmail.com>
Subject: Re: [PATCH net-next v2] net: dsa: make "label" property optional for dsa2
Date: Mon, 09 Jan 2017 10:04:50 -0500	[thread overview]
Message-ID: <877f6446lp.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <20170109073236.GA1862@nanopsycho>

Hi Jiri,

Jiri Pirko <jiri@resnulli.us> writes:

>>    # cat /etc/udev/rules.d/90-net-dsa.rules
>>    SUBSYSTEM=="net", ACTION=="add", ENV{DEVTYPE}=="dsa", PROGRAM="/lib/udev/dsanitizer $attr{phys_switch_id} $attr{phys_port_id}", NAME="$result"
>
> I know this is kind of confusing, but phys_port_id is to be used to
> indicate same physical port that is shared by multiple netdevices- for
> example sr-iov usecase. For switchdev usecase, you should use
> phys_port_name.
>
> I will add some documentation to kernel regarding this. But I see that
> net/dsa/slave.c already implements .ndo_get_phys_port_id :(
>
> I recently made changes in udev so it names the switch ports according
> to phys_port_name, out of the box, without need for any rules:
> https://github.com/systemd/systemd/pull/4506/commits/c960caa0c2a620fc506c6f0f7b6c40eeace48e4d

Thanks for the details. So if I understand correctly, what will be found
in phys_port_name will be used as is by udev to name the interface?

Extra question: shouldn't phys_port_{id,name} be switchdev attributes in
addition to SWITCHDEV_ATTR_ID_PORT_PARENT_ID?

> I guess that it should be enough for you to implement
> ndo_get_phys_port_name.

Well, if this name must be unique on a system, it's not likely to happen
until we agree that we use an ugly tXsYpZ template where X is a tree ID,
or we assign system-wide unique IDs to switches, which requires a bit of
changes.

I'm thinking, since DSA slaves are switchdev users, can't we all use a
switchdev helper to optionally get a system-wide unique name for a given
switch port? e.g. a template such as "swp%d"? I'd prefer that switchdev
and DSA do not diverge much when it comes to implement such attributes.

But again, this is not related to this patch ;-)

Thanks,

        Vivien

  reply	other threads:[~2017-01-09 15:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-08 23:15 [PATCH net-next v2] net: dsa: make "label" property optional for dsa2 Vivien Didelot
2017-01-08 23:30 ` Andrew Lunn
2017-01-09  2:56   ` Vivien Didelot
2017-01-09  7:32 ` Jiri Pirko
2017-01-09 15:04   ` Vivien Didelot [this message]
2017-01-09 15:11     ` Jiri Pirko
2017-01-09 15:45       ` Vivien Didelot
2017-01-09 16:00         ` Andrew Lunn
2017-01-09 16:07           ` Jiri Pirko
2017-01-09 16:06         ` Jiri Pirko
2017-01-09 17:42           ` Florian Fainelli
2017-01-09 17:58             ` Jiri Pirko
2017-01-09 18:06               ` Florian Fainelli
2017-01-10  9:55                 ` Jiri Pirko
2017-01-10 17:58                   ` Florian Fainelli
2017-01-11  7:26                     ` Jiri Pirko

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=877f6446lp.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=uwe@kleine-koenig.org \
    /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).