Procházet zdrojové kódy

qcacld-3.0: Enable TSO/SG feature by the FEATURE_TSO/dp_sg_support

The hdd_set_netdev_flags enable the TSO feature regardless of the
FEATURE_TSO, which will cause the performance regression issue on
the non-tso supported chip.

Enable TSO feature based on the FEATURE_TSO, and enable the SG feature
separately by ini dp_sg_support for legacy chip to fix it.

Change-Id: I0fcb189069f0aa2069ae8427ad96a8db25a91a2f
CRs-Fixed: 2812953
Tiger Yu před 4 roky
rodič
revize
f702106630

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

@@ -434,6 +434,7 @@ static void cds_cdp_cfg_attach(struct wlan_objmgr_psoc *psoc)
 		cfg_get(psoc, CFG_DP_CE_CLASSIFY_ENABLE);
 	cdp_cfg.tso_enable = cfg_get(psoc, CFG_DP_TSO);
 	cdp_cfg.lro_enable = cfg_get(psoc, CFG_DP_LRO);
+	cdp_cfg.sg_enable = cfg_get(psoc, CFG_DP_SG);
 	cdp_cfg.enable_data_stall_detection =
 		cfg_get(psoc, CFG_DP_ENABLE_DATA_STALL_DETECTION);
 	cdp_cfg.gro_enable = cfg_get(psoc, CFG_DP_GRO);

+ 1 - 0
core/dp/ol/inc/ol_cfg.h

@@ -109,6 +109,7 @@ struct txrx_pdev_cfg_t {
 	bool gro_enable;
 	bool tso_enable;
 	bool lro_enable;
+	bool sg_enable;
 	bool enable_data_stall_detection;
 	bool enable_flow_steering;
 	bool disable_intra_bss_fwd;

+ 1 - 0
core/dp/txrx/ol_cfg.c

@@ -206,6 +206,7 @@ struct cdp_cfg *ol_pdev_cfg_attach(qdf_device_t osdev, void *pcfg_param)
 	cfg_ctx->gro_enable = cfg_param->gro_enable;
 	cfg_ctx->tso_enable = cfg_param->tso_enable;
 	cfg_ctx->lro_enable = cfg_param->lro_enable;
+	cfg_ctx->sg_enable = cfg_param->sg_enable;
 	cfg_ctx->enable_data_stall_detection =
 		cfg_param->enable_data_stall_detection;
 	cfg_ctx->enable_flow_steering = cfg_param->enable_flow_steering;

+ 3 - 0
core/dp/txrx/ol_txrx.c

@@ -5865,6 +5865,9 @@ static uint32_t ol_txrx_get_cfg(struct cdp_soc_t *soc_hdl, enum cdp_dp_cfg cfg)
 	case cfg_dp_lro_enable:
 		value = cfg_ctx->lro_enable;
 		break;
+	case cfg_dp_sg_enable:
+		value = cfg_ctx->sg_enable;
+		break;
 	case cfg_dp_gro_enable:
 		value = cfg_ctx->gro_enable;
 		break;

+ 10 - 2
core/hdd/src/wlan_hdd_main.c

@@ -226,6 +226,12 @@
 /* PCIe gen speed change idle shutdown timer 100 milliseconds */
 #define HDD_PCIE_GEN_SPEED_CHANGE_TIMEOUT_MS (100)
 
+#ifdef FEATURE_TSO
+#define TSO_FEATURE_FLAGS (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG)
+#else
+#define TSO_FEATURE_FLAGS 0
+#endif
+
 int wlan_start_ret_val;
 static DECLARE_COMPLETION(wlan_start_comp);
 static qdf_atomic_t wlan_hdd_state_fops_ref;
@@ -7307,8 +7313,10 @@ void hdd_set_netdev_flags(struct hdd_adapter *adapter)
 			(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
 
 	if (cdp_cfg_get(soc, cfg_dp_tso_enable) && enable_csum)
-		adapter->dev->features |=
-			 (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG);
+		adapter->dev->features |= TSO_FEATURE_FLAGS;
+
+	if (cdp_cfg_get(soc, cfg_dp_sg_enable))
+		adapter->dev->features |= NETIF_F_SG;
 
 	adapter->dev->features |= NETIF_F_RXCSUM;
 	temp = (uint64_t)adapter->dev->features;