Thread (35 messages) 35 messages, 5 authors, 2014-11-28

Re: [patch net-next v4 14/21] bridge: add brport flags to dflt bridge_getlink

From: Scott Feldman <hidden>
Date: 2014-11-27 20:46:25

On Thu, Nov 27, 2014 at 3:17 AM, Jamal Hadi Salim [off-list ref] wrote:
On 11/27/14 05:40, Jiri Pirko wrote:
quoted
From: Scott Feldman <redacted>

To allow brport device to return current brport flags set on port.  Add
returned flags to nested IFLA_PROTINFO netlink msg built in dflt getlink.
With this change, netlink msg returned for bridge_getlink contains the
port's
offloaded flag settings (the port's SELF settings).

Am i missing something or we already have this stuff showing up in user
space today?
For RTM_GETLINK, rtnl_bridge_getlink() calls ndo_bridge_getlink twice
for each dev, once on bridge and second time on dev.  Each call adds
an RTM_NEWLINK to skb.  For the ndo_bridge_getlink() call to bridge,
the MASTER port flags are filled in using br_port_fill_attr().  For
the second ndo_bridge_getlink() call to dev, the port driver calls
ndo_dflt_bridge_getlink() which fills in the SELF port flags.  Before
this patch, ndo_dflt_bridge_getlink() was only filling in hwmode.

Whew, in any case, I think you'll agree this code needs a refactoring
down the road.  This change is just the bare minimum building on
what's there to get SELF port flags up to user-space.  A refactoring
effort should get the port drivers out of parsing/filling netlink msg
and leave that to the core code in rtnetlink.c.  That way we can have
one place for policy checks and one place for fill.  I think this
refactoring effort should be left out in this patch series, otherwise
this is going to drag on into the next year.
cheers,
jamal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help