From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,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 15213C43381 for ; Wed, 20 Feb 2019 23:23:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE42D2147A for ; Wed, 20 Feb 2019 23:23:18 +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="JXt0IEm1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726163AbfBTXXR (ORCPT ); Wed, 20 Feb 2019 18:23:17 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:38258 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726003AbfBTXXR (ORCPT ); Wed, 20 Feb 2019 18:23:17 -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=+P70eUOkr1lQialypyDUeyQ7EXoseN3hK0odKECOdqY=; b=JXt0IEm1mqvu80rluZT7nxUGH Y9SlHfg9NHOYNWtLzdxyU2XDAfpfEYjB3Ld6eukUj0sh3uY7jjsFCMwLURUVEzLLpv+55vCEsobMz Ifu1+MXjXITa/B2sTUt+J0IQZpnG9xFNOKHYgHpKCIqCcxGes0kNVLCCpcYXxsl4K8lj2ETZtI9e8 Jm2o+sVtIjfpvAzWLWJ2bsrUT2ybyu3Xam3iVDLa+/o/z5Ixqlrtex4n1b/J5uFY3AbrhfEepeX6F 96RR2d5loy+0lnfAH23/914gdOyaAZbuMfdT7wGjOYcmtEslFAmqC2bsWtwFARS4vSbJfokByPll9 BdP3xL4xQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51280) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gwbCq-000708-CH; Wed, 20 Feb 2019 23:23:12 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1gwbCo-0000me-GU; Wed, 20 Feb 2019 23:23:10 +0000 Date: Wed, 20 Feb 2019 23:23:10 +0000 From: Russell King - ARM Linux admin To: Florian Fainelli Cc: Andrew Lunn , Vivien Didelot , Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org Subject: Re: [PATCH net-next v4 1/3] net: dsa: add support for bridge flags Message-ID: <20190220232310.samms66y6lnrgrdz@shell.armlinux.org.uk> References: <20190220205525.nji63ntsthxbus4l@shell.armlinux.org.uk> <6542d026-5c68-56fe-a0c5-47f7a1e2f0fa@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6542d026-5c68-56fe-a0c5-47f7a1e2f0fa@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Florian, Please take over these patches. Thanks. On Wed, Feb 20, 2019 at 03:18:44PM -0800, Florian Fainelli wrote: > On 2/20/19 12:55 PM, Russell King wrote: > > The Linux bridge implementation allows various properties of the bridge > > to be controlled, such as flooding unknown unicast and multicast frames. > > This patch adds the necessary DSA infrastructure to allow the Linux > > bridge support to control these properties for DSA switches. > > > > Reviewed-by: Vivien Didelot > > Signed-off-by: Russell King > > --- > > include/net/dsa.h | 2 ++ > > net/dsa/dsa_priv.h | 2 ++ > > net/dsa/port.c | 17 +++++++++++++++++ > > net/dsa/slave.c | 6 ++++++ > > 4 files changed, 27 insertions(+) > > > > diff --git a/include/net/dsa.h b/include/net/dsa.h > > index 7f2a668ef2cc..2c2c10812814 100644 > > --- a/include/net/dsa.h > > +++ b/include/net/dsa.h > > @@ -400,6 +400,8 @@ struct dsa_switch_ops { > > void (*port_stp_state_set)(struct dsa_switch *ds, int port, > > u8 state); > > void (*port_fast_age)(struct dsa_switch *ds, int port); > > + int (*port_egress_floods)(struct dsa_switch *ds, int port, > > + bool unicast, bool multicast); > > > > /* > > * VLAN support > > diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h > > index 1f4972dab9f2..f4f99ec29f5d 100644 > > --- a/net/dsa/dsa_priv.h > > +++ b/net/dsa/dsa_priv.h > > @@ -160,6 +160,8 @@ int dsa_port_mdb_add(const struct dsa_port *dp, > > struct switchdev_trans *trans); > > int dsa_port_mdb_del(const struct dsa_port *dp, > > const struct switchdev_obj_port_mdb *mdb); > > +int dsa_port_bridge_flags(const struct dsa_port *dp, unsigned long flags, > > + struct switchdev_trans *trans); > > int dsa_port_vlan_add(struct dsa_port *dp, > > const struct switchdev_obj_port_vlan *vlan, > > struct switchdev_trans *trans); > > diff --git a/net/dsa/port.c b/net/dsa/port.c > > index 2d7e01b23572..6df29bddf37e 100644 > > --- a/net/dsa/port.c > > +++ b/net/dsa/port.c > > @@ -177,6 +177,23 @@ int dsa_port_ageing_time(struct dsa_port *dp, clock_t ageing_clock, > > return dsa_port_notify(dp, DSA_NOTIFIER_AGEING_TIME, &info); > > } > > > > +int dsa_port_bridge_flags(const struct dsa_port *dp, unsigned long flags, > > + struct switchdev_trans *trans) > > +{ > > + struct dsa_switch *ds = dp->ds; > > + int port = dp->index; > > + int err = 0; > > + > > + if (switchdev_trans_ph_prepare(trans)) > > + return 0; > > + > > + if (ds->ops->port_egress_floods) > > + err = ds->ops->port_egress_floods(ds, port, flags & BR_FLOOD, > > + flags & BR_MCAST_FLOOD); > > + > > + return err; > > +} > > + > > int dsa_port_fdb_add(struct dsa_port *dp, const unsigned char *addr, > > u16 vid) > > { > > diff --git a/net/dsa/slave.c b/net/dsa/slave.c > > index 2e5e7c04821b..f99161c3b1ea 100644 > > --- a/net/dsa/slave.c > > +++ b/net/dsa/slave.c > > @@ -295,6 +295,9 @@ static int dsa_slave_port_attr_set(struct net_device *dev, > > case SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME: > > ret = dsa_port_ageing_time(dp, attr->u.ageing_time, trans); > > break; > > + case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: > > + ret = dsa_port_bridge_flags(dp, attr->u.brport_flags, trans); > > + break; > > default: > > ret = -EOPNOTSUPP; > > break; > > @@ -384,6 +387,9 @@ static int dsa_slave_port_attr_get(struct net_device *dev, > > switch (attr->id) { > > case SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS_SUPPORT: > > attr->u.brport_flags_support = 0; > > + if (ds->ops->port_egress_floods) > > + attr->u.brport_flags_support |= BR_FLOOD | > > + BR_MCAST_FLOOD; > > There is no struct dsa_switch *ds = dp->ds that is being declared in > dsa_slave_port_attr_get(): > > net/dsa/slave.c: In function 'dsa_slave_port_attr_get': > net/dsa/slave.c:390:7: error: 'ds' undeclared (first use in this function) > if (ds->ops->port_egress_floods) > ^~ > net/dsa/slave.c:390:7: note: each undeclared identifier is reported only > once for each function it appears in > scripts/Makefile.build:276: recipe for target 'net/dsa/slave.o' failed > make[4]: *** [net/dsa/slave.o] Error 1 > scripts/Makefile.build:492: recipe for target 'net/dsa' failed > make[3]: *** [net/dsa] Error 2 > make[3]: *** Waiting for unfinished jobs.... > > -- > Florian > -- 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