From: Andrew Lunn <andrew@lunn.ch>
To: Scott Feldman <sfeldma@gmail.com>
Cc: Netdev <netdev@vger.kernel.org>, "Ji??í Pírko" <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Roopa Prabhu" <roopa@cumulusnetworks.com>
Subject: Re: [RFC PATCH net-next 0/2] Add new switchdev device class
Date: Fri, 28 Aug 2015 13:52:55 +0200 [thread overview]
Message-ID: <20150828115255.GC20774@lunn.ch> (raw)
In-Reply-To: <CAE4R7bCxb8Ni4b5=o80FG+iGEA_dtpefWm9o5eqqKLboC35stg@mail.gmail.com>
> So with kobj, a device can have a parent. So I experimented with my
> RFC patch and changed register_switchdev to take a parent switchdev
> arg, which is NULL for leaf switchdevs:
>
> int register_switchdev(struct switchdev *sdev, const char *name,
> struct switchdev *parent)
> {
> struct device *dev = &sdev->dev;
> int err;
>
> device_initialize(dev);
>
> dev->class = &switchdev_class;
> if (parent)
> dev->parent = &parent->dev;
>
> err = dev_set_name(dev, "%s", name);
> if (err)
> return err;
>
> return device_add(dev);
> }
...
> With this, we can stack switchdevs, I guess as high as we want. Does
> this look usable for DSA? An attr set on the master would get pushed
> down to the leaves. We'd can do it with the same style of recursive
> algos we use for switchdev port attrs.
Since this is a file system, we are limited to trees. But the hardware
is actually a graph. The interconnect points are ports on the switch,
and possible trunks/bonds of ports. I doubt there is a nice way to
represent this.
So it probably makes sense to have the switch with the port to the
host as the root of the tree, and all other switches are leafs of that
root.
How do you envisage addressing? I want to use netlink to read the
global registers from a specific switch for example.
Andrew
next prev parent reply other threads:[~2015-08-28 12:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-27 7:16 [RFC PATCH net-next 0/2] Add new switchdev device class sfeldma
2015-08-27 7:16 ` [RFC PATCH net-next 1/2] switchdev: create " sfeldma
2015-08-27 7:16 ` [RFC PATCH net-next 2/2] rocker: register each switch as a switchdev sfeldma
2015-08-27 7:27 ` [RFC PATCH net-next 0/2] Add new switchdev device class Jiri Pirko
2015-08-27 7:43 ` John Fastabend
2015-08-27 7:51 ` Jiri Pirko
2015-08-27 8:14 ` John Fastabend
2015-08-27 8:17 ` Scott Feldman
2015-08-27 8:41 ` Jiri Pirko
2015-08-27 7:36 ` John Fastabend
2015-08-27 7:44 ` Jiri Pirko
2015-08-27 8:09 ` John Fastabend
2015-08-27 8:23 ` Scott Feldman
2015-08-27 7:45 ` Andrew Lunn
2015-08-27 8:42 ` Scott Feldman
2015-08-27 9:06 ` Andrew Lunn
2015-08-27 16:41 ` Scott Feldman
2015-08-28 11:52 ` Andrew Lunn [this message]
2015-08-27 13:54 ` John W. Linville
2015-08-27 23:25 ` David Miller
2015-08-28 2:13 ` Arad, Ronen
2015-08-28 16:55 ` Florian Fainelli
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=20150828115255.GC20774@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=roopa@cumulusnetworks.com \
--cc=sfeldma@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.