All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: allow setting queue_len for drivers not using wake_tx_queue
@ 2020-02-11 12:26 ` John Crispin
  0 siblings, 0 replies; 8+ messages in thread
From: John Crispin @ 2020-02-11 12:26 UTC (permalink / raw)
  To: Johannes Berg, Kalle Valo; +Cc: linux-wireless, ath11k, John Crispin

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@phrozen.org>
---
 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 0939645567e9..254080a04ee3 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4742,6 +4742,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 3c00408e9c8c..128b3468d13e 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1834,6 +1834,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.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/2] mac80211: allow setting queue_len for drivers not using wake_tx_queue
@ 2020-02-11 12:26 ` John Crispin
  0 siblings, 0 replies; 8+ messages in thread
From: John Crispin @ 2020-02-11 12:26 UTC (permalink / raw)
  To: Johannes Berg, Kalle Valo; +Cc: linux-wireless, ath11k, John Crispin

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@phrozen.org>
---
 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 0939645567e9..254080a04ee3 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4742,6 +4742,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 3c00408e9c8c..128b3468d13e 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1834,6 +1834,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.20.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ath11k: set queue_len to 4096
  2020-02-11 12:26 ` John Crispin
@ 2020-02-11 12:26   ` John Crispin
  -1 siblings, 0 replies; 8+ messages in thread
From: John Crispin @ 2020-02-11 12:26 UTC (permalink / raw)
  To: Johannes Berg, Kalle Valo; +Cc: linux-wireless, ath11k, John Crispin

The driver currently does not use wake_txq_queue. This leads to the
tx_queue_len being defaulted to 1000. Setting this parameter will
change the queue_len to 4096 which is more fitting for HE.

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/hw.h  | 1 +
 drivers/net/wireless/ath/ath11k/mac.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
index dd39333ec0ea..9973477ae373 100644
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -62,6 +62,7 @@
 #define TARGET_RX_BATCHMODE		1
 
 #define ATH11K_HW_MAX_QUEUES		4
+#define ATH11K_QUEUE_LEN		4096
 
 #define ATH11k_HW_RATECODE_CCK_SHORT_PREAM_MASK  0x4
 
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 139ecbcf0179..c0606e4a8967 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -6025,6 +6025,7 @@ static int __ath11k_mac_register(struct ath11k *ar)
 	ar->hw->wiphy->max_ap_assoc_sta = ar->max_num_stations;
 
 	ar->hw->queues = ATH11K_HW_MAX_QUEUES;
+	ar->hw->wiphy->tx_queue_len = ATH11K_QUEUE_LEN;
 	ar->hw->offchannel_tx_hw_queue = ATH11K_HW_MAX_QUEUES - 1;
 	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ath11k: set queue_len to 4096
@ 2020-02-11 12:26   ` John Crispin
  0 siblings, 0 replies; 8+ messages in thread
From: John Crispin @ 2020-02-11 12:26 UTC (permalink / raw)
  To: Johannes Berg, Kalle Valo; +Cc: linux-wireless, ath11k, John Crispin

The driver currently does not use wake_txq_queue. This leads to the
tx_queue_len being defaulted to 1000. Setting this parameter will
change the queue_len to 4096 which is more fitting for HE.

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/net/wireless/ath/ath11k/hw.h  | 1 +
 drivers/net/wireless/ath/ath11k/mac.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
index dd39333ec0ea..9973477ae373 100644
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -62,6 +62,7 @@
 #define TARGET_RX_BATCHMODE		1
 
 #define ATH11K_HW_MAX_QUEUES		4
+#define ATH11K_QUEUE_LEN		4096
 
 #define ATH11k_HW_RATECODE_CCK_SHORT_PREAM_MASK  0x4
 
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 139ecbcf0179..c0606e4a8967 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -6025,6 +6025,7 @@ static int __ath11k_mac_register(struct ath11k *ar)
 	ar->hw->wiphy->max_ap_assoc_sta = ar->max_num_stations;
 
 	ar->hw->queues = ATH11K_HW_MAX_QUEUES;
+	ar->hw->wiphy->tx_queue_len = ATH11K_QUEUE_LEN;
 	ar->hw->offchannel_tx_hw_queue = ATH11K_HW_MAX_QUEUES - 1;
 	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF;
 
-- 
2.20.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mac80211: allow setting queue_len for drivers not using wake_tx_queue
  2020-02-11 12:26 ` John Crispin
