Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp325805ybl; Thu, 29 Aug 2019 23:55:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaO7Rytn+sz78cWr0D6thgeSi7vZFKuyw9lGQsM8XDscTQywyKsAHlGevuD+XJq7NPStdA X-Received: by 2002:aa7:9524:: with SMTP id c4mr16802590pfp.225.1567148157418; Thu, 29 Aug 2019 23:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567148157; cv=none; d=google.com; s=arc-20160816; b=eVVhn82+k49gsqm17X5gv53HH7LulXXMmlSikGV0iJJUPiNMOjFw2Cmc8868QPBDUn aFDwv1wkAlGxc/rklKwNTpwWWl56eDbasW4KmwSJuzFKtYa1so95UChVet/EAqhA1lGJ e4ug5o7cXIbqvG6WJsxsuFiUvpKVWU+PeOAxrW7awi/GojrzkI5c/CGBCk/pC40xqWTL kYKwO00nvZH8Spn7DrENSN0NR9K0gLipyi8CI6qbNQBNw9k0FOj9/5tiPeJrsR7e9d8/ GCuUJRfrZp7uvE9nwb7ZCiyCWtqgfHFv0dxzxEQ9FA6UDu6s+K2l3fAokyLtWfkWfUaM TViw== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=YCODjTtHEvzD+NzdRV0coH2nPXCzBNbOCrfdfaGHjB8=; b=kd6R12OCuGoqPPcH30xnD81WSbq9s6hkZI0KWHdpBbMmgUPsMm6BqaHBURFZXiZm/Z 6+n+f/3HR7V5SusdTAkIFep6pC/XKAGZF60wdXViZT7f62XbO/GleyvA/FRSazz/sh0o yZAmTZHwNsv8nBapawqhBg1CQvZgmVpBlGoFIdkvlsYBuZs4/jl/JUFbcnkS3kRJvcfh 3m31UFNQHVMSuRaEhQShHpILazoC1Q5CkfgpszXRbxHxGMuPykXqeW/ft/c8mEfwaUCp BPG9/9hXmza6nJ2DpNyp1a1J3j2xkUhcxU0uiNstu23oXZh23aRTPDOUgFfTAScPMphC NWYA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v85si60062pgb.53.2019.08.29.23.55.41; Thu, 29 Aug 2019 23:55:57 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727433AbfH3Gyu (ORCPT + 99 others); Fri, 30 Aug 2019 02:54:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40042 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfH3Gyu (ORCPT ); Fri, 30 Aug 2019 02:54:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B9E2820ABB; Fri, 30 Aug 2019 06:54:49 +0000 (UTC) Received: from ceranb (ovpn-204-112.brq.redhat.com [10.40.204.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 099B65C1D6; Fri, 30 Aug 2019 06:54:46 +0000 (UTC) Date: Fri, 30 Aug 2019 08:54:45 +0200 From: Ivan Vecera To: Jiri Pirko Cc: David Miller , idosch@idosch.org, andrew@lunn.ch, horatiu.vultur@microchip.com, alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com, allan.nielsen@microchip.com, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] net: core: Notify on changes to dev->promiscuity. Message-ID: <20190830085445.1c28dc02@ceranb> In-Reply-To: <20190830063624.GN2312@nanopsycho> References: <20190829193613.GA23259@splinter> <20190829.151201.940681219080864052.davem@davemloft.net> <20190830053940.GL2312@nanopsycho> <20190829.230233.287975311556641534.davem@davemloft.net> <20190830063624.GN2312@nanopsycho> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 30 Aug 2019 06:54:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 30 Aug 2019 08:36:24 +0200 Jiri Pirko wrote: > Fri, Aug 30, 2019 at 08:02:33AM CEST, davem@davemloft.net wrote: > >From: Jiri Pirko > >Date: Fri, 30 Aug 2019 07:39:40 +0200 > > > >> Because the "promisc mode" would gain another meaning. Now how the > >> driver should guess which meaning the user ment when he setted it? > >> filter or trap? > >> > >> That is very confusing. If the flag is the way to do this, let's > >> introduce another flag, like IFF_TRAPPING indicating that user > >> wants exactly this. > > > >I don't understand how the meaning of promiscuous mode for a > >networking device has suddenly become ambiguous, when did this start > >happening? > > The promiscuity is a way to setup the rx filter. So promics == rx > filter off. For normal nics, where there is no hw fwd datapath, > this coincidentally means all received packets go to cpu. > But if there is hw fwd datapath, rx filter is still off, all rxed > packets are processed. But that does not mean they should be trapped > to cpu. +1 Promisc is Rx filtering option and should not imply that offloaded traffic is trapped to CPU. > Simple example: > I need to see slowpath packets, for example arps/stp/bgp/... that > are going to cpu, I do: > tcpdump -i swp1 > > I don't want to get all the traffic running over hw running this cmd. > This is a valid usecase. > > To cope with hw fwd datapath devices, I believe that tcpdump has to > have notion of that. Something like: > > tcpdump -i swp1 --hw-trapping-mode > > The logic can be inverse: > tcpdump -i swp1 > tcpdump -i swp1 --no-hw-trapping-mode > > However, that would provide inconsistent behaviour between existing > and patched tcpdump/kernel. > > All I'm trying to say, there are 2 flags > needed (if we don't use tc trap).