Bladeren bron

qcacmn: add near full logic for Tx completion ring

Reap mode desc from the Tx completion ring in case the number of
available entries are less than the half of the ring entries.

Change-Id: I3635b88c3e98cc8a5f30fc58cf5e353f6301d4ad
CRs-Fixed: 3325826
Venkateswara Naralasetty 2 jaren geleden
bovenliggende
commit
26b3d560fe
2 gewijzigde bestanden met toevoegingen van 19 en 1 verwijderingen
  1. 17 1
      dp/wifi3.0/dp_tx.c
  2. 2 0
      dp/wifi3.0/dp_types.h

+ 17 - 1
dp/wifi3.0/dp_tx.c

@@ -5573,9 +5573,12 @@ uint32_t dp_tx_comp_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
 	bool force_break = false;
 	struct dp_srng *tx_comp_ring = &soc->tx_comp_ring[ring_id];
 	int max_reap_limit, ring_near_full;
+	uint32_t num_entries;
 
 	DP_HIST_INIT();
 
+	num_entries = hal_srng_get_num_entries(soc->hal_soc, hal_ring_hdl);
+
 more_data:
 
 	hal_soc = soc->hal_soc;
@@ -5593,7 +5596,9 @@ more_data:
 		return 0;
 	}
 
-	num_avail_for_reap = hal_srng_dst_num_valid(hal_soc, hal_ring_hdl, 0);
+	if (!num_avail_for_reap)
+		num_avail_for_reap = hal_srng_dst_num_valid(hal_soc,
+							    hal_ring_hdl, 0);
 
 	if (num_avail_for_reap >= quota)
 		num_avail_for_reap = quota;
@@ -5797,6 +5802,17 @@ next_desc:
 			if (!hif_exec_should_yield(soc->hif_handle,
 						   int_ctx->dp_intr_id))
 				goto more_data;
+
+			num_avail_for_reap =
+				hal_srng_dst_num_valid_locked(soc->hal_soc,
+							      hal_ring_hdl,
+							      true);
+			if (qdf_unlikely(num_entries &&
+					 (num_avail_for_reap >=
+					  num_entries >> 1))) {
+				DP_STATS_INC(soc, tx.near_full, 1);
+				goto more_data;
+			}
 		}
 	}
 	DP_TX_HIST_STATS_PER_PDEV();

+ 2 - 0
dp/wifi3.0/dp_types.h

@@ -1110,6 +1110,8 @@ struct dp_soc_stats {
 		uint32_t tx_comp[MAX_TCL_DATA_RINGS];
 		/* Number of tx completions force freed */
 		uint32_t tx_comp_force_freed;
+		/* Tx completion ring near full */
+		uint32_t near_full;
 	} tx;
 
 	/* SOC level RX stats */