netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: netdev@vger.kernel.org, linux@roeck-us.net, andrew@lunn.ch
Subject: Re: [PATCH net-next] net: dsa: Set a "dsa" device_type
Date: Thu, 24 Sep 2015 17:28:58 -0700	[thread overview]
Message-ID: <5604954A.7090409@gmail.com> (raw)
In-Reply-To: <20150924223748.GA6064@ketchup.mtl.sfl>

On 24/09/15 15:37, Vivien Didelot wrote:
> Hi Florian,
> 
> On Sep. Wednesday 23 (39) 06:19 PM, Florian Fainelli wrote:
>> Provide a device_type information for slave network devices created by
>> DSA, this is useful for user-space application to easily locate/search
>> for devices of a specific kind.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> Noob question, how is that used from user-space?

This changes the 'uevent' attribute, before, it would look like this:

cat /sys/class/net/gphy/uevent
OF_NAME=port
OF_FULLNAME=/rdb/switch_top@f0b00000/ethernet_switch@0/switch@0/port@0
OF_COMPATIBLE_N=0
OF_ALIAS_0=switch_port0
INTERFACE=gphy
IFINDEX=3
#

With that change it looks like this:

# cat /sys/class/net/gphy/uevent
DEVTYPE=dsa
OF_NAME=port
OF_FULLNAME=/rdb/switch_top@f0b00000/ethernet_switch@0/switch@0/port@0
OF_COMPATIBLE_N=0
OF_ALIAS_0=switch_port0
INTERFACE=gphy
IFINDEX=3

VLAN does a similar thing:

DEVTYPE=vlan
INTERFACE=eth0.2
IFINDEX=14

> 
> Also, don't you think that this "dsa" device type might be conflicting
> with eventually exposed DSA ports? Or will they all get the same type?

Well, as of today these ports are not exposed, it is unclear to me
whether they would be real network devices (with an actual struct device
backing them), and we may want to dedicate a specific DEVTYPE like
"dsa-pseudo-port" or something like that, specifically for these devices.

Hope this clarifies the intent and usefulness of the patch.
-- 
Florian

  reply	other threads:[~2015-09-25  0:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24  1:19 [PATCH net-next] net: dsa: Set a "dsa" device_type Florian Fainelli
2015-09-24 22:37 ` Vivien Didelot
2015-09-25  0:28   ` Florian Fainelli [this message]
2015-09-25  3:37     ` Vivien Didelot
2015-09-25 19:25 ` David Miller

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=5604954A.7090409@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.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).