Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3154954ybl; Sun, 25 Aug 2019 09:35:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfpPjsgiDLU5Dxe1Zv50dgEri4w8gOuwLQIQtSOUTrI67u0ZRfvpr0CKcDkYVEwAMdaCyD X-Received: by 2002:a65:614a:: with SMTP id o10mr12520475pgv.407.1566750948061; Sun, 25 Aug 2019 09:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566750948; cv=none; d=google.com; s=arc-20160816; b=SzZ9dawE57qWZ5BGc8L/z/rqj/KNZ5HObrjIFU2tukdhJyrKXPGb+DTvZeAs0pRLJh mQiBF11YDxEHhkTlJTlDn2lnb+Np0NRrBE+gpLK9khe5q5JA4Enn+B610hrzrEOzj8jD cGwUCWejRJ3ln/DySk6m4z+IxU+B8dcHf2EXFp4QYAcX+yTm5HDP4lsfShXQrXHOcypa tvhf0rfWDL0F7Gsu6/rI3ZY/d9rT5Vjob/5GzPmOEOh3hQnFtRnVlKdTP4+GOmSjwDXi 8+JOQdU/qlR3FKSWEoKiw/g+lxelN6oybXjyyByUxCwhPoxg4Ri/QNQRazRWsK9CHy4s NU6w== 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:ironport-sdr; bh=SLYlruxcnEU6cegtkkBVb0M+3f60eRbB6cJDRDN5tB4=; b=Kl2aW2dO3WCs/o2kqU70vIGmzj1jOB6pvI+whJfMaoBqSmWuhDVRzgSM0rJ/9PV6Sr 2ZQ5tpBEJQkvEYA6S5HbATpUgsEdrUd4ZogwMbs6szPbc0q0iUV+G8m82FTF41a9A6sz kMkOzf/xM/IK6MT+emZd+uJ1Sn6i59VQD46BlwHKpW+Ky5N7K5uGiEJn+bsxW1EO9c2I nHIGg9tuWzVccK1i4BiogWR3yhbywnRKopvlFIpq/0CgfQqm6AI/ZAzEUodTmlWx+AB7 G3VXugt0mjdiKrkfH/+KBE2D/DN+Vtzf11VavDLTCwfBECVwlP3EYL2cX0GbdL9KCTOe LXLw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15si6631537pgy.517.2019.08.25.09.35.22; Sun, 25 Aug 2019 09:35:48 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728456AbfHYQaf (ORCPT + 99 others); Sun, 25 Aug 2019 12:30:35 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:43027 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728382AbfHYQaf (ORCPT ); Sun, 25 Aug 2019 12:30:35 -0400 Received-SPF: Pass (esa1.microchip.iphmx.com: domain of Horatiu.Vultur@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Horatiu.Vultur@microchip.com"; x-sender="Horatiu.Vultur@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com a:mx1.microchip.iphmx.com a:mx2.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa1.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa1.microchip.iphmx.com; envelope-from="Horatiu.Vultur@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa1.microchip.iphmx.com; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=Horatiu.Vultur@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: 3X9lT3fgRWqEy3ymSwR6mZoLl1PqtNc7RMtkjEPM6qHhPwoSFMxwHQyCe4o1YO8WbbAbjSs+nx YJFoO5TEaHl6E46Fs46i0TiHmLvnUpLOZovdNYjwUOH1V7l1vJLWi+1Ummg0apzITBESTrkA7R MDOb/OqPwMOOHf4yrdRrdS8bbSYMVZKd0L79NRW7lQ9O+dLsKRk9b3bX8Czfdf+rgHPSlhNCZd fBvvUXPfwT5r/ff0zsMZq1vl5rvChSIbeYGNXG9Ao+9FrB+Gj2Q/BxXTJIyDCmxoNia2uZtsAf dvI= X-IronPort-AV: E=Sophos;i="5.64,429,1559545200"; d="scan'208";a="47898997" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Aug 2019 09:30:26 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 25 Aug 2019 09:30:25 -0700 Received: from localhost (10.10.85.251) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Sun, 25 Aug 2019 09:30:25 -0700 Date: Sun, 25 Aug 2019 18:30:25 +0200 From: Horatiu Vultur To: Jiri Pirko CC: Florian Fainelli , , , , , , , , , Subject: Re: [PATCH 0/3] Add NETIF_F_HW_BRIDGE feature Message-ID: <20190825163023.hkc23lv7b5vvphdb@soft-dev3.microsemi.net> References: <1566500850-6247-1-git-send-email-horatiu.vultur@microchip.com> <20190824074204.GA15041@nanopsycho.orion> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20190824074204.GA15041@nanopsycho.orion> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 08/24/2019 09:42, Jiri Pirko wrote: > External E-Mail > > > 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. Yes, but then if you want to monitor all the traffic on a bridge port you will not be able to do that. And this seems to be a limitation. This is the case for mlxsw and ocelot(it doesn't implement at all promisc mode) and might be others. > > 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. What if the HW can copy all the management traffic to the SW bridge and HW knows to learn and flood frames. Then there is no point to set a network port in promisc mode just because it is a bridge port member. > >If this is suboptimal for you, you can take > >shortcuts in your driver that do not hinder the overall functionality. If I add this check, I don't see how any other network drivers will be affected by this. If a network driver will start to use this then it needs to know that the HW should be configure to include CPU in the flood mask and to know which addresses can be reached through SW bridge. > > > >> 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 > -- /Horatiu