Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp397218img; Thu, 28 Feb 2019 01:08:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ7S9asli//05YJURDQ2SWZFPLU6wUNwctvOIoFHPrlhezzJijm5DzQyWIlfHA0HTEObZlp X-Received: by 2002:a62:1c94:: with SMTP id c142mr6586068pfc.54.1551344883365; Thu, 28 Feb 2019 01:08:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551344883; cv=none; d=google.com; s=arc-20160816; b=ctRY5RnrVeBQIl9ahBktP2uiCiV0QTnXQLRsIFoM0hvJMaayNCo4cCb/ZOulTXt8cr fpvPysHUYmpQmgeOfkXGJjZJ4AlNEv9U+3WS1DYLsJJraMeP39VzDsYo8yelnKNs07PS dmp6sVLLFB4UgXokoksTDoXw+cQhXmAjXreXlCEaV5WM9Fy59u1803FDJmtZUUsUpcff idLzUGXHC4xzTZ5iYCbNUBHuiwQ1W1qUDjYBczfvl40CPnTQ6Q8mx6Te61Hy33od51rX Hl01/IOnwqmyohT/NcKviAwP7+4FyrWMx/H+pBLhmerlcNuVM/PNk5ja4PyL9XXIBS9L sQVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=GyFhf+zkMmgJIO4kBVvDVW88JFnUFGdcwX6EKXkkR28=; b=WxGye7bF/F4/He4c2HzqNlTSnjaBaVywmpedlfjE5+K34OjVNe/RJOsZN/InFsXl0p sJWUCzzP+tZSZEfbApZRhMJZg3YhQI30mhRxc3J9/c+Se57vjRLRWI442bxF18OoGbUW bk1OEnrL2FpLESF8ri2NoOUnP3kBJgTOkVZHrwSAxGZDkgNFlPHk3dem9ZSpHM1eHn1J 9mmuNqIjSMNOCqYvU/UbAHnOnPF4URxu7+vOGEp5Gp673xLDNwbfyE0+XBh6RcG16pLK gTS+SGrbfar607WgijDiSuzDWVQAwFuvs5dXNp26SHRuxc/s+wfsSOlLlevhmc0M6mZt wmDQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si17352367plb.265.2019.02.28.01.07.47; Thu, 28 Feb 2019 01:08:03 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732114AbfB1JGU convert rfc822-to-8bit (ORCPT + 99 others); Thu, 28 Feb 2019 04:06:20 -0500 Received: from mout.gmx.net ([212.227.17.22]:38599 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731013AbfB1JGU (ORCPT ); Thu, 28 Feb 2019 04:06:20 -0500 Received: from w210-65-v4.eduroam.dynamic.rbg.tum.de ([131.159.210.221]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MBWIM-1gonVD06Gk-00AWdK; Thu, 28 Feb 2019 10:05:41 +0100 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH RFC] mac80211: Use IFF_ECHO to force delivery of tx_status frames From: Julius Niedworok In-Reply-To: <550ff2ac45c891a3fcf3dd8a454f9732d8aa1b70.camel@sipsolutions.net> Date: Thu, 28 Feb 2019 10:05:37 +0100 Cc: Oliver Hartkopp , linux-wireless@vger.kernel.org, ga58taw@mytum.de, David Hildenbrand , nc@net.in.tum.de, "David S. Miller" , Edward Cree , Jiri Pirko , Ido Schimmel , Petr Machata , Kirill Tkhai , Alexander Duyck , Amritha Nambiar , Li RongQing , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Julius Niedworok Content-Transfer-Encoding: 8BIT Message-Id: References: <20190226094104.35192-1-julius.n@gmx.net> <6A213CBE-0B6A-466A-B721-E6A728D4888D@gmx.net> <550ff2ac45c891a3fcf3dd8a454f9732d8aa1b70.camel@sipsolutions.net> To: Johannes Berg X-Mailer: Apple Mail (2.3273) X-Provags-ID: V03:K1:ri6uU9ZiuVS+8u+wCZiSdVJEeAyW1a0KbHvpNqxz2ePIlD97jMU 0KaKQClYtekqYhSLZ73QePjj2I+5Fr3PQaLAFLNm+r+VBCzUR2ORf4MZZThF5VRUlYRdS7d m0/68fqVLJVRjU3ZRjlWXWCeeXB5AeyOEM+5HEXZBoAQS+AUX07LCp4nfKsorfsZDbbSGx9 dYZo09VZGW4jWMONZizMg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:XMkL79729MU=:v6/wDinId4gnUjaj+H1zVZ VIEBcsnWURVgyJBDe5QtUjemKZn5/KdfxcGhH3RQCoiIorLkXkHwa2um761Z6lKy8IxbRErfg O1QtnQf6gKta1mx3JzLPdTdwIXzlqZ7bi0JWEARA0DNQX5z+GZ7WXAOASzvXIXJBeWk0hkEN0 EFsUBYP2fgSSgbhHmq7q4IvTaaq31EsdUBP0c0lPZPeU/CJ4ao1zoe/T+LXRiW7Rpj52Y+DAD 1zijYBb0YmTvD4kXKFo7VimyihLwFjo/ZqXThSy9Ct504gMKcXS8Lkg/JB+Te79WfaMhivsmZ IFc1ur39haMwS+TSrWhEshccJM6TrNJ0UQXKIT0PW3Y9g7Kx6Jl00WaEzZRmvlmSLW4eLhPsG TI/q28x7eZwobDWFPeyMMiT/mY8Zvg9fMxDO3WnaSKXd4YrvhwGpp+vG59zr+4g0qpkhunU2H Nn+FnpXelb/2BlK5yQ/RWbvrelIWvLhfJQpUJoEyfTmXcNP+M9iy519OJou6ApHvf7sge8pgI YQc/z81o2a/g3+XKO7CVpHHuck7U2TAJ/A21317izOTmmSMhRZfVrifQqmVGGRSFRWOHL4zqG aMBC+OamoYVwU2WZxklpYU4/V8PifNeVhYxpieYziUbnqlh5XfH7pWJzUgsGvUOX9DRkD9N+d xkxpcZtFBH7He1OjPt5vasGtaXdyLMuAb7MjTrH6fHmRBzHeaWm6QOH5lGq0VBLWvjQuzTeiw VANqtZGrwGkvyk5lEK+VBItoUSxE6koz+5rDpsfa8jlnCTvvIwTH5TbDBmFz1YPmkiizxuckt 2dwAX1JmDA9/2cEAx3F3F7MUDS3R5/iI5wsAUat6Yym6bgPTeAJvhc04yCxVSXFbC9aLTNHa2 8EGEq3pYXD9u1xs/4LlOP+QRsJieCrzpj739e4+lomWgadd+DnPcLjJh8gIZPPGe0b+XFnQpr buhn01YMxMw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 26.02.2019 14:33 Johannes Berg wrote > > You're proposing to add this to the *monitor* interfaces and you really > should have made the flag conditional on that to make that clear. > > However, even on monitor interfaces, you typically *already* see the > frames you transmitted there (as raw frames, which is the only thing you > can do). > Thanks for your prompt reply and thoughts on our patch. Let us briefly describe our test setup to ensure everyone on this mailing list is one the same page. Our general setup looks like this: 1 $ iw wlp1s0 info Interface wlp1s0 ifindex 5 wdev 0x1 addr 4c:5e:0c:11:43:ac type managed wiphy 0 txpower 30.00 dBm 1 $ iw phy phy0 interface add mon0 type monitor 1 $ iw phy phy0 interface add mon1 type monitor When we send (raw) packets on mon0 using packetspammer [1] and listen on the _other_ monitor mode interface mon1, we receive frames that were sent on the first one: 1 $ packetspammer mon0 2 $ tcpdump -i mon1 'wlan addr2 13:22:33:44:55:66' This is due to the fact that frames sent on mon0 are echoed back as TX status frames, because REQ_TX_STATUS is always set for frames sent from monitor mode interfaces. But when we replace mon0 with an interface in managed mode (wlp1s0), the receipt of frames stops, because in managed mode REQ_TX_STATUS is cleared in most frames: 1 $ ifup wlp1s0 1 $ ping -I wlp1s0 192.168.254.1 # this address is not assigned to any host 2 $ tcpdump -i mon1 ‚wlan addr2 4c:5e:0c:11:43:ac‘ > What you're proposing is to use IFF_ECHO to show frames transmitted > through *other* interfaces on the monitor interface. > > I don’t think the IFF_ECHO semantics really match this. > What we propose is to use IFF_ECHO to force REQ_TX_STATUS being set for all frames sent on the interface. But you are right: The goal is that frames transmitted through the other interface show up on the monitor interface (but only after passing the driver). However, this is exactly how we understand the semantics of IFF_ECHO in the kernel documentation. > > Additionally, drivers are sort of free to ignore the REQ_TX_STATUS, or > we could in the future add ways of using the _noskb to feed back TX > status to the state machines where needed, so I'm not really sure I even > _want_ this to be set in stone in such an API. > As far as we know, drivers must return a TX status frame, if REQ_TX_STATUS is set, but can do whatever they want, if it is clear. This is no problem for our functionality, because we force the delivery of TX status frames by permanently setting REQ_TX_STATUS. As long as the semantics of REQ_TX_STATUS remains like it is now, the functionality will always be as expected from our API. > Now, I can also see how this can be useful for debugging, but it feels > to me like this should be a driver (debug) option? > We could also achieve the functionality by modifying the drivers but this would mean that we had to add this functionality to every driver. Moreover, the feature of TX status frames, how it is implemented currently for monitor mode interfaces, is part of the mac80211 implementation. The decision to force TX status frames for monitor mode interfaces is made in the common mac80211 implementation. > johannes > Once again, thanks for your comments. We appreciate your response. Julius and Charlie [1] https://warmcat.com/git/packetspammer