Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp347945ybl; Fri, 23 Aug 2019 01:38:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqztz8IjjjsYUv+DxJOnmimeervk4OzIyKZss5JfrAtOsvq8QMTCwdieYgBTrko1Cf7DTlu2 X-Received: by 2002:a17:902:e30d:: with SMTP id cg13mr3436031plb.173.1566549511922; Fri, 23 Aug 2019 01:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566549511; cv=none; d=google.com; s=arc-20160816; b=cnbA5lH/AANHN9Y1s37EsaRUdHZRj6N9Ck37+ACy4JXjZfOq6ELhhSUJwt0A4Q3wuW LJnVGI6k+8uId+Al/bFQ3BLbwgLhWpXdhFajB8iamiZQoJjDGkJ52pkn07sYlR86dqga CD35pFh8P3D0fULxvFtqxxlKgZge2iQqVKE2E7i/SMRp+dJYngR3WAbBnPF+LfeuMVOH 4wyr/rKDz8MstjlIJcC/VXHba+UmtLUILynug0QnResiKicfVXn/FuImnAF+EUaRGax5 3ty7BLdvv1Ayf6DKbZ3KK6ov/xob3IRzjUPczhTjqoQjlMFBqer1wfpvUiQe1U73yqWs iFzA== 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:references:to:from:subject:dkim-signature; bh=tl0f02UPpp3QSnTEonqbC2evIwlfUUJ6tMhF98nlrXY=; b=xKJ2vJpJprT7I5UbISh7nJqTvoNFt0UbRs00elXyX87fYqorN8B5bJXh52rTZ/pASg CVYSzaLGYKsNoHZWrw7RuZgeWE04pMB8IT12IoAwkMRcsejhRifpzuYEsiXLdoC9/Uvl BrdFxENay+76xWx0NK5BkPiqc/WajOGVCdudfKj7pD4vugkD0Z8Xf4X9elAWJz5830Cn vWAzGs3/byuRsMRD8bCb5cGcuf3wx8agAjlbCzIyaBlZepRq7EK2jmAAHv8s1vS3008x nGHnUcuVD8tYc0qJ51W1Oj0loUGGXyVU/JUE9MdZ42NugQZT9DoIGk1gcjaHnDzuOmjq n/MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cumulusnetworks.com header.s=google header.b=T+4E4T3+; 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 r15si1443191pgj.71.2019.08.23.01.38.17; Fri, 23 Aug 2019 01:38:31 -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=T+4E4T3+; 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 S2394004AbfHVW0S (ORCPT + 99 others); Thu, 22 Aug 2019 18:26:18 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:33698 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393992AbfHVW0R (ORCPT ); Thu, 22 Aug 2019 18:26:17 -0400 Received: by mail-lj1-f194.google.com with SMTP id z17so7063945ljz.0 for ; Thu, 22 Aug 2019 15:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=tl0f02UPpp3QSnTEonqbC2evIwlfUUJ6tMhF98nlrXY=; b=T+4E4T3+BvqIxVHuiB70tNqFlTbRn6cEaa91bPZ4FRi3yJDAbv87VEoDtPgsRahlZG GNmis1OL1anAfBZjbf/64jQuoykB2tOpum/BojewUCKcD/o9ZpBLai+c/kAiZSf0ziTN /e/xpWHwwMXhHiTJjFIHJM9lke90Rvq3yyySg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tl0f02UPpp3QSnTEonqbC2evIwlfUUJ6tMhF98nlrXY=; b=mWlayhkTL5Emm2DnBBtktXWqCJ9PjpcGWG0f8gLET06X6l7/XGzLemU5rPS/8bZGJP 9HToaN3UdzthZqkFiahF0AkRRGdaOc6RXdJj4wmqjJ2As15kQ3F5LNaHP2yUbADO3uN/ ihBqaHM8YTif9qqqMlaN7kXYc/Q3ldHaiim2ezW0dKZDYDMu9lRLNLdnyZMjzeEujmBj 5nsRoR5kT/6UlxBBuYmAaN5gIBcuC3FBF8y0xs/cryB8xZ4c0ItQaAM6lYkk58wfqtSO JGB4BDsBScRcjb62aI/X4Zp3UOSfiuV0+EezS35zfDPXPLK2CDWs+MCuTR+JVyre/nZQ jn6g== X-Gm-Message-State: APjAAAX1h71oSSriu+c0aA4t7cHZex5AtRfJkuXumIHJ44kC+4qTCR8Y /7J4AsgC08MvVhsZFixbFUAANA== X-Received: by 2002:a2e:9214:: with SMTP id k20mr894743ljg.232.1566512775276; Thu, 22 Aug 2019 15:26:15 -0700 (PDT) Received: from [192.168.0.110] (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.googlemail.com with ESMTPSA id o9sm235103ljc.51.2019.08.22.15.26.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2019 15:26:14 -0700 (PDT) Subject: Re: [PATCH 0/3] Add NETIF_F_HW_BRIDGE feature From: Nikolay Aleksandrov 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> <1e16da88-08c5-abd5-0a3e-b8e6c3db134a@cumulusnetworks.com> Message-ID: Date: Fri, 23 Aug 2019 01:26:12 +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: <1e16da88-08c5-abd5-0a3e-b8e6c3db134a@cumulusnetworks.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 8/23/19 1:09 AM, Nikolay Aleksandrov wrote: > 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(-) >> > Just to clarify: > IMO the name is misleading. - that's not mandatory or anything, just saying people might get confused when they see it > 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 That was mostly a rhetorical question, it's obvious why but please add an explanation at least in the commit message and please fix the typos in the comment. Also HW is capable of doing switching, this needs some clarification that the whole process stays in HW IIUC. More details here would be great. > 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 ? > I.e. isn't there a way to do this without introducing a new feature flag ?