Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp354730ybl; Fri, 30 Aug 2019 00:27:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzU5lEkrhIFXtfS9tLsG91uAa6snMa7eAXKAXCUUOliIAzvjj10EWCkgZkT1qaYtjrsTO10 X-Received: by 2002:a63:e48:: with SMTP id 8mr11716072pgo.389.1567150066622; Fri, 30 Aug 2019 00:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567150066; cv=none; d=google.com; s=arc-20160816; b=OdTsTUuyt0xqA3OP/007kAmX6/RCJ+Vq+lUyDw3SCyYijyftMgFwrp9RKuUWPQ6CnA gBL4VlAac+2yPEqUmJvs44bbsCG8GphfpDdl8Zv6W4iPDxljlhGMVuvN1lWdwGOK/qQ9 b6+oXJerXha/dvnrnenHhXxe46iPl585puNMBFApIEgLmBvrl3S3bJKDBMXYFbQvTF5o YmbkvcZ+kryEXS4xTDkfak2Ru2XA96SfmCM9TMkVgzLdLnDQmiDGDKs5tBPBF243rr97 9PKDC/dMBn6CczdRjDdIAZrzwEdRM9mQDlm8E1nqAVNZurgeB0iCYayGJramzXNUdCxT tWig== 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=oZbo/uPQ5BRiFtyjfBt2/0dIdLdCCyLWRWwDgxJ7RXw=; b=i1FB7OkR7V4GOMdyBwFcVnashhpTMsXjNKyz8B0NJBQ48VFSI/Bv3+BI/5vef/AR8l +LKOmoS/F+4f3RgZzNu/qov+tV8m8JU/oRjJwTtkUeA86FE07BwJwo/Uxk3Wa1HGApUd eBaw1t8jukLulO6vcVHuva48GzV2NZlbf2RkHoXwpQExs2EnC3Jbee+QH15av85aF5x+ VUg/2N2u5V/mnE9CkvaGwZ13Ny6v34/OVTj02W/pT+ktlmp0Eut+FxsDdHoOjab2k4Am MKzgQwWZKDonmyIFSjg9+UHxzineeiMyrxNmH9Shl3SAda8aUgzl/9FMm8j3V9dzFhNF GlCA== 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 p9si3984140pls.38.2019.08.30.00.27.30; Fri, 30 Aug 2019 00:27:46 -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 S1727985AbfH3H0l (ORCPT + 99 others); Fri, 30 Aug 2019 03:26:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41114 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726452AbfH3H0k (ORCPT ); Fri, 30 Aug 2019 03:26:40 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6335E7BDA0; Fri, 30 Aug 2019 07:26:40 +0000 (UTC) Received: from ceranb (ovpn-204-112.brq.redhat.com [10.40.204.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 366435D9CA; Fri, 30 Aug 2019 07:26:37 +0000 (UTC) Date: Fri, 30 Aug 2019 09:26:37 +0200 From: Ivan Vecera To: Jiri Pirko Cc: Andrew Lunn , Horatiu Vultur , alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com, davem@davemloft.net, 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: <20190830092637.7f83d162@ceranb> In-Reply-To: <20190830061327.GM2312@nanopsycho> References: <1567070549-29255-1-git-send-email-horatiu.vultur@microchip.com> <1567070549-29255-2-git-send-email-horatiu.vultur@microchip.com> <20190829095100.GH2312@nanopsycho> <20190829132611.GC6998@lunn.ch> <20190829134901.GJ2312@nanopsycho> <20190829143732.GB17864@lunn.ch> <20190830061327.GM2312@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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 30 Aug 2019 07:26:40 +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:13:27 +0200 Jiri Pirko wrote: > Thu, Aug 29, 2019 at 04:37:32PM CEST, andrew@lunn.ch wrote: > >> Wait, I believe there has been some misundestanding. Promisc mode > >> is NOT about getting packets to the cpu. It's about setting hw > >> filters in a way that no rx packet is dropped. > >> > >> If you want to get packets from the hw forwarding dataplane to > >> cpu, you should not use promisc mode for that. That would be > >> incorrect. > > > >Hi Jiri > > > >I'm not sure a wireshark/tcpdump/pcap user would agree with you. They > >want to see packets on an interface, so they use these tools. The > >fact that the interface is a switch interface should not matter. The > >switchdev model is that we try to hide away the interface happens to > >be on a switch, you can just use it as normal. So why should promisc > >mode not work as normal? > > It does, disables the rx filter. Why do you think it means the same > thing as "trap all to cpu"? Hw datapath was never considered by > wireshark. > > In fact, I have usecase where I need to see only slow-path traffic by > wireshark, not all packets going through hw. So apparently, there is a > need of another wireshark option and perhaps another flag > IFF_HW_TRAPPING?. Agree with Jiri but understand both perspectives. We can treat IFF_PROMISC as: 1) "I want to _SEE_ all Rx traffic on specified interface" that means for switchdev driver that it has to trap all traffic to CPU implicitly. And in this case we need another flag that will say "I don't want to see offloaded traffic". 2) "I want to ensure that nothing is dropped on specified interface" so IFF_PROMISC is treated as filtering option only. To see offloaded traffic you need to setup TC rule with trap action or another flag like IFF_TRAPPING. IMO IFF_PROMISC should be considered to be a filtering option and should not imply trapping of offloaded traffic. Thanks, Ivan