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=-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 770FEC43381 for ; Tue, 19 Feb 2019 22:52:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 177722147A for ; Tue, 19 Feb 2019 22:52:51 +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="SqNBG26R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729708AbfBSWwu (ORCPT ); Tue, 19 Feb 2019 17:52:50 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:49496 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727375AbfBSWwu (ORCPT ); Tue, 19 Feb 2019 17:52:50 -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=eKnEZns/CIsuWT78QFqKAwg8tqTNgIXoFIUKMDUM/zA=; b=SqNBG26Ru74FGFnh8oHXlQBFB xVRuum4B+DeG6PTKmTbXGN3akp8IMeBMaSllx7nwORL5WQhH5uK3tEo381qaq+VYryA+eYSD0JjXL MBTxu7Rp0V6crXKCUM8d+Jc9Qr8lQ9ijZg9t2+vqysJ7+AkHFrrvVLyokjQvcl0hFamFE6Evmt56n M+XojsZWXIXrNLHiiYtWgYpkH/DPPg1EKG6A7jtHe1IZFLHFqWzVAnzWf98ftErlmeFOQFGM9txxM tDOHYGRpPbrTJkbEzuYD4uetrWQB8ige91hh+HrxzyTG7EvITuqBKKU3FNl/yQ/fraf/D5s2t6+pT vUPKn5ACQ==; Received: from shell.armlinux.org.uk ([2002:4e20:1eda:1:5054:ff:fe00:4ec]:36902) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gwEFn-0008Ra-Dy; Tue, 19 Feb 2019 22:52:43 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.89) (envelope-from ) id 1gwEFg-0008Mi-S1; Tue, 19 Feb 2019 22:52:36 +0000 Date: Tue, 19 Feb 2019 22:52:36 +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: <20190219225236.cdwxso3hwl7q4e3l@shell.armlinux.org.uk> References: <20190219111612.GF27578@t480s.localdomain> <20190219162435.f5zl5harbarwy6bj@shell.armlinux.org.uk> <20190219120000.GB4140@t480s.localdomain> <20190219171414.cvaiw7u2xnd5zk3g@shell.armlinux.org.uk> <20190219123828.GD10959@t480s.localdomain> <20190219180811.qxsu2ss3g7jwhgfb@shell.armlinux.org.uk> <20190219140444.GD16594@t480s.localdomain> <20190219191016.u65vvw5y3iydt5zx@shell.armlinux.org.uk> <20190219145627.GB27596@t480s.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190219145627.GB27596@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 02:56:27PM -0500, Vivien Didelot wrote: > Hi Russell, > > On Tue, 19 Feb 2019 19:10:16 +0000, Russell King - ARM Linux admin wrote: > > > True, let's stick with ops->port_egress_flood(ds, port, bool uc, bool mc). > > > I do not think that it is necessary to add support for BR_BCAST_FLOOD yet, > > > we can extend this routine later if we need to. > > > > > > Your dsa_port_bridge_flags() core function can notify the understood > > > features. This will allow us to scope the support of the bridge flags in > > > the core, and preventing the drivers to do that themselves. > > > > So, if we have ops->port_egress_flood, then we tell bridge that > > we support BR_FLOOD | BR_MCAST_FLOOD, irrespective of whether the > > bridge actually supports both? > > I would say so yes. If a driver implements port_egress_flood(), this means > its switch device supports both BR_FLOOD | BR_MCAST_FLOOD. > > I have one concern though. The documentation of mcast_flood for bridge(8) > says that this flag "controls whether a given port will *be flooded* with > [unknown] multicast traffic". From this I understand allowing this port to > *receive* frames with unknown destination addresses. But with mv88e6xxx, we > program whether the port is allowed to egress a frame that has an unknown > destination address. Otherwise, it will not go out this port. > > Am I mistaken? If I understood correctly, is it safe to assume it is the > same thing we are implementing here? Please look at the net/bridge code to resolve questions such as this. The relevant code is net/bridge/br_forward.c::br_flood(): void br_flood(struct net_bridge *br, struct sk_buff *skb, enum br_pkt_type pkt_type, bool local_rcv, bool local_orig) { ... list_for_each_entry_rcu(p, &br->port_list, list) { /* Do not flood unicast traffic to ports that turn it off, nor * other traffic if flood off, except for traffic we originate */ switch (pkt_type) { case BR_PKT_UNICAST: if (!(p->flags & BR_FLOOD)) continue; break; case BR_PKT_MULTICAST: if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev) continue; break; case BR_PKT_BROADCAST: if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev) continue; break; } ... prev = maybe_deliver(prev, p, skb, local_orig); } So, BR_FLOOD, BR_MCAST_FLOOD and BR_BCAST_FLOOD control whether the packet of type pkt_type being flooded on the bridge egresses from port p, where p is each port attached to the bridge. -- 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