netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/2] Add new switchdev device class
@ 2015-08-27  7:16 sfeldma
  2015-08-27  7:16 ` [RFC PATCH net-next 1/2] switchdev: create " sfeldma
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: sfeldma @ 2015-08-27  7:16 UTC (permalink / raw)
  To: netdev; +Cc: jiri, davem, f.fainelli, roopa

From: Scott Feldman <sfeldma@gmail.com>

In the switchdev model, we use netdevs to represent switchdev ports, but we
have no representation for the switch itself.  So, introduce a new switchdev
device class so we can define semantics and programming interfaces for the
switch itself.  Switchdev device class isn't tied to any particular bus.

This patch set is just the skeleton to get us started.  It adds the sysfs
object registration for the new class and defines a class-level attr "foo".
With the new class, we could hook PM functions, for example, to handle power
transitions at the switch level.  I registered rocker and get:

   $ ls /sys/class/switchdev/5254001235010000/
   foo  power  subsystem  uevent

So what next?  I'd rather not build APIs around sysfs, so we need a netlink API
we can build on top of this.  It's not really rtnl.  Maybe genl would work?
What ever it is, we'd need to teach iproute2 about a new 'switch' command.

Netlink API would allow us to represent switch-wide objects such as registers,
tables, stats, firmware, and maybe even control.  I think with with netlink
TLVs, we can create a framework for these objects but still allow the switch
driver provide switch-specific info.  For example, a table object:

[TABLES]
	[TABLE]
		[FIELDS]
			[FIELD]
				[ID, TYPE]
		[DATA]
			[ID, VALUE]

Maybe iproute2 has pretty-printers for specific switches like ethtool has for
reg dumps.

I don't know about how this overlaps with DSA platform_class.  Florian?

Comments?


Scott Feldman (2):
  switchdev: create new switchdev device class
  rocker: register each switch as a switchdev

 drivers/net/ethernet/rocker/rocker.c |   23 ++++++++++
 include/net/switchdev.h              |   16 +++++++
 net/switchdev/switchdev.c            |   76 ++++++++++++++++++++++++++++++++++
 3 files changed, 115 insertions(+)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-08-28 16:58 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).