Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1616970ybl; Sat, 24 Aug 2019 00:44:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUDhpLDBsc8ShZZ1XUImovfw/c+/rgk1wYVpdjGs0vVpln3aoeNwWq8AxgmfK9764YuIrS X-Received: by 2002:a17:902:8302:: with SMTP id bd2mr8078018plb.9.1566632647809; Sat, 24 Aug 2019 00:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566632647; cv=none; d=google.com; s=arc-20160816; b=z9Dj+EEairU/Bux5mZNlU7ERS6q3XzEyPQWLvEM/3knjx2vPruDSAPlJ6GA9Pf8dDr XDeqS0h9Tvp9uEex8sxqZH2P1Pz1fn1UaJkeRoVGRBKyG/6Rv//D2cUrW/2s8AsZASBT VemnVq6b9MRwiCoU1bs3t5lCSUPLzJKYs5Xv/1Jk2UXWEaOzmi5OFszF4MC4F/LiHcFs NpAr8i1szC0XjD9S/NIjCDaKNSwgy2Ha0efnd3FO9Var4AZTrvewdYTKWoxv7zhVkiWI X1nRRxEmhJBOEgxqfkFU7xcdr40QL5OUDoAM1Xux5v6+PyW+rRjiTYDXUboX+UA75xJS aUzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ip+/2UFsqnRlpVZ0C6S+KUXKzEwaCh99ektOwnbv38M=; b=xyt2A0zLCLuQpbvt7DFNoRfpKqj+gqvAiclNROfb1tR7mGMHLvxPMM1MIOoSzBgdFW JUCGvo9qsFekAdd9i8g38eF5Zz+hORjlxHnN1Sk80I8DNVidClJuBRTUye6bFJXhaAGJ 9RbGBk6lAWihIEOH8wsHvMYLgsRAhNZhnqFW7FyhL9eWrXjlIZkyCQBeLouOCr+2Sniq O+uNSoVpYzrgDx7kv4eVTdcLXwybE7WPQZ/JHmFiKqn/Fq217s6kh15v1Atn8q58zWu+ fXkqM15LG5+ckRBFHsHXulr/I1lSd01/od5OtQNAdM3iGzhLFd9ZPkIp5He2GATD6gZO V+sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=UuCMpAb1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13si3802692pgf.382.2019.08.24.00.43.51; Sat, 24 Aug 2019 00:44:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=UuCMpAb1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726950AbfHXHmI (ORCPT + 99 others); Sat, 24 Aug 2019 03:42:08 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39185 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726076AbfHXHmI (ORCPT ); Sat, 24 Aug 2019 03:42:08 -0400 Received: by mail-wr1-f65.google.com with SMTP id t16so10562028wra.6 for ; Sat, 24 Aug 2019 00:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ip+/2UFsqnRlpVZ0C6S+KUXKzEwaCh99ektOwnbv38M=; b=UuCMpAb11y8XQBxUDvyzG/sYs6kCsahahng2dlI1Doyc765+ekid3Qe81k/e1RHZUW 65+batFV8m3njiH+RyVaJ6mzjqtRlT76OpnyoWMhIfFga7gmJ14chi300sp2IIpysc3b tBu1Kz5X7ybLQxnrMPqUUkJy0a5oMTurfs9q6DBcGlUhCfxTURPCp66IEYx116QJ2OgP OaUaxYlRk+BIQz+v/Q49UE9WXFRoSHAoxXwFYh9DnSthSp3kBaRiP3ZyodTGamgZ/HTH uDFjluKeCAmm5OTvxdnM9GTHaViSQHxcAoeUSdw+QtfuKNz/X3FKIulLhKa/lA6uxuug Nbag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ip+/2UFsqnRlpVZ0C6S+KUXKzEwaCh99ektOwnbv38M=; b=nYFFfxSMdUt+KYrW1eZsa1M50xjcHCtb0TgzSFGN26UZELfcZ5ht97KZdt1f/RkPME AIrZHDHDD9nevtRlAHjoYG2g9thwx7qj/QsZc/2kZjx5ycVaNkTsd5oSy8qtaIcXhPvI H4TjcmD4mILRsBBB3aZfNxYirYgRT/+qAydkTDaCMdXXpePIitVJOa5RPnWBIuv4d9uR L8YApm2/UjBblzYch0xjRBfiK2upYkIVxK7UmfERJRdwkx0hgThsBmFfhyT2BoioVReS LWn/agAqQ041ca+edKWjPnBMBKAfkPZSpbV9eywWe3eLGLw/OdE1E4UYd1aSO/hEsXd6 ig0Q== X-Gm-Message-State: APjAAAUMC7BIFMddxSKWH6TmTs9mwnFg+Qv6Az/+pVsQ6zqgM1lGS+fg 6hcJHLeA0BugKx6kzLSrjImzSQ== X-Received: by 2002:adf:ba4a:: with SMTP id t10mr9322894wrg.325.1566632526261; Sat, 24 Aug 2019 00:42:06 -0700 (PDT) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id 74sm9736213wma.15.2019.08.24.00.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 00:42:05 -0700 (PDT) Date: Sat, 24 Aug 2019 09:42:05 +0200 From: Jiri Pirko To: Florian Fainelli Cc: Horatiu Vultur , roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com, davem@davemloft.net, UNGLinuxDriver@microchip.com, alexandre.belloni@bootlin.com, allan.nielsen@microchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org Subject: Re: [PATCH 0/3] Add NETIF_F_HW_BRIDGE feature Message-ID: <20190824074204.GA15041@nanopsycho.orion> References: <1566500850-6247-1-git-send-email-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sat, Aug 24, 2019 at 01:25:02AM CEST, f.fainelli@gmail.com wrote: >On 8/22/19 12:07 PM, Horatiu Vultur wrote: >> Current implementation of the SW bridge is setting the interfaces in >> promisc mode when they are added to bridge if learning of the frames is >> enabled. >> In case of Ocelot which has HW capabilities to switch frames, it is not >> needed to set the ports in promisc mode because the HW already capable of >> doing that. Therefore add NETIF_F_HW_BRIDGE feature to indicate that the >> HW has bridge capabilities. Therefore the SW bridge doesn't need to set >> the ports in promisc mode to do the switching. > >Then do not do anything when the ndo_set_rx_mode() for the ocelot >network device is called and indicates that IFF_PROMISC is set and that >your network port is a bridge port member. That is what mlxsw does AFAICT. Correct. > >As other pointed out, the Linux bridge implements a software bridge by >default, and because it needs to operate on a wide variety of network >devices, all with different capabilities, the easiest way to make sure >that all management (IGMP, BPDU, etc. ) as well as non-management >traffic can make it to the bridge ports, is to put the network devices >in promiscuous mode. If this is suboptimal for you, you can take >shortcuts in your driver that do not hinder the overall functionality. > >> This optimization takes places only if all the interfaces that are part >> of the bridge have this flag and have the same network driver. >> >> If the bridge interfaces is added in promisc mode then also the ports part >> of the bridge are set in promisc mode. >> >> Horatiu Vultur (3): >> net: Add HW_BRIDGE offload feature >> net: mscc: Use NETIF_F_HW_BRIDGE >> net: mscc: Implement promisc mode. >> >> drivers/net/ethernet/mscc/ocelot.c | 26 ++++++++++++++++++++++++-- >> include/linux/netdev_features.h | 3 +++ >> net/bridge/br_if.c | 29 ++++++++++++++++++++++++++++- >> net/core/ethtool.c | 1 + >> 4 files changed, 56 insertions(+), 3 deletions(-) >> > > >-- >Florian