Browse Source

qcacmn: Allocate and Initialize the FST for FISA feature

1) Allocate the FISA software flow search table
2) Allocate DDR flow search table
3) Send HTT command to program DDR flow table in FSE module.

Change-Id: I6d6084343d1a9c0298b1cf8a1ba033b2b46e6a82
CRs-Fixed: 2599917
Manjunathappa Prakash 5 năm trước cách đây
mục cha
commit
44aeb7256a
3 tập tin đã thay đổi với 61 bổ sung12 xóa
  1. 4 3
      dp/wifi3.0/dp_internal.h
  2. 8 3
      dp/wifi3.0/dp_main.c
  3. 49 6
      dp/wifi3.0/dp_types.h

+ 4 - 3
dp/wifi3.0/dp_internal.h

@@ -1875,7 +1875,7 @@ struct dp_soc *cdp_soc_t_to_dp_soc(struct cdp_soc_t *psoc)
 	return (struct dp_soc *)psoc;
 }
 
-#ifdef WLAN_SUPPORT_RX_FLOW_TAG
+#if defined(WLAN_SUPPORT_RX_FLOW_TAG) || defined(WLAN_SUPPORT_RX_FISA)
 /**
  * dp_rx_flow_update_fse_stats() - Update a flow's statistics
  * @pdev: pdev handle
@@ -1934,7 +1934,8 @@ void dp_rx_fst_detach(struct dp_soc *soc, struct dp_pdev *pdev);
  */
 QDF_STATUS dp_rx_flow_send_fst_fw_setup(struct dp_soc *soc,
 					struct dp_pdev *pdev);
-#else
+#else /* !((WLAN_SUPPORT_RX_FLOW_TAG) || defined(WLAN_SUPPORT_RX_FISA)) */
+
 /**
  * dp_rx_fst_attach() - Initialize Rx FST and setup necessary parameters
  * @soc: SoC handle
@@ -1959,7 +1960,7 @@ static inline
 void dp_rx_fst_detach(struct dp_soc *soc, struct dp_pdev *pdev)
 {
 }
-#endif /* WLAN_SUPPORT_RX_FLOW_TAG */
+#endif
 
 /**
  * dp_get_vdev_from_soc_vdev_id_wifi3() - Returns vdev object given the vdev id

+ 8 - 3
dp/wifi3.0/dp_main.c

@@ -4885,7 +4885,7 @@ dp_rx_target_fst_config(struct dp_soc *soc)
 	}
 	return status;
 }
-#else
+#elif WLAN_SUPPORT_RX_FISA
 /**
  * dp_rx_target_fst_config() - Configure RX OLE FSE engine in HW
  * @soc: SoC handle
@@ -4894,11 +4894,16 @@ dp_rx_target_fst_config(struct dp_soc *soc)
  */
 static inline QDF_STATUS
 dp_rx_target_fst_config(struct dp_soc *soc)
+{
+	return dp_rx_flow_send_fst_fw_setup(soc, soc->pdev_list[0]);
+}
+#else /* WLAN_SUPPORT_RX_FISA */
+static inline QDF_STATUS
+dp_rx_target_fst_config(struct dp_soc *soc)
 {
 	return QDF_STATUS_SUCCESS;
 }
-
-#endif /* WLAN_SUPPORT_RX_FLOW_TAG */
+#endif
 
 /*
  * dp_soc_attach_target_wifi3() - SOC initialization in the target

+ 49 - 6
dp/wifi3.0/dp_types.h

@@ -1245,13 +1245,14 @@ struct dp_soc {
 	 * invalidation bug is enabled or not
 	 */
 	bool is_rx_fse_full_cache_invalidate_war_enabled;
