Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp342954ybl; Fri, 23 Aug 2019 01:33:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQ9bz4tp3ojpFTVGDUa9kKldcd3u34Pi8YC/RgGwBuHcengnmyNqyFMe9nZiQp1ZH+lf4U X-Received: by 2002:a17:902:20e3:: with SMTP id v32mr3267108plg.142.1566549199163; Fri, 23 Aug 2019 01:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566549199; cv=none; d=google.com; s=arc-20160816; b=oyHO7O0zMmkLP3NijShZ52f5ejfMYZ3MWF0m2A84ar718n8avfiEdwZ6uIwM7Fc+cz 80K10bB/9wGHHv/qBmKfGXwg+0ntWgSAH5+WmVRZ92b8wetWm0T+6n83vzz/c2XCtZuQ XJVnbRwnUj/I5G8UzJAjEm3CewtgUGE8Ud8tG+syberpmKBUMsVKp2XxZjiM3v1OIlD6 kr27xfq4/nakWNJML+XsLmFIDA38PW818HtProGCidI5b/glJZKZFN17pQ3f+DLROaOZ rVC5UbJOKGXfF98s1Rq8WU9uZjBuQfBOm+x1XTIyM+apu1w1V4rUbNdIbgK2TcFwibEC vj2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=M+oIdnD3jm/q0FEoEMnIGzoD27Ik3dMH4NYQUO8iSBo=; b=KudCpKCFMjOgWW+owmduaXXnUqcV/XCKmNx09OSiB780HUbujhw0hZMnyYxf5BYQmF S6QsXqPMkoKhJVMSWWiygv3pi8z13jfoNoPZouBPaLAhLdo4X4GpxU9BDimfSoS0BFWV gctSlrm7G2nRBIopOGtGHTGi/tYXikvhRCr9Pow9MnfEWHGQuU325d/fYYEbxafWSd0Z Oh08R/k+zwsqHVtH48tl7whYWxpmeV3+bDxt5Ji2RaKmmMRVK4pQOHwXAaLNiwKcIZwO ULPFcv+wU7ScUOhqQqzcLagg+2QnjRLjN1nN1a3a9eeXoQ0DPTQHhyIw7IIDbICo0m6K dV3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cumulusnetworks.com header.s=google header.b=ZI42VLIf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=cumulusnetworks.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si1902802plb.293.2019.08.23.01.33.03; Fri, 23 Aug 2019 01:33:19 -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=@cumulusnetworks.com header.s=google header.b=ZI42VLIf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=cumulusnetworks.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393846AbfHVWJy (ORCPT + 99 others); Thu, 22 Aug 2019 18:09:54 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45299 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390311AbfHVWJy (ORCPT ); Thu, 22 Aug 2019 18:09:54 -0400 Received: by mail-wr1-f66.google.com with SMTP id q12so6772718wrj.12 for ; Thu, 22 Aug 2019 15:09:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=M+oIdnD3jm/q0FEoEMnIGzoD27Ik3dMH4NYQUO8iSBo=; b=ZI42VLIf3XR0ok5i+0x5WISOnHyGwIZxT87RAf5JOkT72TxGxOM5SLOZYlrOMK2Lz0 /pMXLKJ9Bp6o+JdDPyTNehpyrMiXLKq/THe45t1S8Y9iG0NX2rg/tiUPjo6oBHCdZUgS H9MYSXYdU+sMDcOmye0Qxn0PQG2F3X8yS+ekQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=M+oIdnD3jm/q0FEoEMnIGzoD27Ik3dMH4NYQUO8iSBo=; b=niHCT8aBUBDC4UDbDUaojGezmmIe6kS5UbkMyUBLD5rEueQKZX5BNzUBk+AV2CBG9A cwuGV8kjYx4gUHkqBRI5mkY9HzlReykd1Ms6c3jfWUW0rWYcGw53xIJdWaHm7eANkcm3 +BOBErcK/tErKMb3RdMWZf+kwGI9QRcALChVKK04zyDLSL0pzS8mt/MPD6uyPKpRHdCf dnailchxeNzMioz15kd7bRR8mM5nYHDuSqzBriVAUCJqYjcg8K5E+hv7kPHEsho/w8Ly CUiQ07FPweM8IyljFsvx0R5vq/8XY0lYl5onZpYHgp/KGatnX5FrsTXhS9d7KEVis3rh 19oQ== X-Gm-Message-State: APjAAAWT6GjSjSioNsyQrofy04mSzOgoWxQaxUsYlSihr1y+3v+IX62T qwr+XZkkqZPzhajZweba5U7sVA== X-Received: by 2002:adf:e504:: with SMTP id j4mr1064839wrm.222.1566511792353; Thu, 22 Aug 2019 15:09:52 -0700 (PDT) Received: from [192.168.0.107] (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id c11sm590230wrs.86.2019.08.22.15.09.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2019 15:09:51 -0700 (PDT) Subject: Re: [PATCH 0/3] Add NETIF_F_HW_BRIDGE feature To: Horatiu Vultur , roopa@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 References: <1566500850-6247-1-git-send-email-horatiu.vultur@microchip.com> From: Nikolay Aleksandrov Message-ID: <1e16da88-08c5-abd5-0a3e-b8e6c3db134a@cumulusnetworks.com> Date: Fri, 23 Aug 2019 01:09:50 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1566500850-6247-1-git-send-email-horatiu.vultur@microchip.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/08/2019 22:07, 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. > 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(-) > IMO the name is misleading. Why do the devices have to be from the same driver ? This is too specific targeting some devices. The bridge should not care what's the port device, it should be the other way around, so adding device-specific code to the bridge is not ok. Isn't there a solution where you can use NETDEV_JOIN and handle it all from your driver ? Would all HW-learned entries be hidden from user-space in this case ?