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=-6.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 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 E366EC43381 for ; Wed, 20 Feb 2019 20:56:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2CFB2089F for ; Wed, 20 Feb 2019 20:56:10 +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="YC1iUse0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726323AbfBTU4J (ORCPT ); Wed, 20 Feb 2019 15:56:09 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:36630 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726003AbfBTU4J (ORCPT ); Wed, 20 Feb 2019 15:56:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=GoToRvqCj2pAFX7RYPDCi7dnkqmQE6SJ3hgsAAOqZOo=; b=YC1iUse0LNaF0Z4085Joz+kagw l4ONK16WAhCBoaDNEt7KKbB0q1u0teSZ5H8VlYQvV5ydFBvdQrAqfTkstkdnR8fatV+vdAVzwzHJK wkL5dymVxKtEs8+wv5rCqu3o0dnhq71JXNxvOQvGzRLGMAIjFLubRO74gWrsYrz9a7+7OaRw1J/oM p+ZgDOpUewt4ofBhEXww6phklxr8UyqIOJhi/lr/v5wkD2Ulb/JDXsdgMFfCAJoH3SxSWn3J2+TP/ sdhnCTIhx3loekoPBFWA5J3krpEaDQW0qOve1qeyj8wCSUdTJkUY6QnLWRQUUCw4fu3aq7qlmi4GD lxQfnXHQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2001:4d48:ad52:3201:222:68ff:fe15:37dd]:42822 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gwYuO-0006Kq-DA; Wed, 20 Feb 2019 20:56:00 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1gwYuN-0001as-7s; Wed, 20 Feb 2019 20:55:59 +0000 In-Reply-To: <20190220205525.nji63ntsthxbus4l@shell.armlinux.org.uk> References: <20190220205525.nji63ntsthxbus4l@shell.armlinux.org.uk> From: Russell King To: Andrew Lunn , Florian Fainelli , Vivien Didelot Cc: Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH net-next v4 2/3] net: dsa: mv88e6xxx: add support for bridge flags MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Date: Wed, 20 Feb 2019 20:55:59 +0000 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add support for the bridge flags to Marvell 88e6xxx bridges, allowing the multicast and unicast flood properties to be controlled. These can be controlled on a per-port basis via commands such as: bridge link set dev lan1 flood on|off bridge link set dev lan1 mcast_flood on|off Signed-off-by: Russell King --- drivers/net/dsa/mv88e6xxx/chip.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 32e7af5caa69..cc7ce06b6d58 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -4692,6 +4692,22 @@ static int mv88e6xxx_port_mdb_del(struct dsa_switch *ds, int port, return err; } +static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, + bool unicast, bool multicast) +{ + struct mv88e6xxx_chip *chip = ds->priv; + int err = -EOPNOTSUPP; + + mutex_lock(&chip->reg_lock); + if (chip->info->ops->port_set_egress_floods) + err = chip->info->ops->port_set_egress_floods(chip, port, + unicast, + multicast); + mutex_unlock(&chip->reg_lock); + + return err; +} + static const struct dsa_switch_ops mv88e6xxx_switch_ops = { #if IS_ENABLED(CONFIG_NET_DSA_LEGACY) .probe = mv88e6xxx_drv_probe, @@ -4719,6 +4735,7 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = { .set_ageing_time = mv88e6xxx_set_ageing_time, .port_bridge_join = mv88e6xxx_port_bridge_join, .port_bridge_leave = mv88e6xxx_port_bridge_leave, + .port_egress_floods = mv88e6xxx_port_egress_floods, .port_stp_state_set = mv88e6xxx_port_stp_state_set, .port_fast_age = mv88e6xxx_port_fast_age, .port_vlan_filtering = mv88e6xxx_port_vlan_filtering, -- 2.7.4