-#ifdef WLAN_SUPPORT_RX_FLOW_TAG
+#if defined(WLAN_SUPPORT_RX_FLOW_TAG) || defined(WLAN_SUPPORT_RX_FISA)
 	/**
 	 * Pointer to DP RX Flow FST at SOC level if
 	 * is_rx_flow_search_table_per_pdev is false
+	 * TBD: rx_fst[num_macs] if we decide to have per mac FST
 	 */
 	struct dp_rx_fst *rx_fst;
-#endif /* WLAN_SUPPORT_RX_FLOW_TAG */
+#endif /* WLAN_SUPPORT_RX_FLOW_TAG || WLAN_SUPPORT_RX_FISA */
 };
 
 #ifdef IPA_OFFLOAD
@@ -2193,9 +2194,10 @@ struct dp_tx_me_buf_t {
 	uint8_t data[QDF_MAC_ADDR_SIZE];
 };
 
-#ifdef WLAN_SUPPORT_RX_FLOW_TAG
+#if defined(WLAN_SUPPORT_RX_FLOW_TAG) || defined(WLAN_SUPPORT_RX_FISA)
 struct hal_rx_fst;
 
+#ifdef WLAN_SUPPORT_RX_FLOW_TAG
 struct dp_rx_fse {
 	/* HAL Rx Flow Search Entry which matches HW definition */
 	void *hal_rx_fse;
@@ -2206,9 +2208,9 @@ struct dp_rx_fse {
 	/* Stats tracking for this flow */
 	struct cdp_flow_stats stats;
 	/* Flag indicating whether flow is IPv4 address tuple */
-	bool is_ipv4_addr_entry;
+	uint8_t is_ipv4_addr_entry;
 	/* Flag indicating whether flow is valid */
-	bool is_valid;
+	uint8_t is_valid;
 };
 
 struct dp_rx_fst {
@@ -2236,6 +2238,47 @@ struct dp_rx_fst {
 	/* Flag to indicate completion of FSE setup in HW/FW */
 	bool fse_setup_done;
 };
-#endif /* WLAN_SUPPORT_RX_FLOW_TAG */
+
+#define DP_RX_GET_SW_FT_ENTRY_SIZE sizeof(struct dp_rx_fse)
+#elif WLAN_SUPPORT_RX_FISA
+struct dp_fisa_rx_sw_ft {
+	/* HAL Rx Flow Search Entry which matches HW definition */
+	void *hal_rx_fse;
+	/* Toeplitz hash value */
+	uint32_t flow_hash;
+	/* Flow index, equivalent to hash value truncated to FST size */
+	uint32_t flow_id;
+	/* Stats tracking for this flow */
+	struct cdp_flow_stats stats;
+	/* Flag indicating whether flow is IPv4 address tuple */
+	uint8_t is_ipv4_addr_entry;
+	/* Flag indicating whether flow is valid */
+	uint8_t is_valid;
+	qdf_nbuf_t *head_skb;
+};
+
+#define DP_RX_GET_SW_FT_ENTRY_SIZE sizeof(struct dp_fisa_rx_sw_ft)
+
+struct dp_rx_fst {
+	/* Software (DP) FST */
+	uint8_t *base;
+	/* Pointer to HAL FST */
+	struct hal_rx_fst *hal_rx_fst;
+	/* Base physical address of HAL RX HW FST */
+	uint64_t hal_rx_fst_base_paddr;
+	/* Maximum number of flows FSE supports */
+	uint16_t max_entries;
+	/* Num entries in flow table */
+	uint16_t num_entries;
+	/* SKID Length */
+	uint16_t max_skid_length;
+	/* Hash mask to obtain legitimate hash entry */
+	uint32_t hash_mask;
+	/* Lock for adding/deleting entries of FST */
+	qdf_spinlock_t dp_rx_fst_lock;
+};
+
+#endif /* WLAN_SUPPORT_RX_FISA */
+#endif /* WLAN_SUPPORT_RX_FLOW_TAG || WLAN_SUPPORT_RX_FISA */
 
 #endif /* _DP_TYPES_H_ */