Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5342338ybl; Tue, 27 Aug 2019 03:12:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7M2KKkpYbHICrk6BQZePFLOpYxh7HScIBwOe7McYNToGzLoXf9UBrCCcuQ1Xxo6OKugSH X-Received: by 2002:a17:90a:3651:: with SMTP id s75mr24111656pjb.13.1566900752807; Tue, 27 Aug 2019 03:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566900752; cv=none; d=google.com; s=arc-20160816; b=VkqT1Fq9R3vTUYMPvaDj4OJkrNNCHkbEFHH8l1w93Kh+8f5dkgOoz9X13Ew8YNhS+4 FYpeDjpMW4l9RXcc5gpbPUzQdtqUO/pKJLca8RKpDNE9RwWUigWDaTb2rhTmwwlzNulR bjaS/5xgeJckzMatNxVKFczmqUKa78ZNCR/r5mzBHJGPU25KohjVjiNDzYeaK7tOt8b5 BFX2t0qF1VBFI55YvF+Gj/ArvRkTQX5VYQ1+ljnLqUmOVSOAtV7SwUWGd/C6/+bsaIT8 oU8/gQ51zdq1NRo1EquSGXHx4G85By4myo7dogLhLUwhWitxC1T+02h2+KuOgkVxJs5o Fp0g== 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=RSP3x0QFgCvsaDwlp9IdBQyLr3x5gMM5Cop4hOkgy34=; b=qXFGbvAJl95k8kxHGFIQ7JGErQDuPHVC7yq21bc9ai2kB4VCrijMIXOCHOhZU00TfL 8qAUn3aSVB5D4vVnXammqT0wp9dmceWdnSa63tEXIZlv8WrcrTya7w2jH8p2eWOw3I1B YzQQxgScJ7+EDtfQnyCqmxCgjaNsSJ7QK5uH9LiI+3LEhmFsYvm84aI405krV7NBCU7s GzfCA2SkBIE/xxg/fzavauw8CQyD8gnSDHtC922xGPdEua+H2iHz5aBYNTGhYpXC3/g6 raCDSo0Zgx6PzkBVsls/Dzl2/yoMa6/M4THLrwzmlhRbtf5Y+6pyPlDrTaD6K78rXQq3 LLUg== 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 r74si13107059pfr.79.2019.08.27.03.12.16; Tue, 27 Aug 2019 03:12:32 -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 S1729387AbfH0KKi (ORCPT + 99 others); Tue, 27 Aug 2019 06:10:38 -0400 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:15476 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729058AbfH0KKh (ORCPT ); Tue, 27 Aug 2019 06:10:37 -0400 Received-SPF: Pass (esa3.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=esa3.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 (esa3.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa3.microchip.iphmx.com; envelope-from="Horatiu.Vultur@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa3.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: 1yAi4Ua9NRqqYG9pUWXNBJ8g0UQT9uyfb8aoPHVM5JfTpSepP0yUhhi9A04kfVoewLMtPbjlQB V2lpUvqk7DsA3Qf3Bnbj8BXtqKI63nijDtD8iDNmxzxTAAzC9macH5h51O1282qjCc26/31tmB 5nGqJ3HhqX5I7CBFdet9cDi/K7w2ZS33eV6I8DIHrf/hPGvNip7gPja9gdfYEkWOAyvCRQ1BKf 6VvwQWmdQr2/O+Cea4MlVFVWm7esQlbcGPe8RwBDYKAEqmjjccbgPV0ETWu5Rax3/edS3Oja1I h/8= X-IronPort-AV: E=Sophos;i="5.64,436,1559545200"; d="scan'208";a="46737569" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Aug 2019 03:10:36 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 27 Aug 2019 03:10:35 -0700 Received: from localhost (10.10.85.251) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1713.5 via Frontend Transport; Tue, 27 Aug 2019 03:10:35 -0700 Date: Tue, 27 Aug 2019 12:10:34 +0200 From: Horatiu Vultur To: Andrew Lunn CC: , , , , , , , , , Subject: Re: [PATCH v2 0/3] Add NETIF_F_HW_BR_CAP feature Message-ID: <20190827101033.g2cb6j2j4kuyzh2a@soft-dev3.microsemi.net> References: <1566807075-775-1-git-send-email-horatiu.vultur@microchip.com> <20190826123811.GA13411@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20190826123811.GA13411@lunn.ch> 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/26/2019 14:38, Andrew Lunn wrote: > External E-Mail > > > On Mon, Aug 26, 2019 at 10:11:12AM +0200, Horatiu Vultur wrote: > > When a network port is added to a bridge then the port is added in > > promisc mode. Some HW that has bridge capabilities(can learn, forward, > > flood etc the frames) they are disabling promisc mode in the network > > driver when the port is added to the SW bridge. > > > > This patch adds the feature NETIF_F_HW_BR_CAP so that the network ports > > that have this feature will not be set in promisc mode when they are > > added to a SW bridge. > > > > In this way the HW that has bridge capabilities don't need to send all the > > traffic to the CPU and can also implement the promisc mode and toggle it > > using the command 'ip link set dev swp promisc on' > > Hi Horatiu Hi Andrew, > > I'm still not convinced this is needed. The model is, the hardware is > there to accelerate what Linux can do in software. Any peculiarities > of the accelerator should be hidden in the driver. If the accelerator > can do its job without needing promisc mode, do that in the driver. Thanks for the model description. I will keep in my mind for the next patches that I will do. > > So you are trying to differentiate between promisc mode because the > interface is a member of a bridge, and promisc mode because some > application, like pcap, has asked for promisc mode. > > dev->promiscuity is a counter. So what you can do it look at its > value, and how the interface is being used. If the interface is not a > member of a bridge, and the count > 0, enable promisc mode in the > accelerator. If the interface is a member of a bridge, and the count > > 1, enable promisc mode in the accelerator. That sounds like a great idea. I was expecting to add this logic in the set_rx_mode function of the driver. But unfortunetly, I got the calls to this function before the dev->promiscuity is updated or not to get the call at all. For example in case the port is member of a bridge and I try to enable the promisc mode. > > Andrew > > -- /Horatiu