Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp484058ybl; Fri, 30 Aug 2019 02:46:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwSt7e454Fd46yLWsUThvgHaYnTJPRHOyzgZYq49Eyw1x/ZSHS7niWmbK2uu35QAm697Qb X-Received: by 2002:a17:902:d24:: with SMTP id 33mr14848666plu.133.1567158363377; Fri, 30 Aug 2019 02:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567158363; cv=none; d=google.com; s=arc-20160816; b=wUThiJLhCoOC3LiC1YtW++t0JxHn33896n7hZEL66ocv5NVtSQPZEJYGfOdHF8XrB/ ECG7hte/ZsTJkj6e1lSt5Xo7e+QhXLlHvz7urXwtcgoL4Z5tUR5t5Psg8gPMz4Kq7XbW U5dk9phUqyIJ3+tXxIrhhAKqfNo5JLGHkR/EPVLcaQ2SdFx0o+vXCG04ylVQBFlWFOKk Ys8IvDZJjc5N+1IvuoFAfXE5RzhymNLnivKB6J+Wr/Esxtxxy7tcrvHfLrynpNuu3tWC v5YMHdUUeR064knUt9x9qKNFbzl8J17W9f1TUBjj3VRwhhdkgFUnqvhHNYsv0JdV06ar Ugzw== 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:dkim-signature; bh=xSMmHk8zElgw/P9GO/Rx4Txs5yQjETOuxsESTLh73Xk=; b=L85HpPp4LMqfPdYky8jt0eASd3ZMYlDsbYL/NnaKjJfFWaV68qTAhnHEk+jnNpi8Ro jr6sL7q/ku27n2b8VK6PaNSXcJH6J1c5ScibzJz0BCzwN1AOYFDPzh0gh2gM42X9CVuC itfFSnBryES0O9kGONT6xUNYeOzoJm8oPNn/WKE4Pcqs1zRqQ1YqpyKI8MFBUqJj+/dp QAel5ldXLEHD1SG7b+t92tH4CAIOpgEeFP2zVT1uMkVvKltepbFdaiFHFmBGlPyjKzCb gAFaNGzAWH1AaOZxsEqfzpy6ySK8TvHL9OGVBpN0pCR6QiSPPf/R67dF0DFZK4Ub4LQN ovGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=HozWlQep; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p187si5591570pfp.5.2019.08.30.02.45.46; Fri, 30 Aug 2019 02:46:03 -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=@messagingengine.com header.s=fm3 header.b=HozWlQep; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727945AbfH3Jn0 (ORCPT + 99 others); Fri, 30 Aug 2019 05:43:26 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:55973 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfH3Jn0 (ORCPT ); Fri, 30 Aug 2019 05:43:26 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id A136332A9; Fri, 30 Aug 2019 05:43:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 30 Aug 2019 05:43:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=xSMmHk 8zElgw/P9GO/Rx4Txs5yQjETOuxsESTLh73Xk=; b=HozWlQepDEdOiqmHdN+iB4 XDIiLG/bT+Mrp7NRjEn9tL2IvMjbKIXzKOU9xH5nTsG9mkl2MC/KNvkEWWg7232J 5oXQcNjFETuzzJalltAuOV5hMQ2wqqkw/l8ZIymJcUNDPKV75Oa8AYAsOt0qrEyY Jz7BcoGWz6P3ymgFFX5EZ3aQNqHYvFVkckbZK1dNEdQ2PsUIh7rN+M0AvZcXgdeW /u+PmmNDzRvE5qI9NRfXgmwi4OM1IvLKN1s9j47TGqS/6t+rtiCZLAoloYji1fks 025RIe1yvC7NsMHgPP2jyHlQruFw9GgVHm5rhX3rlW89ocw06+8x+AeP6feCbYVg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeigedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjfgesthdtredttdervdenucfhrhhomhepkfguohcu ufgthhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecukfhppedutd elrdeijedriedurddvvdegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehiughoshgthhes ihguohhstghhrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (bzq-109-67-61-224.red.bezeqint.net [109.67.61.224]) by mail.messagingengine.com (Postfix) with ESMTPA id 7D7F88005A; Fri, 30 Aug 2019 05:43:21 -0400 (EDT) Date: Fri, 30 Aug 2019 12:43:19 +0300 From: Ido Schimmel To: David Miller Cc: andrew@lunn.ch, jiri@resnulli.us, horatiu.vultur@microchip.com, alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com, allan.nielsen@microchip.com, ivecera@redhat.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: <20190830094319.GA31789@splinter> References: <20190829175759.GA19471@splinter> <20190829182957.GA17530@lunn.ch> <20190829193613.GA23259@splinter> <20190829.151201.940681219080864052.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829.151201.940681219080864052.davem@davemloft.net> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 29, 2019 at 03:12:01PM -0700, David Miller wrote: > From: Ido Schimmel > Date: Thu, 29 Aug 2019 22:36:13 +0300 > > > I fully agree that we should make it easy for users to capture offloaded > > traffic, which is why I suggested patching libpcap. Add a flag to > > capable netdevs that tells libpcap that in order to capture all the > > traffic from this interface it needs to add a tc filter with a trap > > action. That way zero familiarity with tc is required from users. > > Why not just make setting promisc mode on the device do this rather than > require all of this tc indirection nonsense? > > That's the whole point of this conversation I thought? As I understand it, the goal of this series is to be able to capture offloaded traffic. Currently, the only indication that drivers get when someone is running tcpdump/tshark/whatever over an interface is that it's is put in promisc mode. So this patches use it as an indication to trap all the traffic to the CPU and special case the bridge in order to prevent the driver from trapping packets when its ports are bridged. The same will have to be done for OVS and in any other (current or future) cases where promisc mode is needed to disable Rx filtering. If there was another indication that these applications are running over an interface, would we be bothering with this new interpretation of promisc mode and special casing? I don't think so. We can instead teach libpcap that in order to capture offloaded traffic it should use this "tc indirection nonsense". Or turn on a new knob. This avoids the need to change each driver with this new special case logic. Also, what happens when I'm running these application without putting the interface in promisc mode? On an offloaded interface I would not be able to even capture packets addressed to my interface's MAC address. What happens when the interface is already in promisc mode (because of the bridge) and I'm again running tcpdump with '-p'? I will not be able to capture offloaded traffic despite the fact that the interface is already configured in promisc mode.