[PATCH 011/379][SRU][OEM-5.6] mac80211: allow setting queue_len for drivers not using wake_tx_queue
You-Sheng Yang
vicamo.yang at canonical.com
Wed Dec 23 08:45:44 UTC 2020
From: John Crispin <john at phrozen.org>
BugLink: https://bugs.launchpad.net/bugs/1879633
Currently a mac80211 driver can only set the txq_limit when using
wake_tx_queue. Not all drivers use wake_tx_queue. This patch adds a new
element to wiphy allowing a driver to set a custom tx_queue_len and the
code that will apply it in case it is set. The current default is
1000 which is too low for ath11k when doing HE rates.
Signed-off-by: John Crispin <john at phrozen.org>
Link: https://lore.kernel.org/r/20200211122605.13002-1-john@phrozen.org
Signed-off-by: Johannes Berg <johannes.berg at intel.com>
(cherry picked from commit 1f6e0baa703d31002c312c3e423c108b04325df0)
Signed-off-by: You-Sheng Yang <vicamo.yang at canonical.com>
---
include/net/cfg80211.h | 2 ++
net/mac80211/iface.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0810ddd0ebf5..5f01017a9e56 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4715,6 +4715,8 @@ struct wiphy {
u32 txq_memory_limit;
u32 txq_quantum;
+ unsigned long tx_queue_len;
+
u8 support_mbssid:1,
support_only_he_mbssid:1;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 9b833e170c20..339d153e6951 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1839,6 +1839,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
if_setup, txqs, 1);
if (!ndev)
return -ENOMEM;
+
+ if (!local->ops->wake_tx_queue && local->hw.wiphy->tx_queue_len)
+ ndev->tx_queue_len = local->hw.wiphy->tx_queue_len;
+
dev_net_set(ndev, wiphy_net(local->hw.wiphy));
ndev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
--
2.29.2
More information about the kernel-team
mailing list