Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4184644pxb; Tue, 26 Jan 2021 14:54:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBLueBHDRrhq+85KILz8f0o30FBh+Sq1GKOo4gvIp+OasENhjm4Hb3XD2QnDypV0M6daeQ X-Received: by 2002:a17:906:154d:: with SMTP id c13mr4990780ejd.471.1611701694038; Tue, 26 Jan 2021 14:54:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611701694; cv=none; d=google.com; s=arc-20160816; b=FjM44jKT889V6HZ5CkXD/zc1RdhJVAkmfszOxjnvoInANSej12fiQvGNHHlvwWibWk rhlqQAEJXeXHd29cMzgp47Mj80B8y3bmlUhXmCCsONXKoW3APKomSRmkbVKQvC9rdVYq g8nVeKpDZyiBIEt4ijzQkNLsTqWfX7bvKkDcPppGg9/O6YV8ZooiJFegXyXpjjj0cNKA tK78tfQIkDsnmfYD2XZBRgmQbCzf3yAo5WAlhU31/OJM/rMkMhROD3uEUT5bzVZIBpAP vcCKIYek3YIKVFNG9Pv7xH+yio1KId9lf1YrY4R+Goask4rIqIpMbwEh7ChUgAEh3RZR W7sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BKHsgdfC9xJRT2Zc169eBLstSXJ+aQ4LY8SnDtVBMAM=; b=WQqIddUFP6/MRjKFEvXuIMqn6JSOcwVLf+bKZi78jlXs8sCArcApY2B4I6sFiGQ/ID EcGNGmDZCumamVo47uq0ruHbWhTR6PFuv/+SOwGKsbioeYT7cjDf9yjeUERd886w4fIG lzkGg2DMeom0jtjIFaroOP4M8tuGT90e2hwuwCVK8l0LhUSx/uX8FpSEwi1qTbraLs/A URXOeyuzy7v+xOWuI3zauIiOMaZxhPa2TWb8al0wqMiFesIi87ZAyNdhMRCSX84Y4OSE K2ryG6vZuWkAuvhvM8nQp3qVwM9vvozpKdMGviYnlLJC36Gqg44KAb39iFvZTAfbEnR2 1/2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Q0+U3Se3; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si3347edu.474.2021.01.26.14.54.28; Tue, 26 Jan 2021 14:54:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Q0+U3Se3; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729889AbhAZWpv (ORCPT + 99 others); Tue, 26 Jan 2021 17:45:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392680AbhAZS7A (ORCPT ); Tue, 26 Jan 2021 13:59:00 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2A7DC06178C for ; Tue, 26 Jan 2021 10:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=BKHsgdfC9xJRT2Zc169eBLstSXJ+aQ4LY8SnDtVBMAM=; b=Q0+U3Se3It3RZptxHua61MDmSt Kyuq985uVaIe3VJlzBFBNGtHnq4og538cSAbxG7umC296qpubFaZ7fzpeDMRLUwGcj8UvKOW+anD6 10x+s41Zn9ZTG9K+jPIPRDr3Ch+tIvkeQFKqVMo8TxwBfpR0dffCZAVmRTdyTF78o22Q=; Received: from p54ae953c.dip0.t-ipconnect.de ([84.174.149.60] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1l4TXU-0003cb-Te; Tue, 26 Jan 2021 19:58:09 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v2 5/6] mac80211: minstrel_ht: show sampling rates in debugfs Date: Tue, 26 Jan 2021 19:58:05 +0100 Message-Id: <20210126185806.61770-5-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210126185806.61770-1-nbd@nbd.name> References: <20210126185806.61770-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This makes it easier to see what rates are going to be tested next Signed-off-by: Felix Fietkau --- v2: fix duplicated line net/mac80211/rc80211_minstrel_ht_debugfs.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/net/mac80211/rc80211_minstrel_ht_debugfs.c b/net/mac80211/rc80211_minstrel_ht_debugfs.c index 067d10383fa7..25b8a67a63a4 100644 --- a/net/mac80211/rc80211_minstrel_ht_debugfs.c +++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c @@ -32,6 +32,18 @@ minstrel_stats_release(struct inode *inode, struct file *file) return 0; } +static bool +minstrel_ht_is_sample_rate(struct minstrel_ht_sta *mi, int idx) +{ + int type, i; + + for (type = 0; type < ARRAY_SIZE(mi->sample); type++) + for (i = 0; i < MINSTREL_SAMPLE_RATES; i++) + if (mi->sample[type].cur_sample_rates[i] == idx) + return true; + return false; +} + static char * minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p) { @@ -84,6 +96,7 @@ minstrel_ht_stats_dump(struct minstrel_ht_sta *mi, int i, char *p) *(p++) = (idx == mi->max_tp_rate[2]) ? 'C' : ' '; *(p++) = (idx == mi->max_tp_rate[3]) ? 'D' : ' '; *(p++) = (idx == mi->max_prob_rate) ? 'P' : ' '; + *(p++) = minstrel_ht_is_sample_rate(mi, idx) ? 'S' : ' '; if (gflags & IEEE80211_TX_RC_MCS) { p += sprintf(p, " MCS%-2u", (mg->streams - 1) * 8 + j); @@ -145,9 +158,9 @@ minstrel_ht_stats_open(struct inode *inode, struct file *file) p += sprintf(p, "\n"); p += sprintf(p, - " best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n"); + " best ____________rate__________ ____statistics___ _____last____ ______sum-of________\n"); p += sprintf(p, - "mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n"); + "mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts]\n"); p = minstrel_ht_stats_dump(mi, MINSTREL_CCK_GROUP, p); for (i = 0; i < MINSTREL_CCK_GROUP; i++) @@ -228,6 +241,7 @@ minstrel_ht_stats_csv_dump(struct minstrel_ht_sta *mi, int i, char *p) p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[2]) ? "C" : "")); p += sprintf(p, "%s" ,((idx == mi->max_tp_rate[3]) ? "D" : "")); p += sprintf(p, "%s" ,((idx == mi->max_prob_rate) ? "P" : "")); + p += sprintf(p, "%s", (minstrel_ht_is_sample_rate(mi, idx) ? "S" : "")); if (gflags & IEEE80211_TX_RC_MCS) { p += sprintf(p, ",MCS%-2u,", (mg->streams - 1) * 8 + j); -- 2.28.0