Re: [PATCH net-next] rocker: check for BRIDGE_FLAGS_SELF in bridge setlink handler
From: Roopa Prabhu <hidden>
Date: 2015-03-09 23:23:47
sorry, this email might have gone with non-text (though i selected 'plain text' in my google mail web client). Retrying...apologize for multiple emails. On Mon, Mar 9, 2015 at 3:56 PM, Roopa Prabhu [off-list ref] wrote:
On Mon, Mar 9, 2015 at 8:59 AM, Arad, Ronen [off-list ref] wrote:quoted
quoted
-----Original Message----- From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Jiri Pirkoquoted
I also think that is is fine that in case either master or self are not set, driver ndo setlink is called as well (in case the offload bit is on). It makes it transparent for user in case he does not care what in under. In case he cares, he can specify master or self to achieve exactly what he needs. I like it that way.It would be nice to have switch driver implementation that could work Consistently with and without the bridge driver. I expect use case where a bridge is only used when L3 is needed or to leverage L2 protocols that are implemented by the bridge driver (e.g. STP, IGMP snooping).quoted
If my driver can process setlink requests using SELF flag today, I'd like it to work the same when setlink is propagated down from a bridge master or from a team/bond master.quoted
There is current issue with notification. When SELF flag is set, the bridge driver does not offload to the port driver and notification is issued by rtnetlink.c by calling the port getlink ndo.quoted
This call, however, is done with zero filter_mask such that VLAN information is not included in the notification.quoted
When SELF flag is not set, bridge driver offloads to the port and issues the notification. In that case it sets the filter to VLAN_COMPRESSED. I don't see how I can get my driver to behave consistently with and without a bridge. The closest I can get notification with and without a bridge is for the driver to examine the flags. If SELF is set, the driver knows it got invoked directly from rtnetlink and it should notify VLAN setting as the subsequent notification triggered by rtnetlink won't. When the switch driver does not see SELF set it knows that it was invoked by The bridge driver which already takes care of notification including VLAN information.You are right about self being handled from rtnetlink.c and the notification triggered from rtnetlink.c can be different from the one sent from the bridge driver. In the specific case of vlan information not being present in the self notifications generated from rtnetlink.c, that is something that will need to be fixed eventually. Since rtnetlink.c generates these notifications and not the port driver, like you say, port driver could generate the appropriate notification or rtnetlink.c will have to get the size of the skb from the port driver before doing a bridge_getlink call into the port driver. This is another good example, where the port driver might need to look at the self flag after-all. Thanks, Roopa