From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@savoirfairelinux.com,
"David S. Miller" <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>,
Scott Feldman <sfeldma@gmail.com>, Jiri Pirko <jiri@resnulli.us>,
Ido Schimmel <idosch@mellanox.com>,
nikolay@cumulusnetworks.com, Elad Raz <eladr@mellanox.com>
Subject: Re: [RFC PATCH net-next 2/2] net: dsa: support SWITCHDEV_ATTR_ID_PORT_BRIDGE_IF
Date: Wed, 09 Mar 2016 14:32:05 -0500 [thread overview]
Message-ID: <87h9gfo3be.fsf@ketchup.mtl.sfl> (raw)
In-Reply-To: <20160309183213.GA18196@lunn.ch>
Hi Andrew,
Andrew Lunn <andrew@lunn.ch> writes:
>> -static bool dsa_slave_dev_check(struct net_device *dev)
>> -{
>> - return dev->netdev_ops == &dsa_slave_netdev_ops;
>> -}
>
> Where is the equivalent of this happening? Where do we check that the
> interface added to the bridge is part of the switch?
Why should we check that? In this RFC, br_if.c tries to set the new
attribute to the net_device, when creating and deleting the net bridge
port. If it supports attr_set and this attribute, then we're good. Or am
I missing something?
>> -int dsa_slave_netdevice_event(struct notifier_block *unused,
>> - unsigned long event, void *ptr)
>> -{
>> - struct net_device *dev;
>> - int err = 0;
>> -
>> - switch (event) {
>> - case NETDEV_CHANGEUPPER:
>> - dev = netdev_notifier_info_to_dev(ptr);
>> - if (!dsa_slave_dev_check(dev))
>> - goto out;
>> -
>> - err = dsa_slave_master_changed(dev);
>> - if (err && err != -EOPNOTSUPP)
>> - netdev_warn(dev, "failed to reflect master change\n");
>> -
>> - break;
>> - }
>> -
>> -out:
>> - return NOTIFY_DONE;
>> -}
>
> How about team/bonding? We are not ready to implement it yet with the
> Marvell devices, but at some point we probably will. Won't we need the
> events then? We need to know when a switch port has been added to a
> team?
>
> Or do you think a switchdev object will be added for this case?
> Mellanox already have the ability to add switch interfaces to a team,
> and then add the team to a bridge. So we need to ensure your solution
> works for such stacked systems.
Indeed these features can be propagated through new switchdev attributes
or objects.
I think it'd be preferable to factorize the switch related operations
into the switchdev API, instead of having every single switchdev user
implement its custom (but similar) listeners and checks for global
netdev events. What do you think?
Best,
Vivien
next prev parent reply other threads:[~2016-03-09 19:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2016-03-09 20:07 ` Andrew Lunn
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=87h9gfo3be.fsf@ketchup.mtl.sfl \
--to=vivien.didelot@savoirfairelinux.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=eladr@mellanox.com \
--cc=f.fainelli@gmail.com \
--cc=idosch@mellanox.com \
--cc=jiri@resnulli.us \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox