Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp16388pxb; Wed, 27 Jan 2021 00:24:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnwXqn/bk0SiZOJ4J1uzO/4qEVLfWke7TJcDiaeUGoMmL4dbDfNVCjqiU5gBgJq2zYwlJt X-Received: by 2002:a17:906:eb1b:: with SMTP id mb27mr6248722ejb.332.1611735891688; Wed, 27 Jan 2021 00:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611735891; cv=none; d=google.com; s=arc-20160816; b=ipEt4fkm+GH1J8F48S8l1RYdKlA44gol/hCUv0Lkd5jH/MONKphCimckar8/BQtgWH S8gF3DYUw7eyMXl+ocYHyLzAGYcSenEcj4AR5OyZP7Vh/fqq/jQsZXlhzD/fxNU2XgDH 9fhijph7xXyxxqpyGaAOzEzfqIy8YmrzJdJLsPz8QdVxgrgZFQ38XWv4nQ1WbW2crpQA 4MB8pg/Jkc9uB/RnxHMVNk222dKSkOkrMAuL2IGPkPyO9YK7y0UWxVB3/42ihg7j1s6E Fb422V9oSSdFpj94joFSxHdnDZpN77xaBMGgYv7T7k24OzEeSw5PgeS+/eeHbZFfYkQr MZgA== 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=rOepe/KdR96o0n73PSpAxSLf7Ou1tqAd4//EDFDVxLDveQhwkuOFOki/eBfVPkfJbG py6siAWEQpcsSMSThXNYtZ6nJfVCFN9ritpaXFfFWLjSRFTNyFhq8Z1W1B4wUlnZDLjB MmIOLj9LPdHASPAsoxp8Df9MWkDB2bMXAgvveOCp+g8F2Y2nZaquS0d5AXPDfBnLAyht eW/+65wXPlN1E3wDRaqi3mi+MiNdxv7wDP2NcB7kgDVew9uvnyPLPtZpCBV6LDmNAoOL +MrmmyDfwW2QlRCFtMwiZAEZELwBJdOXU9CxHe6FarOcEYvMJebWhnRY7Ex5Wx3jD6C0 8X6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=DXAWprsj; 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 u7si608145edx.172.2021.01.27.00.24.27; Wed, 27 Jan 2021 00:24:51 -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=DXAWprsj; 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 S231825AbhA0GUQ (ORCPT + 99 others); Wed, 27 Jan 2021 01:20:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233419AbhA0F7O (ORCPT ); Wed, 27 Jan 2021 00:59:14 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39C88C06178C for ; Tue, 26 Jan 2021 21:57:39 -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=DXAWprsjagNiSZjwKwEHfiyzzT ZvgGjCwwMCiRtgXejvImCnKvhV9h3pxlCqAnO4JBQXn0YV4AA0QYKI3rP0LoEuEw+1fXy0rB5EHoE 7AIgUXw+VVGQVqMhHhMDbaE4ro8GWv/CsKvPR8reSUt8VSzGghCTZdmWkBW2EQAN5qZo=; 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 1l4dph-00083z-M7; Wed, 27 Jan 2021 06:57:37 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH RESEND v2 5/6] mac80211: minstrel_ht: show sampling rates in debugfs Date: Wed, 27 Jan 2021 06:57:34 +0100 Message-Id: <20210127055735.78599-5-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210127055735.78599-1-nbd@nbd.name> References: <20210127055735.78599-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