Parcourir la source

qcacld-3.0: Add P2P UDP/TCP checksum offload INI entry

Add support to enable disable TCP/UDP checksum offload for P2p modes.

CRs-Fixed: 2725394
Change-Id: Ib09ef7a0f118d181f4d358857eb960ee41af9e54
Mohit Khanna il y a 4 ans
Parent
commit
114f32b925
3 fichiers modifiés avec 30 ajouts et 28 suppressions
  1. 2 0
      core/cds/src/cds_api.c
  2. 2 5
      core/hdd/src/wlan_hdd_hostapd.c
  3. 26 23
      core/hdd/src/wlan_hdd_main.c

+ 2 - 0
core/cds/src/cds_api.c

@@ -422,6 +422,8 @@ static void cds_cdp_cfg_attach(struct wlan_objmgr_psoc *psoc)
 		cfg_get(psoc, CFG_DP_TCP_UDP_CKSUM_OFFLOAD);
 	cdp_cfg.nan_ip_tcp_udp_checksum_offload =
 		cfg_get(psoc, CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);
+	cdp_cfg.p2p_ip_tcp_udp_checksum_offload =
+		cfg_get(psoc, CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
 	cdp_cfg.ce_classify_enabled =
 		cfg_get(psoc, CFG_DP_CE_CLASSIFY_ENABLE);
 	cdp_cfg.tso_enable = cfg_get(psoc, CFG_DP_TSO);

+ 2 - 5
core/hdd/src/wlan_hdd_hostapd.c

@@ -3517,17 +3517,14 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit)
 	if (0 != ret)
 		hdd_err("WMI_PDEV_PARAM_BURST_ENABLE set failed: %d", ret);
 
-	if (cdp_cfg_get(cds_get_context(QDF_MODULE_ID_SOC),
-			cfg_dp_enable_ip_tcp_udp_checksum_offload))
-		adapter->dev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
-	adapter->dev->features |= NETIF_F_RXCSUM;
 
 	ucfg_mlme_is_6g_sap_fd_enabled(hdd_ctx->psoc, &is_6g_sap_fd_enabled);
 	hdd_debug("6g sap fd enabled %d", is_6g_sap_fd_enabled);
 	if (is_6g_sap_fd_enabled)
 		wlan_vdev_mlme_feat_ext_cap_set(adapter->vdev,
 						WLAN_VDEV_FEXT_FILS_DISC_6G_SAP);
-	hdd_set_tso_flags(hdd_ctx, adapter->dev);
+
+	hdd_set_netdev_flags(adapter);
 
 	if (!reinit) {
 		adapter->session.ap.sap_config.acs_cfg.acs_mode = false;

+ 26 - 23
core/hdd/src/wlan_hdd_main.c

@@ -5356,22 +5356,8 @@ QDF_STATUS hdd_init_station_mode(struct hdd_adapter *adapter)
 	if (ret_val)
 		hdd_err("WMI_PDEV_PARAM_BURST_ENABLE set failed %d", ret_val);
 
-	/*
-	 * In case of USB tethering, LRO is disabled. If SSR happened
-	 * during that time, then as part of SSR init, do not enable
-	 * the LRO again. Keep the LRO state same as before SSR.
-	 */
-	if (cdp_cfg_get(cds_get_context(QDF_MODULE_ID_SOC),
-			cfg_dp_lro_enable) &&
-			!(qdf_atomic_read(&hdd_ctx->vendor_disable_lro_flag)))
-		adapter->dev->features |= NETIF_F_LRO;
-
-	if (cdp_cfg_get(cds_get_context(QDF_MODULE_ID_SOC),
-			cfg_dp_enable_ip_tcp_udp_checksum_offload))
-		adapter->dev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
-	adapter->dev->features |= NETIF_F_RXCSUM;
 
-	hdd_set_tso_flags(hdd_ctx, adapter->dev);
+	hdd_set_netdev_flags(adapter);
 
 	/* rcpi info initialization */
 	qdf_mem_zero(&adapter->rcpi, sizeof(adapter->rcpi));
@@ -6915,6 +6901,7 @@ QDF_STATUS hdd_stop_all_adapters(struct hdd_context *hdd_ctx)
 void hdd_set_netdev_flags(struct hdd_adapter *adapter)
 {
 	bool enable_csum = false;
+	bool enable_lro;
 	enum QDF_OPMODE device_mode;
 	struct hdd_context *hdd_ctx;
 	ol_txrx_soc_handle soc;
@@ -6935,17 +6922,31 @@ void hdd_set_netdev_flags(struct hdd_adapter *adapter)
 	}
 
 	/* Determine device_mode specific configuration */
+
+	enable_lro = !!cdp_cfg_get(soc, cfg_dp_lro_enable);
+	enable_csum = !!cdp_cfg_get(soc,
+				     cfg_dp_enable_ip_tcp_udp_checksum_offload);
 	switch (device_mode) {
+	case QDF_P2P_DEVICE_MODE:
+	case QDF_P2P_CLIENT_MODE:
+		enable_csum = !!cdp_cfg_get(soc,
+					    cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload);
+		break;
+	case QDF_P2P_GO_MODE:
+		enable_csum = !!cdp_cfg_get(soc,
+					    cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload);
+		enable_lro = false;
+		break;
+	case QDF_SAP_MODE:
+		enable_lro = false;
+		break;
 	case QDF_NDI_MODE:
 	case QDF_NAN_DISC_MODE:
-		if (cdp_cfg_get(soc,
-				cfg_dp_enable_nan_ip_tcp_udp_checksum_offload))
-			enable_csum = true;
+		enable_csum = !!cdp_cfg_get(soc,
+					    cfg_dp_enable_nan_ip_tcp_udp_checksum_offload);
 		break;
 	default:
-		if (cdp_cfg_get(soc,
-				cfg_dp_enable_ip_tcp_udp_checksum_offload))
-			enable_csum = true;
+		break;
 	}
 
 	/* Set netdev flags */
@@ -6955,8 +6956,7 @@ void hdd_set_netdev_flags(struct hdd_adapter *adapter)
 	 * during that time, then as part of SSR init, do not enable
 	 * the LRO again. Keep the LRO state same as before SSR.
 	 */
-	if (cdp_cfg_get(soc, cfg_dp_lro_enable) &&
-	    !(qdf_atomic_read(&hdd_ctx->vendor_disable_lro_flag)))
+	if (enable_lro && !(qdf_atomic_read(&hdd_ctx->vendor_disable_lro_flag)))
 		adapter->dev->features |= NETIF_F_LRO;
 
 	if (enable_csum)
@@ -16509,6 +16509,9 @@ static int hdd_update_dp_config(struct hdd_context *hdd_ctx)
 	params.flow_steering_enable =
 		cfg_get(hdd_ctx->psoc, CFG_DP_FLOW_STEERING_ENABLED);
 	params.napi_enable = hdd_ctx->napi_enable;
+	params.p2p_tcp_udp_checksumoffload =
+		cfg_get(hdd_ctx->psoc,
+			CFG_DP_P2P_TCP_UDP_CKSUM_OFFLOAD);
 	params.nan_tcp_udp_checksumoffload =
 		cfg_get(hdd_ctx->psoc,
 			CFG_DP_NAN_TCP_UDP_CKSUM_OFFLOAD);