Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2361761pxb; Sun, 24 Jan 2021 04:30:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTswDZeNi8y+UBJq8XeUnP7gDLbS0HtuUhpw9fwazdGhJ43r3CK7LRd2f7xRT5eg4DRnjM X-Received: by 2002:a05:6402:2288:: with SMTP id cw8mr470155edb.161.1611491426847; Sun, 24 Jan 2021 04:30:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611491426; cv=none; d=google.com; s=arc-20160816; b=qyRTfvSJsIoPnH3ebxbHPfL1bQJm2fhp5wVbwM/RQ1CZeVoLXWu4rEzTJpKY7SWMbe TO/i+j+Esn1UeZ5fKcAr2y40IqiGN5FkGV4KIzPiHv+zlN5ZB/kHUlAEhF1FOmFJ4fPr nbPo0dgXLHdN1cLcxYaSVPTtWAw7xqfqtcHhEhuCGmvf8+g9zeYCWpbDfD3s6uuh69T+ Dn3pSN+MZzSftZM1WdUo6ULYOYteBSM7dpoP/RDPeG1MeJh0dqJ16RuKqmL1laVAHV0y 6yi8qaKRwf7ctInUMc3oHHWi4yUY/nSLGhyHd8cdd6c8lAIs8CYzfWlR9wRX31JoxYgt JZNA== 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=Rhdyx+++s9e/tLuSCn+4XCNIV51DY4us6cXiMH6QLkI=; b=ngLavDGy29/zJ1YniQfmHlijfar04Q5e8Tx2hwF0pF1dMf8Yf1z+6kebvpQQSlWepN NB8XYx5qNY41taW4qcYDF7Be5oZWSBDEDgZ2GSvcZ4lNcjs9qRPtcEfb6o7+g+iUuPC5 LZgw4U51LhVkC8MqHuCn24cuLKWR0NGNp6BTD5The7jlMWmQkIicepsz/FJ30tnb7z6C ZkWAJTGCx1LM4vyJWkffruz6WZKu+RPlNeSepeiC7r/OhSllyZ5uyOZWAQzSrrMEnQtx /CRTn2nXYJUXpxHPim1sVaoodhgoM9gsRaFgtcvh7JPiVXufeVi9orUhEgNMbVXL3FIl N7ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Bk97AcFB; 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 dj27si5916814edb.398.2021.01.24.04.30.01; Sun, 24 Jan 2021 04:30:26 -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=Bk97AcFB; 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 S1726778AbhAXM3A (ORCPT + 99 others); Sun, 24 Jan 2021 07:29:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726770AbhAXM26 (ORCPT ); Sun, 24 Jan 2021 07:28:58 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CE5FC06174A for ; Sun, 24 Jan 2021 04:28:17 -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=Rhdyx+++s9e/tLuSCn+4XCNIV51DY4us6cXiMH6QLkI=; b=Bk97AcFB7HEn+gpykFVSEpk+tA HhUu7dlE3f2pJ70guDpAfdepYKyRanblBYndTXjI7+WJBN+p4iioz9/ZchAG4jWrP2qK+/UhUkuvK 4Q4ILG6XeXoZvAT3TLMwyhls5Ka6NoY3CV28uSiVtFEoyDXGSTMXp5nZAO8EPcWN4Vi8=; Received: from p54ae91f2.dip0.t-ipconnect.de ([84.174.145.242] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1l3eV4-00074g-Kz; Sun, 24 Jan 2021 13:28:14 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH 5/6] mac80211: minstrel_ht: show sampling rates in debugfs Date: Sun, 24 Jan 2021 13:28:11 +0100 Message-Id: <20210124122812.49929-5-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210124122812.49929-1-nbd@nbd.name> References: <20210124122812.49929-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 --- net/mac80211/rc80211_minstrel_ht_debugfs.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/net/mac80211/rc80211_minstrel_ht_debugfs.c b/net/mac80211/rc80211_minstrel_ht_debugfs.c index 067d10383fa7..07aa877652a4 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,8 @@ 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" ,((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