Bladeren bron

qcacmn: Add cache-set-num in HKv2 Tx path

Add the infrastructure to add cache-set-num field in
tx descriptor of HKv2.

Change-Id: Iec9423c3c90f868341b56ced795cd0bb73c9766a
Subhranil Choudhury 5 jaren geleden
bovenliggende
commit
4ee1b5e28d

+ 2 - 0
dp/wifi3.0/dp_tx.c

@@ -1108,6 +1108,8 @@ static QDF_STATUS dp_tx_hw_enqueue(struct dp_soc *soc, struct dp_vdev *vdev,
 					  vdev->dscp_tid_map_id);
 	hal_tx_desc_set_encrypt_type(hal_tx_desc_cached,
 			sec_type_map[sec_type]);
+	hal_tx_desc_set_cache_set_num(soc->hal_soc, hal_tx_desc_cached,
+				      (vdev->bss_ast_hash & 0xF));
 
 	dp_verbose_debug("length:%d , type = %d, dma_addr %llx, offset %d desc id %u",
 			 length, type, (uint64_t)dma_addr,

+ 27 - 0
hal/wifi3.0/hal_generic_api.h

@@ -2231,6 +2231,33 @@ static void hal_tx_desc_set_search_index_generic(void *desc,
 }
 #endif
 
+/**
+ * hal_tx_desc_set_cache_set_num_generic - Set the cache-set-num value
+ * @desc: Handle to Tx Descriptor
+ * @cache_num: Cache set number that should be used to cache the index
+ *                based search results, for address and flow search.
+ *                This value should be equal to LSB four bits of the hash value
+ *                of match data, in case of search index points to an entry
+ *                which may be used in content based search also. The value can
+ *                be anything when the entry pointed by search index will not be
+ *                used for content based search.
+ *
+ * Return: void
+ */
+#ifdef TCL_DATA_CMD_5_CACHE_SET_NUM_OFFSET
+static void hal_tx_desc_set_cache_set_num_generic(void *desc,
+						  uint8_t cache_num)
+{
+	HAL_SET_FLD(desc, TCL_DATA_CMD_5, CACHE_SET_NUM) |=
+		HAL_TX_SM(TCL_DATA_CMD_5, CACHE_SET_NUM, cache_num);
+}
+#else
+static void hal_tx_desc_set_cache_set_num_generic(void *desc,
+						  uint8_t cache_num)
+{
+}
+#endif
+
 /**
  * hal_tx_set_pcp_tid_map_generic() - Configure default PCP to TID map table
  * @soc: HAL SoC context

+ 1 - 0
hal/wifi3.0/hal_internal.h

@@ -336,6 +336,7 @@ struct hal_hw_txrx_ops {
 			uint8_t pool_id, uint32_t desc_id, uint8_t type);
 	void (*hal_tx_desc_set_search_type)(void *desc, uint8_t search_type);
 	void (*hal_tx_desc_set_search_index)(void *desc, uint32_t search_index);
+	void (*hal_tx_desc_set_cache_set_num)(void *desc, uint8_t search_index);
 	void (*hal_tx_comp_get_status)(void *desc, void *ts,
 				       struct hal_soc *hal);
 	uint8_t (*hal_tx_comp_get_release_reason)(void *hal_desc);

+ 22 - 0
hal/wifi3.0/hal_tx.h

@@ -998,6 +998,28 @@ static inline void hal_tx_desc_set_search_index(hal_soc_handle_t hal_soc_hdl,
 	hal_soc->ops->hal_tx_desc_set_search_index(desc, search_index);
 }
 
+/**
+ * hal_tx_desc_set_cache_set_num - Set the cache-set-num value
+ * @desc: Handle to Tx Descriptor
+ * @cache_num: Cache set number that should be used to cache the index
+ *                based search results, for address and flow search.
+ *                This value should be equal to LSB four bits of the hash value
+ *                of match data, in case of search index points to an entry
+ *                which may be used in content based search also. The value can
+ *                be anything when the entry pointed by search index will not be
+ *                used for content based search.
+ *
+ * Return: void
+ */
+static inline void hal_tx_desc_set_cache_set_num(hal_soc_handle_t hal_soc_hdl,
+						 void *desc,
+						 uint8_t cache_num)
+{
+	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
+
+	hal_soc->ops->hal_tx_desc_set_cache_set_num(desc, cache_num);
+}
+
 /**
  * hal_tx_comp_get_status() - TQM Release reason
  * @hal_desc: completion ring Tx status

+ 1 - 0
hal/wifi3.0/qca6290/hal_6290.c

@@ -126,6 +126,7 @@ struct hal_hw_txrx_ops qca6290_hal_hw_txrx_ops = {
 	hal_tx_desc_set_buf_addr_generic,
 	hal_tx_desc_set_search_type_generic,
 	hal_tx_desc_set_search_index_generic,
+	hal_tx_desc_set_cache_set_num_generic,
 	hal_tx_comp_get_status_generic,
 	hal_tx_comp_get_release_reason_generic,
 

+ 1 - 0
hal/wifi3.0/qca6390/hal_6390.c

@@ -126,6 +126,7 @@ struct hal_hw_txrx_ops qca6390_hal_hw_txrx_ops = {
 	hal_tx_desc_set_buf_addr_generic,
 	hal_tx_desc_set_search_type_generic,
 	hal_tx_desc_set_search_index_generic,
+	hal_tx_desc_set_cache_set_num_generic,
 	hal_tx_comp_get_status_generic,
 	hal_tx_comp_get_release_reason_generic,
 

+ 1 - 0
hal/wifi3.0/qca8074v1/hal_8074v1.c

@@ -122,6 +122,7 @@ struct hal_hw_txrx_ops qca8074_hal_hw_txrx_ops = {
 	hal_tx_desc_set_buf_addr_generic,
 	hal_tx_desc_set_search_type_generic,
 	hal_tx_desc_set_search_index_generic,
+	hal_tx_desc_set_cache_set_num_generic,
 	hal_tx_comp_get_status_generic,
 	hal_tx_comp_get_release_reason_generic,
 

+ 1 - 0
hal/wifi3.0/qca8074v2/hal_8074v2.c

@@ -122,6 +122,7 @@ struct hal_hw_txrx_ops qca8074v2_hal_hw_txrx_ops = {
 	hal_tx_desc_set_buf_addr_generic,
 	hal_tx_desc_set_search_type_generic,
 	hal_tx_desc_set_search_index_generic,
+	hal_tx_desc_set_cache_set_num_generic,
 	hal_tx_comp_get_status_generic,
 	hal_tx_comp_get_release_reason_generic,
 

+ 1 - 0
hal/wifi3.0/qcn9000/hal_9000.c

@@ -126,6 +126,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
 	hal_tx_desc_set_buf_addr_generic,
 	hal_tx_desc_set_search_type_generic,
 	hal_tx_desc_set_search_index_generic,
+	hal_tx_desc_set_cache_set_num_generic,
 	hal_tx_comp_get_status_generic,
 	hal_tx_comp_get_release_reason_generic,