From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ySQs/bUrDiTXrbAw1rcoAwSp8NINSHA8BKI1E9gDSMc=; b=ZPgTOhUWUmB14eeEZokD8KQf4APDXMsP7Bm7zcBbwWSKmhHylXKsVx0ilbDaGF32sr 4Pnyx6vpgzo6qXW8cJD1mUkICvbD0dU8GPhFDIQTCpvr3UbkvdIjqAd7KGn7fwt0xbKv fMvL6VBhrW077N/ocwMZEkwT5E2jUZ4ag29qCubKsuiEpg3XXJQPPBP7DP40sOoMBWSg LudXJQp6xgApRIy6TMo0MCojoSF7TNrrHBiTfxu8liMTFHfP/ytQegEKfrz0YqErPKf2 dKAvcvx6PHS5F7VRB3aJwEbgf1B1p7oMxQ+vdsl7sBhRIhAAj83j8RDk0rPinI4oBWBw oV9Q== References: <20210210091445.741269-1-olteanv@gmail.com> <20210210091445.741269-7-olteanv@gmail.com> From: Florian Fainelli Message-ID: Date: Wed, 10 Feb 2021 20:18:27 -0800 MIME-Version: 1.0 In-Reply-To: <20210210091445.741269-7-olteanv@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Bridge] [PATCH v3 net-next 06/11] net: dsa: kill .port_egress_floods overengineering List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Oltean , Jakub Kicinski , "David S. Miller" Cc: Ivan Vecera , Andrew Lunn , Alexandre Belloni , Grygorii Strashko , Jiri Pirko , Vadym Kochan , netdev@vger.kernel.org, bridge@lists.linux-foundation.org, Ioana Ciornei , linux-kernel@vger.kernel.org, UNGLinuxDriver@microchip.com, Taras Chornyi , Ido Schimmel , Claudiu Manoil , Nikolay Aleksandrov , Roopa Prabhu , linux-omap@vger.kernel.org, Vivien Didelot On 2/10/2021 1:14 AM, Vladimir Oltean wrote: > From: Vladimir Oltean > > The bridge offloads the port flags through a single bit mask using > switchdev, which among others, contains learning and flooding settings. > > The commit 57652796aa97 ("net: dsa: add support for bridge flags") > missed one crucial aspect of the SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS API > when designing the API one level lower, towards the drivers. > This is that the bitmask of passed brport flags never has more than one > bit set at a time. On the other hand, the prototype passed to the driver > is .port_egress_floods(int port, bool unicast, bool multicast), which > configures two flags at a time. > > DSA currently checks if .port_egress_floods is implemented, and if it > is, reports both BR_FLOOD and BR_MCAST_FLOOD as supported. So the driver > has no choice if it wants to inform the bridge that, for example, it > can't configure unicast flooding independently of multicast flooding - > the DSA mid layer is standing in the way. Or the other way around: a new > driver wants to start configuring BR_BCAST_FLOOD separately, but what do > we do with the rest, which only support unicast and multicast flooding? > Do we report broadcast flooding configuration as supported for those > too, and silently do nothing? > > Secondly, currently DSA deems the driver too dumb to deserve knowing that > a SWITCHDEV_ATTR_ID_BRIDGE_MROUTER attribute was offloaded, because it > just calls .port_egress_floods for the CPU port. When we'll add support > for the plain SWITCHDEV_ATTR_ID_PORT_MROUTER, that will become a real > problem because the flood settings will need to be held statefully in > the DSA middle layer, otherwise changing the mrouter port attribute will > impact the flooding attribute. And that's _assuming_ that the underlying > hardware doesn't have anything else to do when a multicast router > attaches to a port than flood unknown traffic to it. If it does, there > will need to be a dedicated .port_set_mrouter anyway. > > Lastly, we have DSA drivers that have a backlink into a pure switchdev > driver (felix -> ocelot). It seems reasonable that the other switchdev > drivers should not have to suffer from the oddities of DSA overengineering, > so keeping DSA a pass-through layer makes more sense there. > > To simplify the brport flags situation we just delete .port_egress_floods > and we introduce a simple .port_bridge_flags which is passed to the > driver. Also, the logic from dsa_port_mrouter is removed and a > .port_set_mrouter is created. > > Functionally speaking, we simply move the calls to .port_egress_floods > one step lower, in the two drivers that implement it: mv88e6xxx and b53, > so things should work just as before. > > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli -- Florian