wifi: ath12k: change MAC buffer ring size to 2048
authorBaochen Qiang <quic_bqiang@quicinc.com>
Wed, 17 Jan 2024 12:05:39 +0000 (14:05 +0200)
committerKalle Valo <quic_kvalo@quicinc.com>
Thu, 18 Jan 2024 05:52:02 +0000 (07:52 +0200)
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>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20231129020414.56425-4-quic_bqiang@quicinc.com
drivers/net/wireless/ath/ath12k/dp.h
drivers/net/wireless/ath/ath12k/dp_rx.c

index f8fc72a178ef3f28099d80523d5f0652a80b302c..0a10cd36235619bab6c81198ad22a5297de97efa 100644 (file)
@@ -170,6 +170,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
index 1ee83f7659293e80f5a2df523f2a6d3db999c4ea..07430289023f51e6e7e43bde6b8be945bcd269e9 100644 (file)
@@ -4086,7 +4086,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);