linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>
Subject: [PATCH 04/12] wifi: mt76: mt7915: debugfs hook to enable TXS for NO_SKB pkt-ids
Date: Wed, 25 Oct 2023 12:03:46 -0700	[thread overview]
Message-ID: <20231025190351.2141832-4-greearb@candelatech.com> (raw)
In-Reply-To: <20231025190351.2141832-1-greearb@candelatech.com>

From: Ben Greear <greearb@candelatech.com>

This lets user turn on/off this feature.  Enabling gives better
tx-rate related stats, but will cause extra driver and (maybe)
firmware work.  Not sure if it actually affects performance or
not.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 drivers/net/wireless/mediatek/mt76/debugfs.c  | 25 +++++++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt76.h     |  6 +++++
 .../wireless/mediatek/mt76/mt76_connac_mac.c  |  3 ++-
 3 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/debugfs.c b/drivers/net/wireless/mediatek/mt76/debugfs.c
index 8012732e3bb8..7d92cfb0a501 100644
--- a/drivers/net/wireless/mediatek/mt76/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/debugfs.c
@@ -89,6 +89,30 @@ static int mt76_rx_queues_read(struct seq_file *s, void *data)
 	return 0;
 }
 
+static int
+mt7915_txs_for_no_skb_set(void *data, u64 val)
+{
+	struct mt76_dev *dev = data;
+
+	dev->txs_for_no_skb_enabled = !!val;
+
+	return 0;
+}
+
+static int
+mt7915_txs_for_no_skb_get(void *data, u64 *val)
+{
+	struct mt76_dev *dev = data;
+
+	*val = dev->txs_for_no_skb_enabled;
+
+	return 0;
+}
+
+DEFINE_DEBUGFS_ATTRIBUTE(fops_txs_for_no_skb, mt7915_txs_for_no_skb_get,
+			 mt7915_txs_for_no_skb_set, "%lld\n");
+
+
 void mt76_seq_puts_array(struct seq_file *file, const char *str,
 			 s8 *val, int len)
 {
@@ -116,6 +140,7 @@ mt76_register_debugfs_fops(struct mt76_phy *phy,
 	debugfs_create_file_unsafe("regval", 0600, dir, dev, fops);
 	debugfs_create_file_unsafe("napi_threaded", 0600, dir, dev,
 				   &fops_napi_threaded);
+	debugfs_create_file("force_txs", 0600, dir, dev, &fops_txs_for_no_skb);
 	debugfs_create_blob("eeprom", 0400, dir, &dev->eeprom);
 	if (dev->otp.data)
 		debugfs_create_blob("otp", 0400, dir, &dev->otp);
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 9b30d4aab952..d00a2da8d2f1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -860,6 +860,12 @@ struct mt76_dev {
 
 	u8 csa_complete;
 
+	/* Should we request TXS for MT_PACKET_ID_NO_SKB?  Doing so gives better
+	 * costs but causes a great deal more TXS packet processing by driver and
+	 * creation by firmware, so may be a performance drag.
+	 */
+	bool txs_for_no_skb_enabled;
+
 	u32 rxfilter;
 
 #ifdef CONFIG_NL80211_TESTMODE
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
index c080b60327b1..ab9a4d9fecdb 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
@@ -541,7 +541,8 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
 	txwi[4] = 0;
 
 	val = FIELD_PREP(MT_TXD5_PID, pid);
-	if (pid >= MT_PACKET_ID_FIRST) {
+	if (pid >= MT_PACKET_ID_FIRST ||
+	    (pid == MT_PACKET_ID_NO_SKB && dev->txs_for_no_skb_enabled)) {
 		val |= MT_TXD5_TX_STATUS_HOST;
 		amsdu_en = amsdu_en && !is_mt7921(dev);
 	}
-- 
2.40.0


  parent reply	other threads:[~2023-10-25 19:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 19:03 [PATCH 01/12] wifi: mt76: mt7915: print out hw revision greearb
2023-10-25 19:03 ` [PATCH 02/12] wifi: mt76: mt7915: cache sgi in wcid greearb
2023-10-25 19:03 ` [PATCH 03/12] wifi: mt76: mt7915: allow processing TXS for 'NO_SKB' pkt-ids greearb
2023-10-25 19:03 ` greearb [this message]
2023-10-25 19:03 ` [PATCH 05/12] wifi: mt76: mt7915: report tx-retries greearb
2023-10-25 19:03 ` [PATCH 06/12] wifi: mt76: mt7915: add support for tx-overrides greearb
2023-10-25 19:03 ` [PATCH 07/12] wifi: mt76: mt7915: support enabling rx group-5 status greearb
2023-10-25 19:03 ` [PATCH 08/12] wifi: mt76: mt7915: use nss for calculating rx-chains greearb
2023-10-25 19:03 ` [PATCH 09/12] wifi: mt76: mt7915: ethtool group-5 rx stats information greearb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231025190351.2141832-4-greearb@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).