All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] wifi: ath12k: some improvement to RX throughput
@ 2023-11-28  2:54 ` Baochen Qiang
  0 siblings, 0 replies; 11+ messages in thread
From: Baochen Qiang @ 2023-11-28  2:54 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

Some fields of hal_reo_update_rx_queue are wrongly
defined, fix it in the first patch.

Currently the maximum block ACK window size is 256,
with the second patch, it is extended to BA1024.

The small MAC buffer ring becomes the bottle neck
in RX throughput test, so enlarge its size to get
a better peak result. This is done is the third patch.

With above three changes, more than 6% increase is
seen in RX throughput test.

Baochen Qiang (3):
  wifi: ath12k: fix wrong definitions of hal_reo_update_rx_queue
  wifi: ath12k: add support for BA1024
  wifi: ath12k: change MAC buffer ring size to 2048

 drivers/net/wireless/ath/ath12k/dp.h       |  3 +-
 drivers/net/wireless/ath/ath12k/dp_rx.c    |  2 +-
 drivers/net/wireless/ath/ath12k/hal_desc.h | 42 ++++++++++++++++++----
 drivers/net/wireless/ath/ath12k/hal_rx.c   | 11 ++++--
 drivers/net/wireless/ath/ath12k/mac.c      |  2 +-
 5 files changed, 47 insertions(+), 13 deletions(-)


base-commit: 16a212b4f33c4edd9ce9a9e0953b5389216e8ed9
-- 
2.25.1


-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

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

* [PATCH 0/3] wifi: ath12k: some improvement to RX throughput
@ 2023-11-28  2:54 ` Baochen Qiang
  0 siblings, 0 replies; 11+ messages in thread
From: Baochen Qiang @ 2023-11-28  2:54 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

Some fields of hal_reo_update_rx_queue are wrongly
defined, fix it in the first patch.

Currently the maximum block ACK window size is 256,
with the second patch, it is extended to BA1024.

The small MAC buffer ring becomes the bottle neck
in RX throughput test, so enlarge its size to get
a better peak result. This is done is the third patch.

With above three changes, more than 6% increase is
seen in RX throughput test.

Baochen Qiang (3):
  wifi: ath12k: fix wrong definitions of hal_reo_update_rx_queue
  wifi: ath12k: add support for BA1024
  wifi: ath12k: change MAC buffer ring size to 2048

 drivers/net/wireless/ath/ath12k/dp.h       |  3 +-
 drivers/net/wireless/ath/ath12k/dp_rx.c    |  2 +-
 drivers/net/wireless/ath/ath12k/hal_desc.h | 42 ++++++++++++++++++----
 drivers/net/wireless/ath/ath12k/hal_rx.c   | 11 ++++--
 drivers/net/wireless/ath/ath12k/mac.c      |  2 +-
 5 files changed, 47 insertions(+), 13 deletions(-)


base-commit: 16a212b4f33c4edd9ce9a9e0953b5389216e8ed9
-- 
2.25.1


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

* [PATCH 1/3] wifi: ath12k: fix wrong definitions of hal_reo_update_rx_queue
  2023-11-28  2:54 ` Baochen Qiang
@ 2023-11-28  2:54   ` Baochen Qiang
  -1 siblings, 0 replies; 11+ messages in thread
From: Baochen Qiang @ 2023-11-28  2:54 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

