Browse Source

qcacld-3.0: Add support for additional REO rings for Hamilton

Hamilton supports 4 additional REO rings to cater to increased
throughput. Enable additional REO rings.

Change-Id: I5a527724220cf898994e71b48cee577e3c538f9f
Manjunathappa Prakash 4 years ago
parent
commit
add10158ba
3 changed files with 21 additions and 18 deletions
  1. 7 13
      core/dp/txrx3.0/dp_rx_thread.c
  2. 5 1
      core/dp/txrx3.0/dp_rx_thread.h
  3. 9 4
      core/dp/txrx3.0/dp_txrx.c

+ 7 - 13
core/dp/txrx3.0/dp_rx_thread.c

@@ -1240,14 +1240,10 @@ static uint8_t dp_rx_tm_select_thread(struct dp_rx_tm_handle *rx_tm_hdl,
 {
 	uint8_t selected_rx_thread;
 
-	if (reo_ring_num >= rx_tm_hdl->num_dp_rx_threads) {
-		dp_err_rl("unexpected ring number");
-		QDF_BUG(0);
-		return 0;
-	}
+	selected_rx_thread = reo_ring_num % rx_tm_hdl->num_dp_rx_threads;
+	dp_debug("ring_num %d, selected thread %u", reo_ring_num,
+		 selected_rx_thread);
 
-	selected_rx_thread = reo_ring_num;
-	dp_debug("selected thread %u", selected_rx_thread);
 	return selected_rx_thread;
 }
 
@@ -1280,13 +1276,11 @@ dp_rx_tm_gro_flush_ind(struct dp_rx_tm_handle *rx_tm_hdl, int rx_ctx_id,
 struct napi_struct *dp_rx_tm_get_napi_context(struct dp_rx_tm_handle *rx_tm_hdl,
 					      uint8_t rx_ctx_id)
 {
-	if (rx_ctx_id >= rx_tm_hdl->num_dp_rx_threads) {
-		dp_err_rl("unexpected rx_ctx_id %u", rx_ctx_id);
-		QDF_BUG(0);
-		return NULL;
-	}
+	uint8_t selected_thread_id;
+
+	selected_thread_id = dp_rx_tm_select_thread(rx_tm_hdl, rx_ctx_id);
 
-	return &rx_tm_hdl->rx_thread[rx_ctx_id]->napi;
+	return &rx_tm_hdl->rx_thread[selected_thread_id]->napi;
 }
 
 QDF_STATUS dp_rx_tm_set_cpu_mask(struct dp_rx_tm_handle *rx_tm_hdl,

+ 5 - 1
core/dp/txrx3.0/dp_rx_thread.h

@@ -25,10 +25,14 @@
 #include <wlan_objmgr_vdev_obj.h>
 
 /* Maximum number of REO rings supported (for stats tracking) */
+#ifdef CONFIG_BERYLLIUM
+#define DP_RX_TM_MAX_REO_RINGS 8
+#else
 #define DP_RX_TM_MAX_REO_RINGS 4
+#endif
 
 /* Number of DP RX threads supported */
-#define DP_MAX_RX_THREADS DP_RX_TM_MAX_REO_RINGS
+#define DP_MAX_RX_THREADS 3
 
 /*
  * struct dp_rx_tm_handle_cmn - Opaque handle for rx_threads to store

+ 9 - 4
core/dp/txrx3.0/dp_txrx.c

@@ -106,7 +106,8 @@ QDF_STATUS dp_txrx_init(ol_txrx_soc_handle soc, uint8_t pdev_id,
 						dp_rx_refill_thread_schedule);
 	}
 
-	num_dp_rx_threads = cdp_get_num_rx_contexts(soc);
+	/* Get num Rx thread config from INI? */
+	num_dp_rx_threads = 3;
 
 	if (dp_ext_hdl->config.enable_rx_threads) {
 		qdf_status = dp_rx_tm_init(&dp_ext_hdl->rx_tm_hdl,
@@ -328,12 +329,16 @@ static struct dp_prealloc_context g_dp_context_allocs[] = {
 };
 
 static struct  dp_consistent_prealloc g_dp_consistent_allocs[] = {
-	/* 5 REO DST rings */
 	{REO_DST, (sizeof(struct reo_destination_ring)) * REO_DST_RING_SIZE, 0, NULL, NULL, 0, 0},
 	{REO_DST, (sizeof(struct reo_destination_ring)) * REO_DST_RING_SIZE, 0, NULL, NULL, 0, 0},
 	{REO_DST, (sizeof(struct reo_destination_ring)) * REO_DST_RING_SIZE, 0, NULL, NULL, 0, 0},
 	{REO_DST, (sizeof(struct reo_destination_ring)) * REO_DST_RING_SIZE, 0, NULL, NULL, 0, 0},
+#ifdef CONFIG_BERYLLIUM
+	{REO_DST, (sizeof(struct reo_destination_ring)) * REO_DST_RING_SIZE, 0, NULL, NULL, 0, 0},
+	{REO_DST, (sizeof(struct reo_destination_ring)) * REO_DST_RING_SIZE, 0, NULL, NULL, 0, 0},
 	{REO_DST, (sizeof(struct reo_destination_ring)) * REO_DST_RING_SIZE, 0, NULL, NULL, 0, 0},
+	{REO_DST, (sizeof(struct reo_destination_ring)) * REO_DST_RING_SIZE, 0, NULL, NULL, 0, 0},
+#endif
 	/* 3 TCL data rings */
 	{TCL_DATA, (sizeof(struct tlv_32_hdr) + sizeof(struct tcl_data_cmd)) * TCL_DATA_RING_SIZE, 0, NULL, NULL, 0, 0},
 	{TCL_DATA, (sizeof(struct tlv_32_hdr) + sizeof(struct tcl_data_cmd)) * TCL_DATA_RING_SIZE, 0, NULL, NULL, 0, 0},
@@ -705,8 +710,8 @@ void *dp_prealloc_get_coherent(uint32_t *size, void **base_vaddr_unaligned,
 			va_aligned = p->va_aligned;
 			*size = p->size;
 			dp_debug("index %i -> ring type %s va-aligned %pK", i,
-				dp_srng_get_str_from_hal_ring_type(ring_type),
-				va_aligned);
+				 dp_srng_get_str_from_hal_ring_type(ring_type),
+				 va_aligned);
 			break;
 		}
 	}