Procházet zdrojové kódy

qcacmn: Make changes to support fisa flow deletion

Add fisa deletion support by invalidating the fisa
DDR entry when adding a new entry.

Change-Id: I02189e22e09ca0ef5e1fdb5952c7e72cd87d3673
CRs-Fixed: 2954060
sandhu před 4 roky
rodič
revize
88ff3516d7

+ 32 - 1
dp/wifi3.0/dp_types.h

@@ -3466,6 +3466,8 @@ struct dp_fisa_rx_sw_ft {
 	uint32_t cur_aggr_gso_size;
 	struct udphdr *head_skb_udp_hdr;
 	uint16_t frags_cumulative_len;
+	/* debug delete count */
+	uint32_t del_count;
 	/* CMEM parameters */
 	uint32_t cmem_offset;
 	uint32_t metadata;
@@ -3479,6 +3481,7 @@ struct dp_fisa_rx_sw_ft {
 
 #define DP_RX_GET_SW_FT_ENTRY_SIZE sizeof(struct dp_fisa_rx_sw_ft)
 #define MAX_FSE_CACHE_FL_HST 10
+#define MAX_FSE_LRU_DELETE_HISTORY 16
 /**
  * struct fse_cache_flush_history - Debug history cache flush
  * @timestamp: Entry update timestamp
@@ -3491,6 +3494,32 @@ struct fse_cache_flush_history {
 	uint32_t flows_deleted;
 };
 
+#ifdef WLAN_SUPPORT_RX_FISA_HIST
+/**
+ * struct fse_lru_delete_history_entry - lru deletion history
+ * hashed_idx - hased index to be deleted and updated
+ *
+ */
+struct fse_lru_delete_history_entry {
+	uint32_t hashed_idx;
+	uint64_t eviction_timestamp;
+	struct cdp_rx_flow_tuple_info evicted_flow_tuple_info;
+	struct cdp_rx_flow_tuple_info added_flow_tuple_info;
+};
+
+/**
+ * struct fse_lru_delete_history - fse lru delete debug history
+ * current_index - current index to be updated
+ * entry - array of history index
+ */
+
+struct fse_lru_delete_history {
+	uint32_t current_index;
+	struct fse_lru_delete_history_entry entry[MAX_FSE_LRU_DELETE_HISTORY];
+};
+
+#endif
+
 struct dp_rx_fst {
 	/* Software (DP) FST */
 	uint8_t *base;
@@ -3517,6 +3546,9 @@ struct dp_rx_fst {
 	/* Allow FSE cache flush cmd to FW */
 	bool fse_cache_flush_allow;
 	struct fse_cache_flush_history cache_fl_rec[MAX_FSE_CACHE_FL_HST];
+#ifdef WLAN_SUPPORT_RX_FISA_HIST
+	struct fse_lru_delete_history lru_delete_history;
+#endif
 	/* FISA DP stats */
 	struct dp_fisa_stats stats;
 
@@ -3528,7 +3560,6 @@ struct dp_rx_fst {
 	uint32_t cmem_ba;
 	qdf_spinlock_t dp_rx_sw_ft_lock[MAX_REO_DEST_RINGS];
 	qdf_event_t cmem_resp_event;
-	bool flow_deletion_supported;
 	bool fst_in_cmem;
 	bool pm_suspended;
 };

+ 2 - 9
hal/wifi3.0/qca6490/hal_6490.c

@@ -1532,7 +1532,6 @@ hal_rx_flow_setup_fse_6490(uint8_t *rx_fst, uint32_t table_offset,
 	struct hal_rx_fst *fst = (struct hal_rx_fst *)rx_fst;
 	struct hal_rx_flow *flow = (struct hal_rx_flow *)rx_flow;
 	uint8_t *fse;
-	bool fse_valid;
 
 	if (table_offset >= fst->max_entries) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
@@ -1544,14 +1543,8 @@ hal_rx_flow_setup_fse_6490(uint8_t *rx_fst, uint32_t table_offset,
 	fse = (uint8_t *)fst->base_vaddr +
 		(table_offset * HAL_RX_FST_ENTRY_SIZE);
 
-	fse_valid = HAL_GET_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, VALID);
-
-	if (fse_valid) {
-		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
-				"HAL FSE %pK already valid", fse);
-		return NULL;
-	}
-
+	/* clear the valid bit before starting the deletion*/
+	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, VALID);
 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY_0, SRC_IP_127_96) =
 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY_0, SRC_IP_127_96,
 			(flow->tuple_info.src_ip_127_96));

+ 2 - 8
hal/wifi3.0/wcn7850/hal_7850.c

@@ -1060,7 +1060,6 @@ hal_rx_flow_setup_fse_7850(uint8_t *rx_fst, uint32_t table_offset,
 	struct hal_rx_fst *fst = (struct hal_rx_fst *)rx_fst;
 	struct hal_rx_flow *flow = (struct hal_rx_flow *)rx_flow;
 	uint8_t *fse;
-	bool fse_valid;
 
 	if (table_offset >= fst->max_entries) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
@@ -1072,13 +1071,8 @@ hal_rx_flow_setup_fse_7850(uint8_t *rx_fst, uint32_t table_offset,
 	fse = (uint8_t *)fst->base_vaddr +
 		(table_offset * HAL_RX_FST_ENTRY_SIZE);
 
-	fse_valid = HAL_GET_FLD(fse, RX_FLOW_SEARCH_ENTRY, VALID);
-
-	if (fse_valid) {
-		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
-			  "HAL FSE %pK already valid", fse);
-		return NULL;
-	}
+	/* clear the valid bit before starting the deletion*/
+	HAL_CLR_FLD(fse, RX_FLOW_SEARCH_ENTRY_9, VALID);
 
 	HAL_SET_FLD(fse, RX_FLOW_SEARCH_ENTRY, SRC_IP_127_96) =
 		HAL_SET_FLD_SM(RX_FLOW_SEARCH_ENTRY, SRC_IP_127_96,