Some fields of hal_reo_update_rx_queue structure are wrongly
defined, so fix it.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/hal_desc.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/hal_desc.h b/drivers/net/wireless/ath/ath12k/hal_desc.h
index 6c17adc6d60b..ec204939e50c 100644
--- a/drivers/net/wireless/ath/ath12k/hal_desc.h
+++ b/drivers/net/wireless/ath/ath12k/hal_desc.h
@@ -2500,13 +2500,13 @@ struct hal_rx_reo_queue {
 #define HAL_REO_UPD_RX_QUEUE_INFO1_PN_HANDLE_ENABLE		BIT(30)
 #define HAL_REO_UPD_RX_QUEUE_INFO1_IGNORE_AMPDU_FLG		BIT(31)
 
-#define HAL_REO_UPD_RX_QUEUE_INFO2_BA_WINDOW_SIZE		GENMASK(7, 0)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_SIZE			GENMASK(9, 8)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_SVLD				BIT(10)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_SSN				GENMASK(22, 11)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_SEQ_2K_ERR			BIT(23)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_ERR			BIT(24)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_VALID			BIT(25)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_BA_WINDOW_SIZE		GENMASK(9, 0)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_SIZE			GENMASK(11, 10)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_SVLD				BIT(12)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_SSN				GENMASK(24, 13)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_SEQ_2K_ERR			BIT(25)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_ERR			BIT(26)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_VALID			BIT(27)
 
 struct hal_reo_update_rx_queue {
 	struct hal_reo_cmd_hdr cmd;
-- 
2.25.1


-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

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

* [PATCH 1/3] wifi: ath12k: fix wrong definitions of hal_reo_update_rx_queue
@ 2023-11-28  2:54   ` Baochen Qiang
  0 siblings, 0 replies; 11+ messages in thread
From: Baochen Qiang @ 2023-11-28  2:54 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

Some fields of hal_reo_update_rx_queue structure are wrongly
defined, so fix it.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/hal_desc.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/hal_desc.h b/drivers/net/wireless/ath/ath12k/hal_desc.h
index 6c17adc6d60b..ec204939e50c 100644
--- a/drivers/net/wireless/ath/ath12k/hal_desc.h
+++ b/drivers/net/wireless/ath/ath12k/hal_desc.h
@@ -2500,13 +2500,13 @@ struct hal_rx_reo_queue {
 #define HAL_REO_UPD_RX_QUEUE_INFO1_PN_HANDLE_ENABLE		BIT(30)
 #define HAL_REO_UPD_RX_QUEUE_INFO1_IGNORE_AMPDU_FLG		BIT(31)
 
-#define HAL_REO_UPD_RX_QUEUE_INFO2_BA_WINDOW_SIZE		GENMASK(7, 0)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_SIZE			GENMASK(9, 8)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_SVLD				BIT(10)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_SSN				GENMASK(22, 11)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_SEQ_2K_ERR			BIT(23)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_ERR			BIT(24)
-#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_VALID			BIT(25)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_BA_WINDOW_SIZE		GENMASK(9, 0)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_SIZE			GENMASK(11, 10)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_SVLD				BIT(12)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_SSN				GENMASK(24, 13)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_SEQ_2K_ERR			BIT(25)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_ERR			BIT(26)
+#define HAL_REO_UPD_RX_QUEUE_INFO2_PN_VALID			BIT(27)
 
 struct hal_reo_update_rx_queue {
 	struct hal_reo_cmd_hdr cmd;
-- 
2.25.1


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

* [PATCH 2/3] wifi: ath12k: add support for BA1024
  2023-11-28  2:54 ` Baochen Qiang
@ 2023-11-28  2:54   ` Baochen Qiang
  -1 siblings, 0 replies; 11+ messages in thread
From: Baochen Qiang @ 2023-11-28  2:54 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

Currently the maximum block ACK window size supported is 256.
This results in that, when connected to an AP which supports
larger BA sizes like BA512 or BA1024, only BA256 is
established, leading to a lower peak throughput.

So add support for BA1024, this is doen by allocating a larger
REO queue and advertising IEEE80211_MAX_AMPDU_BUF_EHT support
to MAC80211.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp.h       |  2 +-
 drivers/net/wireless/ath/ath12k/hal_desc.h | 28 ++++++++++++++++++++++
 drivers/net/wireless/ath/ath12k/hal_rx.c   | 11 ++++++---
 drivers/net/wireless/ath/ath12k/mac.c      |  2 +-
 4 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
index 61f765432516..50db1403ebce 100644
--- a/drivers/net/wireless/ath/ath12k/dp.h
+++ b/drivers/net/wireless/ath/ath12k/dp.h
@@ -145,7 +145,7 @@ struct ath12k_pdev_dp {
 
 #define DP_RX_HASH_ENABLE	1 /* Enable hash based Rx steering */
 
-#define DP_BA_WIN_SZ_MAX	256
+#define DP_BA_WIN_SZ_MAX	1024
 
 #define DP_TCL_NUM_RING_MAX	4
 
diff --git a/drivers/net/wireless/ath/ath12k/hal_desc.h b/drivers/net/wireless/ath/ath12k/hal_desc.h
index ec204939e50c..f12977aa6afe 100644
--- a/drivers/net/wireless/ath/ath12k/hal_desc.h
+++ b/drivers/net/wireless/ath/ath12k/hal_desc.h
@@ -2517,6 +2517,34 @@ struct hal_reo_update_rx_queue {
 	__le32 pn[4];
 } __packed;
 
+struct hal_rx_reo_queue_1k {
+	struct hal_desc_header desc_hdr;
+	__le32 rx_bitmap_319_288;
+	__le32 rx_bitmap_351_320;
+	__le32 rx_bitmap_383_352;
+	__le32 rx_bitmap_415_384;
+	__le32 rx_bitmap_447_416;
+	__le32 rx_bitmap_479_448;
+	__le32 rx_bitmap_511_480;
+	__le32 rx_bitmap_543_512;
+	__le32 rx_bitmap_575_544;
+	__le32 rx_bitmap_607_576;
+	__le32 rx_bitmap_639_608;
+	__le32 rx_bitmap_671_640;
+	__le32 rx_bitmap_703_672;
+	__le32 rx_bitmap_735_704;
+	__le32 rx_bitmap_767_736;
+	__le32 rx_bitmap_799_768;
+	__le32 rx_bitmap_831_800;
+	__le32 rx_bitmap_863_832;
+	__le32 rx_bitmap_895_864;
+	__le32 rx_bitmap_927_896;
+	__le32 rx_bitmap_959_928;
+	__le32 rx_bitmap_991_960;
+	__le32 rx_bitmap_1023_992;
+	__le32 reserved[8];
+} __packed;
+
 #define HAL_REO_UNBLOCK_CACHE_INFO0_UNBLK_CACHE		BIT(0)
 #define HAL_REO_UNBLOCK_CACHE_INFO0_RESOURCE_IDX	GENMASK(2, 1)
 
diff --git a/drivers/net/wireless/ath/ath12k/hal_rx.c b/drivers/net/wireless/ath/ath12k/hal_rx.c
index f6afbd8196bf..6fa874a93d3a 100644
--- a/drivers/net/wireless/ath/ath12k/hal_rx.c
+++ b/drivers/net/wireless/ath/ath12k/hal_rx.c
@@ -688,23 +688,28 @@ void ath12k_hal_reo_update_rx_reo_queue_status(struct ath12k_base *ab,
 
 u32 ath12k_hal_reo_qdesc_size(u32 ba_window_size, u8 tid)
 {
-	u32 num_ext_desc;
+	u32 num_ext_desc, num_1k_desc = 0;
 
 	if (ba_window_size <= 1) {
 		if (tid != HAL_DESC_REO_NON_QOS_TID)
 			num_ext_desc = 1;
 		else
 			num_ext_desc = 0;
+
 	} else if (ba_window_size <= 105) {
 		num_ext_desc = 1;
 	} else if (ba_window_size <= 210) {
 		num_ext_desc = 2;
-	} else {
+	} else if (ba_window_size <= 256) {
 		num_ext_desc = 3;
+	} else {
+		num_ext_desc = 10;
+		num_1k_desc = 1;
 	}
 
 	return sizeof(struct hal_rx_reo_queue) +
-		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext));
+		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext)) +
+		(num_1k_desc * sizeof(struct hal_rx_reo_queue_1k));
 }
 
 void ath12k_hal_reo_qdesc_setup(struct hal_rx_reo_queue *qdesc,
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index fc0d14ea328e..3cfb17f71aa6 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -7474,7 +7474,7 @@ static int __ath12k_mac_register(struct ath12k *ar)
 	ar->hw->queues = ATH12K_HW_MAX_QUEUES;
 	ar->hw->wiphy->tx_queue_len = ATH12K_QUEUE_LEN;
 	ar->hw->offchannel_tx_hw_queue = ATH12K_HW_MAX_QUEUES - 1;
-	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
+	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_EHT;
 
 	ar->hw->vif_data_size = sizeof(struct ath12k_vif);
 	ar->hw->sta_data_size = sizeof(struct ath12k_sta);
-- 
2.25.1


-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

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

* [PATCH 2/3] wifi: ath12k: add support for BA1024
@ 2023-11-28  2:54   ` Baochen Qiang
  0 siblings, 0 replies; 11+ messages in thread
From: Baochen Qiang @ 2023-11-28  2:54 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

Currently the maximum block ACK window size supported is 256.
This results in that, when connected to an AP which supports
larger BA sizes like BA512 or BA1024, only BA256 is
established, leading to a lower peak throughput.

So add support for BA1024, this is doen by allocating a larger
REO queue and advertising IEEE80211_MAX_AMPDU_BUF_EHT support
to MAC80211.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp.h       |  2 +-
 drivers/net/wireless/ath/ath12k/hal_desc.h | 28 ++++++++++++++++++++++
 drivers/net/wireless/ath/ath12k/hal_rx.c   | 11 ++++++---
 drivers/net/wireless/ath/ath12k/mac.c      |  2 +-
 4 files changed, 38 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
index 61f765432516..50db1403ebce 100644
--- a/drivers/net/wireless/ath/ath12k/dp.h
+++ b/drivers/net/wireless/ath/ath12k/dp.h
@@ -145,7 +145,7 @@ struct ath12k_pdev_dp {
 
 #define DP_RX_HASH_ENABLE	1 /* Enable hash based Rx steering */
 
-#define DP_BA_WIN_SZ_MAX	256
+#define DP_BA_WIN_SZ_MAX	1024
 
 #define DP_TCL_NUM_RING_MAX	4
 
diff --git a/drivers/net/wireless/ath/ath12k/hal_desc.h b/drivers/net/wireless/ath/ath12k/hal_desc.h
index ec204939e50c..f12977aa6afe 100644
--- a/drivers/net/wireless/ath/ath12k/hal_desc.h
+++ b/drivers/net/wireless/ath/ath12k/hal_desc.h
@@ -2517,6 +2517,34 @@ struct hal_reo_update_rx_queue {
 	__le32 pn[4];
 } __packed;
 
+struct hal_rx_reo_queue_1k {
+	struct hal_desc_header desc_hdr;
+	__le32 rx_bitmap_319_288;
+	__le32 rx_bitmap_351_320;
+	__le32 rx_bitmap_383_352;
+	__le32 rx_bitmap_415_384;
+	__le32 rx_bitmap_447_416;
+	__le32 rx_bitmap_479_448;
+	__le32 rx_bitmap_511_480;
+	__le32 rx_bitmap_543_512;
+	__le32 rx_bitmap_575_544;
+	__le32 rx_bitmap_607_576;
+	__le32 rx_bitmap_639_608;
+	__le32 rx_bitmap_671_640;
+	__le32 rx_bitmap_703_672;
+	__le32 rx_bitmap_735_704;
+	__le32 rx_bitmap_767_736;
+	__le32 rx_bitmap_799_768;
+	__le32 rx_bitmap_831_800;
+	__le32 rx_bitmap_863_832;
+	__le32 rx_bitmap_895_864;
+	__le32 rx_bitmap_927_896;
+	__le32 rx_bitmap_959_928;
+	__le32 rx_bitmap_991_960;
+	__le32 rx_bitmap_1023_992;
+	__le32 reserved[8];
+} __packed;
+
 #define HAL_REO_UNBLOCK_CACHE_INFO0_UNBLK_CACHE		BIT(0)
 #define HAL_REO_UNBLOCK_CACHE_INFO0_RESOURCE_IDX	GENMASK(2, 1)
 
diff --git a/drivers/net/wireless/ath/ath12k/hal_rx.c b/drivers/net/wireless/ath/ath12k/hal_rx.c
index f6afbd8196bf..6fa874a93d3a 100644
--- a/drivers/net/wireless/ath/ath12k/hal_rx.c
+++ b/drivers/net/wireless/ath/ath12k/hal_rx.c
@@ -688,23 +688,28 @@ void ath12k_hal_reo_update_rx_reo_queue_status(struct ath12k_base *ab,
 
 u32 ath12k_hal_reo_qdesc_size(u32 ba_window_size, u8 tid)
 {
-	u32 num_ext_desc;
+	u32 num_ext_desc, num_1k_desc = 0;
 
 	if (ba_window_size <= 1) {
 		if (tid != HAL_DESC_REO_NON_QOS_TID)
 			num_ext_desc = 1;
 		else
 			num_ext_desc = 0;
+
 	} else if (ba_window_size <= 105) {
 		num_ext_desc = 1;
 	} else if (ba_window_size <= 210) {
 		num_ext_desc = 2;
-	} else {
+	} else if (ba_window_size <= 256) {
 		num_ext_desc = 3;
+	} else {
+		num_ext_desc = 10;
+		num_1k_desc = 1;
 	}
 
 	return sizeof(struct hal_rx_reo_queue) +
-		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext));
+		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext)) +
+		(num_1k_desc * sizeof(struct hal_rx_reo_queue_1k));
 }
 
 void ath12k_hal_reo_qdesc_setup(struct hal_rx_reo_queue *qdesc,
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index fc0d14ea328e..3cfb17f71aa6 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -7474,7 +7474,7 @@ static int __ath12k_mac_register(struct ath12k *ar)
 	ar->hw->queues = ATH12K_HW_MAX_QUEUES;
 	ar->hw->wiphy->tx_queue_len = ATH12K_QUEUE_LEN;
 	ar->hw->offchannel_tx_hw_queue = ATH12K_HW_MAX_QUEUES - 1;
-	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
+	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_EHT;
 
 	ar->hw->vif_data_size = sizeof(struct ath12k_vif);
 	ar->hw->sta_data_size = sizeof(struct ath12k_sta);
-- 
2.25.1


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

* [PATCH 3/3] wifi: ath12k: change MAC buffer ring size to 2048
  2023-11-28  2:54 ` Baochen Qiang
@ 2023-11-28  2:54   ` Baochen Qiang
  -1 siblings, 0 replies; 11+ messages in thread
From: Baochen Qiang @ 2023-11-28  2:54 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

For WCN7850, there is a SRNG named MAC buffer ring, i.e.,
dp->rx_mac_buf_ring. During initialization, it is setup
by host and then under control of firmware. During RX
process, firmware fetches buffers from
dp->rx_refill_buf_ring to fill that MAC buffer ring,
and those buffers are taken by RXDMA to carry real WLAN
frames received from air.

Currently a low RX throughput is observed. Checking
firmware log, lots of errors are reported by MAC buffer
ring, complaining that it is running out of buffers,
which further indicates that RXDMA is suffering from
starvation. Currently the size of dp->rx_mac_buf_ring
is configured as 1024. After changing it to 2048, those
error messages are reduced, and a 6.4% increase is seen
in peak throughput. Note that 2048 is an empirical
value. It is chosen here because the RX throughput
meets our expectation after the change.

This change only applies to WCN7850 since other
chips don't have a MAC buffer ring.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp.h    | 1 +
 drivers/net/wireless/ath/ath12k/dp_rx.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
index 50db1403ebce..ce55cb550379 100644
--- a/drivers/net/wireless/ath/ath12k/dp.h
+++ b/drivers/net/wireless/ath/ath12k/dp.h
@@ -165,6 +165,7 @@ struct ath12k_pdev_dp {
 #define DP_REO_CMD_RING_SIZE		128
 #define DP_REO_STATUS_RING_SIZE		2048
 #define DP_RXDMA_BUF_RING_SIZE		4096
+#define DP_RX_MAC_BUF_RING_SIZE		2048
 #define DP_RXDMA_REFILL_RING_SIZE	2048
 #define DP_RXDMA_ERR_DST_RING_SIZE	1024
 #define DP_RXDMA_MON_STATUS_RING_SIZE	1024
diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index 9f831e3971f9..f6fbe867bbd4 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -4110,7 +4110,7 @@ int ath12k_dp_rx_alloc(struct ath12k_base *ab)
 			ret = ath12k_dp_srng_setup(ab,
 						   &dp->rx_mac_buf_ring[i],
 						   HAL_RXDMA_BUF, 1,
-						   i, 1024);
+						   i, DP_RX_MAC_BUF_RING_SIZE);
 			if (ret) {
 				ath12k_warn(ab, "failed to setup rx_mac_buf_ring %d\n",
 					    i);
-- 
2.25.1


-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

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

* [PATCH 3/3] wifi: ath12k: change MAC buffer ring size to 2048
@ 2023-11-28  2:54   ` Baochen Qiang
  0 siblings, 0 replies; 11+ messages in thread
From: Baochen Qiang @ 2023-11-28  2:54 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless

For WCN7850, there is a SRNG named MAC buffer ring, i.e.,
dp->rx_mac_buf_ring. During initialization, it is setup
by host and then under control of firmware. During RX
process, firmware fetches buffers from
dp->rx_refill_buf_ring to fill that MAC buffer ring,
and those buffers are taken by RXDMA to carry real WLAN
frames received from air.

Currently a low RX throughput is observed. Checking
firmware log, lots of errors are reported by MAC buffer
ring, complaining that it is running out of buffers,
which further indicates that RXDMA is suffering from
starvation. Currently the size of dp->rx_mac_buf_ring
is configured as 1024. After changing it to 2048, those
error messages are reduced, and a 6.4% increase is seen
in peak throughput. Note that 2048 is an empirical
value. It is chosen here because the RX throughput
meets our expectation after the change.

This change only applies to WCN7850 since other
chips don't have a MAC buffer ring.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/dp.h    | 1 +
 drivers/net/wireless/ath/ath12k/dp_rx.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
index 50db1403ebce..ce55cb550379 100644
--- a/drivers/net/wireless/ath/ath12k/dp.h
+++ b/drivers/net/wireless/ath/ath12k/dp.h
@@ -165,6 +165,7 @@ struct ath12k_pdev_dp {
 #define DP_REO_CMD_RING_SIZE		128
 #define DP_REO_STATUS_RING_SIZE		2048
 #define DP_RXDMA_BUF_RING_SIZE		4096
+#define DP_RX_MAC_BUF_RING_SIZE		2048
 #define DP_RXDMA_REFILL_RING_SIZE	2048
 #define DP_RXDMA_ERR_DST_RING_SIZE	1024
 #define DP_RXDMA_MON_STATUS_RING_SIZE	1024
diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index 9f831e3971f9..f6fbe867bbd4 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -4110,7 +4110,7 @@ int ath12k_dp_rx_alloc(struct ath12k_base *ab)
 			ret = ath12k_dp_srng_setup(ab,
 						   &dp->rx_mac_buf_ring[i],
 						   HAL_RXDMA_BUF, 1,
-						   i, 1024);
+						   i, DP_RX_MAC_BUF_RING_SIZE);
 			if (ret) {
 				ath12k_warn(ab, "failed to setup rx_mac_buf_ring %d\n",
 					    i);
-- 
2.25.1


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

* Re: [PATCH 2/3] wifi: ath12k: add support for BA1024
  2023-11-28  2:54   ` Baochen Qiang
@ 2023-11-28 15:47     ` Jeff Johnson
  -1 siblings, 0 replies; 11+ messages in thread
From: Jeff Johnson @ 2023-11-28 15:47 UTC (permalink / raw)
  To: Baochen Qiang, ath12k; +Cc: linux-wireless

On 11/27/2023 6:54 PM, Baochen Qiang wrote:
> Currently the maximum block ACK window size supported is 256.
> This results in that, when connected to an AP which supports
> larger BA sizes like BA512 or BA1024, only BA256 is
> established, leading to a lower peak throughput.
> 
> So add support for BA1024, this is doen by allocating a larger

nit: s/doen/done/

> REO queue and advertising IEEE80211_MAX_AMPDU_BUF_EHT support
> to MAC80211.
> 
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
> 
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
> ---
>  drivers/net/wireless/ath/ath12k/dp.h       |  2 +-
>  drivers/net/wireless/ath/ath12k/hal_desc.h | 28 ++++++++++++++++++++++
>  drivers/net/wireless/ath/ath12k/hal_rx.c   | 11 ++++++---
>  drivers/net/wireless/ath/ath12k/mac.c      |  2 +-
>  4 files changed, 38 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
> index 61f765432516..50db1403ebce 100644
> --- a/drivers/net/wireless/ath/ath12k/dp.h
> +++ b/drivers/net/wireless/ath/ath12k/dp.h
> @@ -145,7 +145,7 @@ struct ath12k_pdev_dp {
>  
>  #define DP_RX_HASH_ENABLE	1 /* Enable hash based Rx steering */
>  
> -#define DP_BA_WIN_SZ_MAX	256
> +#define DP_BA_WIN_SZ_MAX	1024
>  
>  #define DP_TCL_NUM_RING_MAX	4
>  
> diff --git a/drivers/net/wireless/ath/ath12k/hal_desc.h b/drivers/net/wireless/ath/ath12k/hal_desc.h
> index ec204939e50c..f12977aa6afe 100644
> --- a/drivers/net/wireless/ath/ath12k/hal_desc.h
> +++ b/drivers/net/wireless/ath/ath12k/hal_desc.h
> @@ -2517,6 +2517,34 @@ struct hal_reo_update_rx_queue {
>  	__le32 pn[4];
>  } __packed;
>  
> +struct hal_rx_reo_queue_1k {
> +	struct hal_desc_header desc_hdr;
> +	__le32 rx_bitmap_319_288;

are these individual bitmap members ever directly referenced? seems it
would make more sense to have simply:
	__le32 rx_bitmap_1023_288[23]

this would align with struct hal_rx_reo_queue which defines:
	__le32 rx_bitmap[9]

> +	__le32 rx_bitmap_351_320;
> +	__le32 rx_bitmap_383_352;
> +	__le32 rx_bitmap_415_384;
> +	__le32 rx_bitmap_447_416;
> +	__le32 rx_bitmap_479_448;
> +	__le32 rx_bitmap_511_480;
> +	__le32 rx_bitmap_543_512;
> +	__le32 rx_bitmap_575_544;
> +	__le32 rx_bitmap_607_576;
> +	__le32 rx_bitmap_639_608;
> +	__le32 rx_bitmap_671_640;
> +	__le32 rx_bitmap_703_672;
> +	__le32 rx_bitmap_735_704;
> +	__le32 rx_bitmap_767_736;
> +	__le32 rx_bitmap_799_768;
> +	__le32 rx_bitmap_831_800;
> +	__le32 rx_bitmap_863_832;
> +	__le32 rx_bitmap_895_864;
> +	__le32 rx_bitmap_927_896;
> +	__le32 rx_bitmap_959_928;
> +	__le32 rx_bitmap_991_960;
> +	__le32 rx_bitmap_1023_992;
> +	__le32 reserved[8];
> +} __packed;
> +
>  #define HAL_REO_UNBLOCK_CACHE_INFO0_UNBLK_CACHE		BIT(0)
>  #define HAL_REO_UNBLOCK_CACHE_INFO0_RESOURCE_IDX	GENMASK(2, 1)
>  
> diff --git a/drivers/net/wireless/ath/ath12k/hal_rx.c b/drivers/net/wireless/ath/ath12k/hal_rx.c
> index f6afbd8196bf..6fa874a93d3a 100644
> --- a/drivers/net/wireless/ath/ath12k/hal_rx.c
> +++ b/drivers/net/wireless/ath/ath12k/hal_rx.c
> @@ -688,23 +688,28 @@ void ath12k_hal_reo_update_rx_reo_queue_status(struct ath12k_base *ab,
>  
>  u32 ath12k_hal_reo_qdesc_size(u32 ba_window_size, u8 tid)
>  {
> -	u32 num_ext_desc;
> +	u32 num_ext_desc, num_1k_desc = 0;
>  
>  	if (ba_window_size <= 1) {
>  		if (tid != HAL_DESC_REO_NON_QOS_TID)
>  			num_ext_desc = 1;
>  		else
>  			num_ext_desc = 0;
> +
>  	} else if (ba_window_size <= 105) {
>  		num_ext_desc = 1;
>  	} else if (ba_window_size <= 210) {
>  		num_ext_desc = 2;
> -	} else {
> +	} else if (ba_window_size <= 256) {
>  		num_ext_desc = 3;
> +	} else {
> +		num_ext_desc = 10;
> +		num_1k_desc = 1;
>  	}
>  
>  	return sizeof(struct hal_rx_reo_queue) +
> -		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext));
> +		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext)) +
> +		(num_1k_desc * sizeof(struct hal_rx_reo_queue_1k));
>  }
>  
>  void ath12k_hal_reo_qdesc_setup(struct hal_rx_reo_queue *qdesc,
> diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
> index fc0d14ea328e..3cfb17f71aa6 100644
> --- a/drivers/net/wireless/ath/ath12k/mac.c
> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> @@ -7474,7 +7474,7 @@ static int __ath12k_mac_register(struct ath12k *ar)
>  	ar->hw->queues = ATH12K_HW_MAX_QUEUES;
>  	ar->hw->wiphy->tx_queue_len = ATH12K_QUEUE_LEN;
>  	ar->hw->offchannel_tx_hw_queue = ATH12K_HW_MAX_QUEUES - 1;
> -	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
> +	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_EHT;
>  
>  	ar->hw->vif_data_size = sizeof(struct ath12k_vif);
>  	ar->hw->sta_data_size = sizeof(struct ath12k_sta);

Are any related changes needed to struct hal_reo_get_queue_stats_status?
Or to ath12k_hal_reo_status_queue_stats()?
There I see the 256-bit bitmap being dumped -- do you need to dump the
1024-bit bitmap? Is there a mechanism which allows that?



-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

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

* Re: [PATCH 2/3] wifi: ath12k: add support for BA1024
@ 2023-11-28 15:47     ` Jeff Johnson
  0 siblings, 0 replies; 11+ messages in thread
From: Jeff Johnson @ 2023-11-28 15:47 UTC (permalink / raw)
  To: Baochen Qiang, ath12k; +Cc: linux-wireless

On 11/27/2023 6:54 PM, Baochen Qiang wrote:
> Currently the maximum block ACK window size supported is 256.
> This results in that, when connected to an AP which supports
> larger BA sizes like BA512 or BA1024, only BA256 is
> established, leading to a lower peak throughput.
> 
> So add support for BA1024, this is doen by allocating a larger

nit: s/doen/done/

> REO queue and advertising IEEE80211_MAX_AMPDU_BUF_EHT support
> to MAC80211.
> 
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
> 
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
> ---
>  drivers/net/wireless/ath/ath12k/dp.h       |  2 +-
>  drivers/net/wireless/ath/ath12k/hal_desc.h | 28 ++++++++++++++++++++++
>  drivers/net/wireless/ath/ath12k/hal_rx.c   | 11 ++++++---
>  drivers/net/wireless/ath/ath12k/mac.c      |  2 +-
>  4 files changed, 38 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
> index 61f765432516..50db1403ebce 100644
> --- a/drivers/net/wireless/ath/ath12k/dp.h
> +++ b/drivers/net/wireless/ath/ath12k/dp.h
> @@ -145,7 +145,7 @@ struct ath12k_pdev_dp {
>  
>  #define DP_RX_HASH_ENABLE	1 /* Enable hash based Rx steering */
>  
> -#define DP_BA_WIN_SZ_MAX	256
> +#define DP_BA_WIN_SZ_MAX	1024
>  
>  #define DP_TCL_NUM_RING_MAX	4
>  
> diff --git a/drivers/net/wireless/ath/ath12k/hal_desc.h b/drivers/net/wireless/ath/ath12k/hal_desc.h
> index ec204939e50c..f12977aa6afe 100644
> --- a/drivers/net/wireless/ath/ath12k/hal_desc.h
> +++ b/drivers/net/wireless/ath/ath12k/hal_desc.h
> @@ -2517,6 +2517,34 @@ struct hal_reo_update_rx_queue {
>  	__le32 pn[4];
>  } __packed;
>  
> +struct hal_rx_reo_queue_1k {
> +	struct hal_desc_header desc_hdr;
> +	__le32 rx_bitmap_319_288;

are these individual bitmap members ever directly referenced? seems it
would make more sense to have simply:
	__le32 rx_bitmap_1023_288[23]

this would align with struct hal_rx_reo_queue which defines:
	__le32 rx_bitmap[9]

> +	__le32 rx_bitmap_351_320;
> +	__le32 rx_bitmap_383_352;
> +	__le32 rx_bitmap_415_384;
> +	__le32 rx_bitmap_447_416;
> +	__le32 rx_bitmap_479_448;
> +	__le32 rx_bitmap_511_480;
> +	__le32 rx_bitmap_543_512;
> +	__le32 rx_bitmap_575_544;
> +	__le32 rx_bitmap_607_576;
> +	__le32 rx_bitmap_639_608;
> +	__le32 rx_bitmap_671_640;
> +	__le32 rx_bitmap_703_672;
> +	__le32 rx_bitmap_735_704;
> +	__le32 rx_bitmap_767_736;
> +	__le32 rx_bitmap_799_768;
> +	__le32 rx_bitmap_831_800;
> +	__le32 rx_bitmap_863_832;
> +	__le32 rx_bitmap_895_864;
> +	__le32 rx_bitmap_927_896;
> +	__le32 rx_bitmap_959_928;
> +	__le32 rx_bitmap_991_960;
> +	__le32 rx_bitmap_1023_992;
> +	__le32 reserved[8];
> +} __packed;
> +
>  #define HAL_REO_UNBLOCK_CACHE_INFO0_UNBLK_CACHE		BIT(0)
>  #define HAL_REO_UNBLOCK_CACHE_INFO0_RESOURCE_IDX	GENMASK(2, 1)
>  
> diff --git a/drivers/net/wireless/ath/ath12k/hal_rx.c b/drivers/net/wireless/ath/ath12k/hal_rx.c
> index f6afbd8196bf..6fa874a93d3a 100644
> --- a/drivers/net/wireless/ath/ath12k/hal_rx.c
> +++ b/drivers/net/wireless/ath/ath12k/hal_rx.c
> @@ -688,23 +688,28 @@ void ath12k_hal_reo_update_rx_reo_queue_status(struct ath12k_base *ab,
>  
>  u32 ath12k_hal_reo_qdesc_size(u32 ba_window_size, u8 tid)
>  {
> -	u32 num_ext_desc;
> +	u32 num_ext_desc, num_1k_desc = 0;
>  
>  	if (ba_window_size <= 1) {
>  		if (tid != HAL_DESC_REO_NON_QOS_TID)
>  			num_ext_desc = 1;
>  		else
>  			num_ext_desc = 0;
> +
>  	} else if (ba_window_size <= 105) {
>  		num_ext_desc = 1;
>  	} else if (ba_window_size <= 210) {
>  		num_ext_desc = 2;
> -	} else {
> +	} else if (ba_window_size <= 256) {
>  		num_ext_desc = 3;
> +	} else {
> +		num_ext_desc = 10;
> +		num_1k_desc = 1;
>  	}
>  
>  	return sizeof(struct hal_rx_reo_queue) +
> -		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext));
> +		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext)) +
> +		(num_1k_desc * sizeof(struct hal_rx_reo_queue_1k));
>  }
>  
>  void ath12k_hal_reo_qdesc_setup(struct hal_rx_reo_queue *qdesc,
> diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
> index fc0d14ea328e..3cfb17f71aa6 100644
> --- a/drivers/net/wireless/ath/ath12k/mac.c
> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> @@ -7474,7 +7474,7 @@ static int __ath12k_mac_register(struct ath12k *ar)
>  	ar->hw->queues = ATH12K_HW_MAX_QUEUES;
>  	ar->hw->wiphy->tx_queue_len = ATH12K_QUEUE_LEN;
>  	ar->hw->offchannel_tx_hw_queue = ATH12K_HW_MAX_QUEUES - 1;
> -	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
> +	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_EHT;
>  
>  	ar->hw->vif_data_size = sizeof(struct ath12k_vif);
>  	ar->hw->sta_data_size = sizeof(struct ath12k_sta);

Are any related changes needed to struct hal_reo_get_queue_stats_status?
Or to ath12k_hal_reo_status_queue_stats()?
There I see the 256-bit bitmap being dumped -- do you need to dump the
1024-bit bitmap? Is there a mechanism which allows that?



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

* Re: [PATCH 2/3] wifi: ath12k: add support for BA1024
  2023-11-28 15:47     ` Jeff Johnson
  (?)
@ 2023-11-29  1:52     ` Baochen Qiang
  -1 siblings, 0 replies; 11+ messages in thread
From: Baochen Qiang @ 2023-11-29  1:52 UTC (permalink / raw)
  To: Jeff Johnson, ath12k; +Cc: linux-wireless



On 11/28/2023 11:47 PM, Jeff Johnson wrote:
> On 11/27/2023 6:54 PM, Baochen Qiang wrote:
>> Currently the maximum block ACK window size supported is 256.
>> This results in that, when connected to an AP which supports
>> larger BA sizes like BA512 or BA1024, only BA256 is
>> established, leading to a lower peak throughput.
>>
>> So add support for BA1024, this is doen by allocating a larger
> 
> nit: s/doen/done/
> 
>> REO queue and advertising IEEE80211_MAX_AMPDU_BUF_EHT support
>> to MAC80211.
>>
>> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
>>
>> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
>> ---
>>   drivers/net/wireless/ath/ath12k/dp.h       |  2 +-
>>   drivers/net/wireless/ath/ath12k/hal_desc.h | 28 ++++++++++++++++++++++
>>   drivers/net/wireless/ath/ath12k/hal_rx.c   | 11 ++++++---
>>   drivers/net/wireless/ath/ath12k/mac.c      |  2 +-
>>   4 files changed, 38 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath12k/dp.h b/drivers/net/wireless/ath/ath12k/dp.h
>> index 61f765432516..50db1403ebce 100644
>> --- a/drivers/net/wireless/ath/ath12k/dp.h
>> +++ b/drivers/net/wireless/ath/ath12k/dp.h
>> @@ -145,7 +145,7 @@ struct ath12k_pdev_dp {
>>   
>>   #define DP_RX_HASH_ENABLE	1 /* Enable hash based Rx steering */
>>   
>> -#define DP_BA_WIN_SZ_MAX	256
>> +#define DP_BA_WIN_SZ_MAX	1024
>>   
>>   #define DP_TCL_NUM_RING_MAX	4
>>   
>> diff --git a/drivers/net/wireless/ath/ath12k/hal_desc.h b/drivers/net/wireless/ath/ath12k/hal_desc.h
>> index ec204939e50c..f12977aa6afe 100644
>> --- a/drivers/net/wireless/ath/ath12k/hal_desc.h
>> +++ b/drivers/net/wireless/ath/ath12k/hal_desc.h
>> @@ -2517,6 +2517,34 @@ struct hal_reo_update_rx_queue {
>>   	__le32 pn[4];
>>   } __packed;
>>   
>> +struct hal_rx_reo_queue_1k {
>> +	struct hal_desc_header desc_hdr;
>> +	__le32 rx_bitmap_319_288;
> 
> are these individual bitmap members ever directly referenced? seems it
> would make more sense to have simply:
> 	__le32 rx_bitmap_1023_288[23]
> 
> this would align with struct hal_rx_reo_queue which defines:
> 	__le32 rx_bitmap[9]
> 
>> +	__le32 rx_bitmap_351_320;
>> +	__le32 rx_bitmap_383_352;
>> +	__le32 rx_bitmap_415_384;
>> +	__le32 rx_bitmap_447_416;
>> +	__le32 rx_bitmap_479_448;
>> +	__le32 rx_bitmap_511_480;
>> +	__le32 rx_bitmap_543_512;
>> +	__le32 rx_bitmap_575_544;
>> +	__le32 rx_bitmap_607_576;
>> +	__le32 rx_bitmap_639_608;
>> +	__le32 rx_bitmap_671_640;
>> +	__le32 rx_bitmap_703_672;
>> +	__le32 rx_bitmap_735_704;
>> +	__le32 rx_bitmap_767_736;
>> +	__le32 rx_bitmap_799_768;
>> +	__le32 rx_bitmap_831_800;
>> +	__le32 rx_bitmap_863_832;
>> +	__le32 rx_bitmap_895_864;
>> +	__le32 rx_bitmap_927_896;
>> +	__le32 rx_bitmap_959_928;
>> +	__le32 rx_bitmap_991_960;
>> +	__le32 rx_bitmap_1023_992;
>> +	__le32 reserved[8];
>> +} __packed;
>> +
>>   #define HAL_REO_UNBLOCK_CACHE_INFO0_UNBLK_CACHE		BIT(0)
>>   #define HAL_REO_UNBLOCK_CACHE_INFO0_RESOURCE_IDX	GENMASK(2, 1)
>>   
>> diff --git a/drivers/net/wireless/ath/ath12k/hal_rx.c b/drivers/net/wireless/ath/ath12k/hal_rx.c
>> index f6afbd8196bf..6fa874a93d3a 100644
>> --- a/drivers/net/wireless/ath/ath12k/hal_rx.c
>> +++ b/drivers/net/wireless/ath/ath12k/hal_rx.c
>> @@ -688,23 +688,28 @@ void ath12k_hal_reo_update_rx_reo_queue_status(struct ath12k_base *ab,
>>   
>>   u32 ath12k_hal_reo_qdesc_size(u32 ba_window_size, u8 tid)
>>   {
>> -	u32 num_ext_desc;
>> +	u32 num_ext_desc, num_1k_desc = 0;
>>   
>>   	if (ba_window_size <= 1) {
>>   		if (tid != HAL_DESC_REO_NON_QOS_TID)
>>   			num_ext_desc = 1;
>>   		else
>>   			num_ext_desc = 0;
>> +
>>   	} else if (ba_window_size <= 105) {
>>   		num_ext_desc = 1;
>>   	} else if (ba_window_size <= 210) {
>>   		num_ext_desc = 2;
>> -	} else {
>> +	} else if (ba_window_size <= 256) {
>>   		num_ext_desc = 3;
>> +	} else {
>> +		num_ext_desc = 10;
>> +		num_1k_desc = 1;
>>   	}
>>   
>>   	return sizeof(struct hal_rx_reo_queue) +
>> -		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext));
>> +		(num_ext_desc * sizeof(struct hal_rx_reo_queue_ext)) +
>> +		(num_1k_desc * sizeof(struct hal_rx_reo_queue_1k));
>>   }
>>   
>>   void ath12k_hal_reo_qdesc_setup(struct hal_rx_reo_queue *qdesc,
>> diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
>> index fc0d14ea328e..3cfb17f71aa6 100644
>> --- a/drivers/net/wireless/ath/ath12k/mac.c
>> +++ b/drivers/net/wireless/ath/ath12k/mac.c
>> @@ -7474,7 +7474,7 @@ static int __ath12k_mac_register(struct ath12k *ar)
>>   	ar->hw->queues = ATH12K_HW_MAX_QUEUES;
>>   	ar->hw->wiphy->tx_queue_len = ATH12K_QUEUE_LEN;
>>   	ar->hw->offchannel_tx_hw_queue = ATH12K_HW_MAX_QUEUES - 1;
>> -	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
>> +	ar->hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_EHT;
>>   
>>   	ar->hw->vif_data_size = sizeof(struct ath12k_vif);
>>   	ar->hw->sta_data_size = sizeof(struct ath12k_sta);
> 
> Are any related changes needed to struct hal_reo_get_queue_stats_status?
> Or to ath12k_hal_reo_status_queue_stats()?
> There I see the 256-bit bitmap being dumped -- do you need to dump the
> 1024-bit bitmap? Is there a mechanism which allows that?
I don't think it's possible. As you can see, struct 
hal_reo_get_queue_stats_status is directly extracted from REO_STATUS 
ring, which is queued by firmware/HW. That is to say firmware/HW doesn't 
upload other bitmap info, except for the first 256 bits, to host, so 
host has no way to dump them.
> 
> 

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

end of thread, other threads:[~2023-11-29  1:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28  2:54 [PATCH 0/3] wifi: ath12k: some improvement to RX throughput Baochen Qiang
2023-11-28  2:54 ` Baochen Qiang
2023-11-28  2:54 ` [PATCH 1/3] wifi: ath12k: fix wrong definitions of hal_reo_update_rx_queue Baochen Qiang
2023-11-28  2:54   ` Baochen Qiang
2023-11-28  2:54 ` [PATCH 2/3] wifi: ath12k: add support for BA1024 Baochen Qiang
2023-11-28  2:54   ` Baochen Qiang
2023-11-28 15:47   ` Jeff Johnson
2023-11-28 15:47     ` Jeff Johnson
2023-11-29  1:52     ` Baochen Qiang
2023-11-28  2:54 ` [PATCH 3/3] wifi: ath12k: change MAC buffer ring size to 2048 Baochen Qiang
2023-11-28  2:54   ` Baochen Qiang

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.