netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/2] net: switchdev: add attribute for port bridging
@ 2016-03-09 17:42 Vivien Didelot
  2016-03-09 17:42 ` [RFC PATCH net-next 1/2] net: bridge: add switchdev attr " Vivien Didelot
  2016-03-09 17:42 ` [RFC PATCH net-next 2/2] net: dsa: support SWITCHDEV_ATTR_ID_PORT_BRIDGE_IF Vivien Didelot
  0 siblings, 2 replies; 11+ messages in thread
From: Vivien Didelot @ 2016-03-09 17:42 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
	Andrew Lunn, Scott Feldman, Jiri Pirko, Ido Schimmel, nikolay,
	Elad Raz, Vivien Didelot

Current switchdev users implement notifier blocks to filter global netdev
events, in order to correctly offload bridging to their hardware ports.

Such code could be replaced with the support of a simple switchdev attribute
set when adding/deleting a port to/from a bridge.

Also, we can imagine a switch driver or network layer wanting to restrict the
number of logical bridges on top of a physical device. That could be done by
returning -EOPNOTSUPP when setting such attribute.

The first patch adds a new SWITCHDEV_ATTR_ID_PORT_BRIDGE_IF switchdev attribute
containing a boolean, set when joining or leaving a bridge.

The second patch shows the benefit of supporting such attribute in the DSA
layer. Similar change should be doable to other switchdev users, like Rocker.

Note: I send this as an RFC since I am not really sure about the attribute
flags, and the exact place to set it in del_nbp(). Comments needed :-)

Thanks,

Vivien Didelot (2):
  net: bridge: add switchdev attr for port bridging
  net: dsa: support SWITCHDEV_ATTR_ID_PORT_BRIDGE_IF

 include/net/switchdev.h |   2 +
 net/bridge/br_if.c      |  27 ++++++++++++
 net/dsa/dsa.c           |   7 ---
 net/dsa/dsa_priv.h      |   2 -
 net/dsa/slave.c         | 113 +++++++++++++-----------------------------------
 5 files changed, 59 insertions(+), 92 deletions(-)

-- 
2.7.2

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

end of thread, other threads:[~2016-03-09 22:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09 17:42 [RFC PATCH net-next 0/2] net: switchdev: add attribute for port bridging Vivien Didelot
2016-03-09 17:42 ` [RFC PATCH net-next 1/2] net: bridge: add switchdev attr " Vivien Didelot
2016-03-09 19:26   ` Sergei Shtylyov
2016-03-09 21:42   ` Ido Schimmel
2016-03-09 22:58     ` Vivien Didelot
2016-03-09 17:42 ` [RFC PATCH net-next 2/2] net: dsa: support SWITCHDEV_ATTR_ID_PORT_BRIDGE_IF Vivien Didelot
2016-03-09 18:32   ` Andrew Lunn
2016-03-09 19:24     ` Jiri Pirko
2016-03-09 22:15       ` Vivien Didelot
2016-03-09 19:32     ` Vivien Didelot
2016-03-09 20:07       ` Andrew Lunn

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