Эх сурвалжийг харах

qcacld-3.0: Hash based rx steering

This change includes adding hooks in the data path to
send WMI command to enable LRO or/and configure a hash
seed value

Change-Id: I3f068307f7669c4ff8baa5102e9fb7729d4a348d
CRs-Fixed: 1094775
Dhanashri Atre 8 жил өмнө
parent
commit
09828f1c91

+ 1 - 1
core/hdd/src/wlan_hdd_lro.c

@@ -411,7 +411,7 @@ static void hdd_lro_flush(void *data)
  */
 int hdd_lro_init(hdd_context_t *hdd_ctx)
 {
-	struct wma_lro_config_cmd_t lro_config;
+	struct cdp_lro_hash_config lro_config;
 
 	if ((!hdd_ctx->config->lro_enable) &&
 	    (hdd_napi_enabled(HDD_NAPI_ANY) == 0)) {

+ 3 - 10
core/wma/inc/wma.h

@@ -2220,16 +2220,9 @@ static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
 }
 #endif /* FEATURE_LFR_SUBNET_DETECTION */
 
-#if defined(FEATURE_LRO)
-QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
-	 struct wma_lro_config_cmd_t *wma_lro_cmd);
-#else
-static inline QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
-	 struct wma_lro_config_cmd_t *wma_lro_cmd)
-{
-	return QDF_STATUS_SUCCESS;
-}
-#endif
+QDF_STATUS wma_lro_config_cmd(void *handle,
+	 struct cdp_lro_hash_config *wma_lro_cmd);
+
 bool wma_is_current_hwmode_dbs(void);
 void
 wma_indicate_err(enum ol_rx_err_type err_type,

+ 1 - 25
core/wma/inc/wma_api.h

@@ -207,32 +207,8 @@ QDF_STATUS wma_get_caps_for_phyidx_hwmode(struct wma_caps_per_phy *caps_per_phy,
 		enum hw_mode_dbs_capab hw_mode, enum cds_band_type band);
 bool wma_is_rx_ldpc_supported_for_channel(uint32_t channel);
 
-#define LRO_IPV4_SEED_ARR_SZ 5
-#define LRO_IPV6_SEED_ARR_SZ 11
-
-/**
- * struct wma_lro_init_cmd_t - set LRO init parameters
- * @lro_enable: indicates whether lro is enabled
- * @tcp_flag: If the TCP flags from the packet do not match
- * the values in this field after masking with TCP flags mask
- * below, packet is not LRO eligible
- * @tcp_flag_mask: field for comparing the TCP values provided
- * above with the TCP flags field in the received packet
- * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
- * 5-tuple toeplitz hash for ipv4 packets
- * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
- * 5-tuple toeplitz hash for ipv6 packets
- */
-struct wma_lro_config_cmd_t {
-	uint32_t lro_enable;
-	uint32_t tcp_flag:9,
-		tcp_flag_mask:9;
-	uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
-	uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
-};
-
 #if defined(FEATURE_LRO)
-int wma_lro_init(struct wma_lro_config_cmd_t *lro_config);
+int wma_lro_init(struct cdp_lro_hash_config *lro_config);
 #endif
 bool wma_is_scan_simultaneous_capable(void);
 

+ 5 - 6
core/wma/src/wma_data.c

@@ -3011,7 +3011,6 @@ void wma_tx_abort(uint8_t vdev_id)
 					 &param);
 }
 
-#if defined(FEATURE_LRO)
 /**
  * wma_lro_config_cmd() - process the LRO config command
  * @wma: Pointer to WMA handle
@@ -3023,12 +3022,13 @@ void wma_tx_abort(uint8_t vdev_id)
  *
  * Return: QDF_STATUS_SUCCESS for success otherwise failure
  */
-QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
-	 struct wma_lro_config_cmd_t *wma_lro_cmd)
+QDF_STATUS wma_lro_config_cmd(void *handle,
+	 struct cdp_lro_hash_config *wma_lro_cmd)
 {
 	struct wmi_lro_config_cmd_t wmi_lro_cmd = {0};
+	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
 
-	if (NULL == wma_handle || NULL == wma_lro_cmd) {
+	if (NULL == wma || NULL == wma_lro_cmd) {
 		WMA_LOGE("wma_lro_config_cmd': invalid input!");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -3043,10 +3043,9 @@ QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
 			wma_lro_cmd->toeplitz_hash_ipv6,
 			LRO_IPV6_SEED_ARR_SZ * sizeof(uint32_t));
 
-	return wmi_unified_lro_config_cmd(wma_handle->wmi_handle,
+	return wmi_unified_lro_config_cmd(wma->wmi_handle,
 						&wmi_lro_cmd);
 }
-#endif
 
 /**
  * wma_indicate_err() - indicate an error to the protocol stack

+ 4 - 3
core/wma/src/wma_main.c

@@ -7007,7 +7007,7 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, struct scheduler_msg *msg)
 		break;
 	case WMA_LRO_CONFIG_CMD:
 		wma_lro_config_cmd(wma_handle,
-			(struct wma_lro_config_cmd_t *)msg->bodyptr);
+			(struct cdp_lro_hash_config *)msg->bodyptr);
 		qdf_mem_free(msg->bodyptr);
 		break;
 	case WMA_GW_PARAM_UPDATE_REQ:
@@ -7427,10 +7427,10 @@ QDF_STATUS wma_crash_inject(tp_wma_handle wma_handle, uint32_t type,
  *
  * Return: 0 for success or reasons for failure
  */
-int wma_lro_init(struct wma_lro_config_cmd_t *lro_config)
+int wma_lro_init(struct cdp_lro_hash_config *lro_config)
 {
 	struct scheduler_msg msg = {0};
-	struct wma_lro_config_cmd_t *iwcmd;
+	struct cdp_lro_hash_config *iwcmd;
 
 	iwcmd = qdf_mem_malloc(sizeof(*iwcmd));
 	if (!iwcmd) {
@@ -7473,6 +7473,7 @@ void wma_peer_set_default_routing(void *scn_handle, uint8_t *peer_macaddr,
 	param.param_id = WMI_HOST_PEER_SET_DEFAULT_ROUTING;
 	param.vdev_id = vdev_id;
 	param.param_value = ((hash_based) ? 1 : 0) | (ring_num << 1);
+	WMA_LOGD("%s: param_value 0x%d", __func__, param.param_value);
 	wmi_set_peer_param_send(wma->wmi_handle, peer_macaddr, &param);
 
 	return;