Explorar o código

qcacmn: Add near full logic to rx error processing

Reap more entries from error ring if the number of
available entries are less than half of the ring entries.

Change-Id: I742f97e41c0e392f1e50bbd95ab625bd6168a8e5
CRs-Fixed: 3749873
Amit Mehta hai 1 ano
pai
achega
be61151475
Modificáronse 2 ficheiros con 33 adicións e 1 borrados
  1. 29 1
      dp/wifi3.0/dp_rx_err.c
  2. 4 0
      dp/wifi3.0/dp_types.h

+ 29 - 1
dp/wifi3.0/dp_rx_err.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -2057,6 +2057,8 @@ dp_rx_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
 	uint16_t peer_id;
 	struct dp_txrx_peer *txrx_peer = NULL;
 	dp_txrx_ref_handle txrx_ref_handle = NULL;
+	uint32_t num_pending, num_entries;
+	bool near_full;
 
 	/* Debug -- Remove later */
 	qdf_assert(soc && hal_ring_hdl);
@@ -2065,7 +2067,9 @@ dp_rx_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
 
 	/* Debug -- Remove later */
 	qdf_assert(hal_soc);
+	num_entries = hal_srng_get_num_entries(hal_soc, hal_ring_hdl);
 
+more_data:
 	if (qdf_unlikely(dp_srng_access_start(int_ctx, soc, hal_ring_hdl))) {
 
 		/* TODO */
@@ -2361,6 +2365,30 @@ done:
 						false);
 			rx_bufs_used += rx_bufs_reaped[mac_id];
 		}
+		rx_bufs_reaped[mac_id] = 0;
+	}
+
+	if (dp_rx_enable_eol_data_check(soc) && rx_bufs_used) {
+		if (quota) {
+			num_pending =
+				dp_rx_srng_get_num_pending(hal_soc,
+							   hal_ring_hdl,
+							   num_entries,
+							   &near_full);
+
+			if (num_pending) {
+				DP_STATS_INC(soc, rx.err.hp_oos2, 1);
+
+				if (!hif_exec_should_yield(soc->hif_handle,
+							   int_ctx->dp_intr_id))
+					goto more_data;
+
+				if (qdf_unlikely(near_full)) {
+					DP_STATS_INC(soc, rx.err.near_full, 1);
+					goto more_data;
+				}
+			}
+		}
 	}
 
 	return rx_bufs_used; /* Assume no scale factor for now */

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

@@ -1416,6 +1416,10 @@ struct dp_soc_stats {
 			/* Invalid chip id received in intrabss path */
 			uint64_t intra_bss_bad_chipid;
 #endif
+			/* HP Out of sync at the end of dp_rx_err_process */
+			uint32_t hp_oos2;
+			/* Rx exception ring near full */
+			uint32_t near_full;
 		} err;
 
 		/* packet count per core - per ring */