Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AC7AC43381 for ; Tue, 19 Feb 2019 16:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 399682147A for ; Tue, 19 Feb 2019 16:24:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="zWvaumsG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727956AbfBSQYn (ORCPT ); Tue, 19 Feb 2019 11:24:43 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:45100 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbfBSQYm (ORCPT ); Tue, 19 Feb 2019 11:24:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1tsJT5v/Zt1LEYKxBhLqfCTvQVSVxCVHwFyiJQ/r+l4=; b=zWvaumsG4NjAXOh7164Kze9sI emIEd8B2PsDMhSvnv/KhNhqrXWXBlywS7d0Hrx46Sf7U8M1iWaaw/VFc15LkV4H+DpHKC966MfMjU onrCON7GYa8QZRYHSDTSxbYDYTA91FCjw8V3LWKDELbxwKJwkpWvc4KBi0rXzP2UtafyBKgg1Cvcv pVUrD8z9KbAHZOAQuSnycNmRdKDgdMMrhhcz0qIJCbc8/ZHnj3+hpUJDsf2qpwcfQdYdX62zruSaj V8x8rpX/iOsjnQEAm49Rs7PTwh5n187H1j3hi+oIpQNdhqRsGxPK4lhWhFp8c7zPqDbWGJ0QdYMq/ mutm6EC5w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51234) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gw8CD-0006ge-7m; Tue, 19 Feb 2019 16:24:37 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1gw8CB-00088K-EL; Tue, 19 Feb 2019 16:24:35 +0000 Date: Tue, 19 Feb 2019 16:24:35 +0000 From: Russell King - ARM Linux admin To: Vivien Didelot Cc: Andrew Lunn , Florian Fainelli , Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org Subject: Re: [PATCH net-next v2 2/3] net: dsa: mv88e6xxx: add support for bridge flags Message-ID: <20190219162435.f5zl5harbarwy6bj@shell.armlinux.org.uk> References: <20190217163114.yomawlljyxlqy3ob@shell.armlinux.org.uk> <20190219111612.GF27578@t480s.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190219111612.GF27578@t480s.localdomain> User-Agent: NeoMutt/20170113 (1.7.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Feb 19, 2019 at 11:16:12AM -0500, Vivien Didelot wrote: > Hi Russell, > > On Sun, 17 Feb 2019 16:32:34 +0000, Russell King wrote: > > +static int mv88e6xxx_port_bridge_flags(struct dsa_switch *ds, int port, > > + unsigned long flags) > > +{ > > + struct mv88e6xxx_chip *chip = ds->priv; > > + bool unicast, multicast; > > + int ret = -EOPNOTSUPP; > > + > > + unicast = dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port) || > > + flags & BR_FLOOD; > > + multicast = flags & BR_MCAST_FLOOD; > > + > > + mutex_lock(&chip->reg_lock); > > + if (chip->info->ops->port_set_egress_floods) > > + ret = chip->info->ops->port_set_egress_floods(chip, port, > > + unicast, > > + multicast); > > + mutex_unlock(&chip->reg_lock); > > + > > + return ret; > > +} > > + > > +static unsigned long mv88e6xxx_bridge_flags_support(struct dsa_switch *ds) > > +{ > > + struct mv88e6xxx_chip *chip = ds->priv; > > + unsigned long support = 0; > > + > > + if (chip->info->ops->port_set_egress_floods) > > + support |= BR_FLOOD | BR_MCAST_FLOOD; > > + > > + return support; > > +} > > I think that it isn't necessary to propagate the notion of bridge flags down > to the DSA drivers. It might be just enough to add: > > port_egress_flood(dsa_switch *ds, int port, bool uc, bool mc) > > to dsa_switch_ops and set BR_FLOOD | BR_MCAST_FLOOD from the DSA core, > if the targeted driver has ds->ops->port_set_egress_flood. What do you think? There are two other flags that I haven't covered which the bridge code expects to be offloaded, and those are the broadcast flood flag and the learning flag. I know that the Marvell switches don't have a bit to control the broadcast flooding, that appears to be controlled via a static entry in the ATU which would have to be modified as the broadcast flood flag is manipulated. I don't know how that is handled in other bridges. Do we want to include the broadcast flood in the above prototype? If we go for this, how do we detect which options a switch supports? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up