lkml.org 
[lkml]   [2016]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC PATCH net-next 0/2] net: switchdev: add attribute for port bridging
Date
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

\
 
 \ /
  Last update: 2016-03-09 19:21    [W:0.053 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site