@ 2020-02-11 12:29   ` Toke Høiland-Jørgensen
  -1 siblings, 0 replies; 8+ messages in thread
From: Toke Høiland-Jørgensen @ 2020-02-11 12:29 UTC (permalink / raw)
  To: John Crispin, Johannes Berg, Kalle Valo
  Cc: linux-wireless, ath11k, John Crispin

John Crispin <john@phrozen.org> writes:

> 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.

Fine, but we should really fix ath11k to do something smarter than a
fixed queue len... 4096 packets is 6 seconds of queueing at 8Mbps :/

-Toke


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] mac80211: allow setting queue_len for drivers not using wake_tx_queue
@ 2020-02-11 12:29   ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 8+ messages in thread
From: Toke Høiland-Jørgensen @ 2020-02-11 12:29 UTC (permalink / raw)
  To: John Crispin, Johannes Berg, Kalle Valo; +Cc: linux-wireless, ath11k

John Crispin <john@phrozen.org> writes:

> 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.

Fine, but we should really fix ath11k to do something smarter than a
fixed queue len... 4096 packets is 6 seconds of queueing at 8Mbps :/

-Toke


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ath11k: set queue_len to 4096
  2020-02-11 12:26   ` John Crispin
  (?)
  (?)
@ 2020-03-17  6:40   ` Kalle Valo
  -1 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2020-03-17  6:40 UTC (permalink / raw)
  To: John Crispin; +Cc: Johannes Berg, linux-wireless, ath11k, John Crispin

John Crispin <john@phrozen.org> wrote:

> The driver currently does not use wake_txq_queue. This leads to the
> tx_queue_len being defaulted to 1000. Setting this parameter will
> change the queue_len to 4096 which is more fitting for HE.
> 
> Signed-off-by: John Crispin <john@phrozen.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

107560d847e6 ath11k: set queue_len to 4096

-- 
https://patchwork.kernel.org/patch/11375351/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ath11k: set queue_len to 4096
  2020-02-11 12:26   ` John Crispin
  (?)
@ 2020-03-17  6:40   ` Kalle Valo
  -1 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2020-03-17  6:40 UTC (permalink / raw)
  To: John Crispin; +Cc: Johannes Berg, linux-wireless, ath11k

John Crispin <john@phrozen.org> wrote:

> The driver currently does not use wake_txq_queue. This leads to the
> tx_queue_len being defaulted to 1000. Setting this parameter will
> change the queue_len to 4096 which is more fitting for HE.
> 
> Signed-off-by: John Crispin <john@phrozen.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

107560d847e6 ath11k: set queue_len to 4096

-- 
https://patchwork.kernel.org/patch/11375351/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-03-17  6:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 12:26 [PATCH 1/2] mac80211: allow setting queue_len for drivers not using wake_tx_queue John Crispin
2020-02-11 12:26 ` John Crispin
2020-02-11 12:26 ` [PATCH 2/2] ath11k: set queue_len to 4096 John Crispin
2020-02-11 12:26   ` John Crispin
2020-03-17  6:40   ` Kalle Valo
2020-03-17  6:40   ` Kalle Valo
2020-02-11 12:29 ` [PATCH 1/2] mac80211: allow setting queue_len for drivers not using wake_tx_queue Toke Høiland-Jørgensen
2020-02-11 12:29   ` Toke Høiland-Jørgensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.