Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5097855imb; Thu, 7 Mar 2019 07:42:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwmMaNpCTZunJzh1I6gdvLmlTMhHBJROPgKW7y/tQuDcOiWCHz6uokBLLA3n35xwwejNbfy X-Received: by 2002:a17:902:4483:: with SMTP id l3mr7846385pld.340.1551973378500; Thu, 07 Mar 2019 07:42:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551973378; cv=none; d=google.com; s=arc-20160816; b=rnwPDJFH36+SurfZykv4hto0RLANS5f/PXCcJAuGd8bE1iwMh+UurgIf4oek6u9hxY yuCfAqiNNV20GUS1bARn6GxkDOWYKwbIuuytl24HcS+V3hcH477bgfJdxbPKk6iSf+DK 1KCjqXKfWIRdHSRLpRszXvqdv2EDvy+1HnEdZWsHUcKykDPQ4FZaybrJLeIpNsT2XPs2 tGBQmWF8feGbekSSERE9Z3lSofdMwhSeoddcxhNnBcsiLNTtpYl9JGQLeVwWlOfJN0WD TzZesjbOQz/rFhxq/8dRKBUpy5XaTQqifvb982IwLUE+RQk8+unjNT66HReK2gXCw1Jx Q8QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dmarc-filter :dkim-signature:dkim-signature; bh=4ZIc34mLcpgfUdU4mOF06JeOiKrsJy0Hcez7GOeeyMk=; b=nM3IvASuc3auV0SivtGS7GSzQLSFQf30dFoI1CfUHYB4bjbCOkuaeAGHIxBsaxh/bo nGVdgql8PEy453jLRRYVueVPMtVIst1ZwyY5W0TlGc1zoUZHfrnc64ltp816m/58ixxg KMR1KBscQiwniJxVfmSoVyF1ucDjZatVlZfP5s5eLRxb1RWoANc30AI/NIo1FJmFSdcd Hw1MVzwbck3R4kkVJoz3Zvegc2ipDRIu4ymWotSvbKzO+hwhCdf5e4HZ5AdMmz2nIdFy hWeuriApqAyWULaW147hwxqGERpMtJfjcYTXDRLoq+xzRZFok0flK18MDbwlkKTnayf/ p21g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=dsy4bVlR; dkim=pass header.i=@codeaurora.org header.s=default header.b=e6YztNP8; 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 u18si4123921pgk.440.2019.03.07.07.42.42; Thu, 07 Mar 2019 07:42:58 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=dsy4bVlR; dkim=pass header.i=@codeaurora.org header.s=default header.b=e6YztNP8; 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 S1726626AbfCGPmO (ORCPT + 99 others); Thu, 7 Mar 2019 10:42:14 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:44156 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbfCGPmN (ORCPT ); Thu, 7 Mar 2019 10:42:13 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8A6D06016D; Thu, 7 Mar 2019 15:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551973332; bh=8hnLI+4unoiRoQDzhLXSHv9McOthhblpMhzL68deYBw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dsy4bVlR0CrDHM+W9ekV5ronf2h55awQutlrLN3pyOboFpswsVYSVpkYhCW2LJd4i BHSOxrU7jw7UQynq/PpDGyskOiwrQbz4IrVAKWx0VQX+N8cOgXi1gV/6Fu4NPgV/aH QVL/lYBmv74BoOnQJ445lX7OGCS5gCRoY4lE3Kn4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from purkki.adurom.net (purkki.adurom.net [80.68.90.206]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E73A56016D; Thu, 7 Mar 2019 15:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1551973329; bh=8hnLI+4unoiRoQDzhLXSHv9McOthhblpMhzL68deYBw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=e6YztNP8Rn2JFUd4gYPc9rTlREZ6gyw9vvLPpWimMrg2BiTmml2HnfNH8Do2egYRo TcUa/LTVxng2z6h+Cfkih5gRtw+JZar5KwODtaORfdxM96gFfy5iaOQzO8jVUDz53z irV0MyNwx/HsVEupKwyVx6HUSVFDcepPzctofGuM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E73A56016D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Julius Niedworok Cc: linux-wireless@vger.kernel.org, ga58taw@mytum.de, david@redhat.com, nc@net.in.tum.de, Johannes Berg , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC v2] mac80211: debugfs option to force TX status frames References: <20190306200206.60916-1-julius.n@gmx.net> Date: Thu, 07 Mar 2019 17:42:04 +0200 In-Reply-To: <20190306200206.60916-1-julius.n@gmx.net> (Julius Niedworok's message of "Wed, 6 Mar 2019 21:02:05 +0100") Message-ID: <87k1hazo6r.fsf@purkki.adurom.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Julius Niedworok writes: > At Technical University of Munich we use MAC 802.11 TX status frames to > perform several measurements in MAC 802.11 setups. > > With ath based drivers this was possible until commit d94a461d7a7df6 > ("ath9k: use ieee80211_tx_status_noskb where possible") as the driver > ignored the IEEE80211_TX_CTL_REQ_TX_STATUS flag and always delivered > tx_status frames. Since that commit, this behavior was changed and the > driver now adheres to IEEE80211_TX_CTL_REQ_TX_STATUS. > > Due to performance reasons, IEEE80211_TX_CTL_REQ_TX_STATUS is not set for > data frames from interfaces in managed mode. Hence, frames that are sent > from a managed mode interface do never deliver tx_status frames. This > remains true even if a monitor mode interface (the measurement interface) > is added to the same ieee80211 physical device. Thus, there is no > possibility for receiving tx_status frames for frames sent on an interface > in managed mode, if the driver adheres to IEEE80211_TX_CTL_REQ_TX_STATUS. > > In order to force delivery of tx_status frames for research and debugging > purposes, implement a debugfs option force_tx_status for ieee80211 physical > devices. When this option is set for a physical device, > IEEE80211_TX_CTL_REQ_TX_STATUS is enabled in all packets sent from that > device. This option can be set via > /sys/kernel/debug/ieee80211//force_tx_status. The default is disabled. > > Co-developed-by: Charlie Groh > Signed-off-by: Charlie Groh > Signed-off-by: Julius Niedworok [...] > + len = scnprintf(buf, sizeof(buf), "%d\n", (int)local->force_tx_status); I wonder about the cast, is it guaranteed that a bool is always of the same size as an int? > --- a/net/mac80211/ieee80211_i.h > +++ b/net/mac80211/ieee80211_i.h > @@ -1367,6 +1367,7 @@ struct ieee80211_local { > struct dentry *rcdir; > struct dentry *keys; > } debugfs; > + bool force_tx_status; [...] > #endif > > /* > diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c > index 928f13a..717fa71 100644 > --- a/net/mac80211/tx.c > +++ b/net/mac80211/tx.c > @@ -2463,6 +2463,11 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, > if (IS_ERR(sta)) > sta = NULL; > > +#ifdef CONFIG_MAC80211_DEBUGFS > + if (local->force_tx_status) > + info_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; > +#endif > + > /* convert Ethernet header to proper 802.11 header (based on > * operation mode) */ > ethertype = (skb->data[12] << 8) | skb->data[13]; > @@ -3468,6 +3473,11 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, > (tid_tx ? IEEE80211_TX_CTL_AMPDU : 0); > info->control.flags = IEEE80211_TX_CTRL_FAST_XMIT; > > +#ifdef CONFIG_MAC80211_DEBUGFS > + if (local->force_tx_status) > + info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; > +#endif IMHO the ifdefs look pointless just to save four bytes. I would move force_tx_status outside of ifdef in the struct so that the actual code doesn't have ugly ifdefs. -- Kalle Valo