Prechádzať zdrojové kódy

qcacld-3.0: Check if netdev feature need to update

Currently based on the INI option we are scheduling
work to dynamically disable/enable checksum offload and TSO.
But in the case of roaming from latency critical connection
to latency critical connection or non-latency critical connection
to non-latency critical connection, we do not need to schedule work.

So adding a condition to check :
For non-latency critical connection: If checksum offload and TSO are
not disabled then schedule work.
For latency critical: If checksum offload and TSO are
not enabled then schedule work.

Change-Id: I75a51707774c3428971dfe5cc0b0d3cdc2a17ac8
CRs-Fixed: 3054183
Amit Mehta 3 rokov pred
rodič
commit
907dcf9495

+ 2 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -1520,6 +1520,8 @@ struct hdd_adapter {
 	uint8_t gro_disallowed[DP_MAX_RX_THREADS];
 	uint8_t gro_flushed[DP_MAX_RX_THREADS];
 	bool handle_feature_update;
+	/* Indicate if TSO and checksum offload features are enabled or not */
+	bool tso_csum_feature_enabled;
 	bool runtime_disable_rx_thread;
 	ol_txrx_rx_fp rx_stack;
 

+ 26 - 1
core/hdd/src/wlan_hdd_cm_connect.c

@@ -268,12 +268,37 @@ void hdd_cm_handle_assoc_event(struct wlan_objmgr_vdev *vdev, uint8_t *peer_mac)
 		ucfg_pkt_capture_record_channel(adapter->vdev);
 }
 
+/**
+ * hdd_cm_netif_features_update_required() - Check if feature update
+ * is required
+ * @adapter: pointer to the adapter structure
+ * Returns: true if the connection is legacy and TSO and Checksum offload
+ * enabled or if the connection is not latency and TSO and Checksum
+ * offload are not enabled, false otherwise
+ */
+static bool hdd_cm_netif_features_update_required(struct hdd_adapter *adapter)
+{
+	bool is_legacy_connection = hdd_is_legacy_connection(adapter);
+
+	hdd_debug("Legacy Connection: %d, TSO_CSUM Feature Enabled:%d",
+		  is_legacy_connection, adapter->tso_csum_feature_enabled);
+
+	if (adapter->tso_csum_feature_enabled  && is_legacy_connection)
+		return true;
+
+	if (!adapter->tso_csum_feature_enabled  && !is_legacy_connection)
+		return true;
+
+	return false;
+}
+
 void hdd_cm_netif_queue_enable(struct hdd_adapter *adapter)
 {
 	ol_txrx_soc_handle soc = cds_get_context(QDF_MODULE_ID_SOC);
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
-	if (cdp_cfg_get(soc, cfg_dp_disable_legacy_mode_csum_offload)) {
+	if (cdp_cfg_get(soc, cfg_dp_disable_legacy_mode_csum_offload) &&
+	    hdd_cm_netif_features_update_required(adapter)) {
 		hdd_adapter_ops_record_event(hdd_ctx,
 					     WLAN_HDD_ADAPTER_OPS_WORK_POST,
 					     adapter->vdev_id);

+ 8 - 4
core/hdd/src/wlan_hdd_main.c

@@ -5415,13 +5415,15 @@ static netdev_features_t __hdd_fix_features(struct net_device *net_dev,
 	}
 
 	feature_tso_csum = hdd_get_tso_csum_feature_flags();
-	if (hdd_is_legacy_connection(adapter))
+	if (hdd_is_legacy_connection(adapter)) {
 		/* Disable checksum and TSO */
 		feature_change_req &= ~feature_tso_csum;
-	else
+		adapter->tso_csum_feature_enabled = 0;
+	} else {
 		/* Enable checksum and TSO */
 		feature_change_req |= feature_tso_csum;
-
+		adapter->tso_csum_feature_enabled = 1;
+	}
 	hdd_debug("vdev mode %d current features 0x%llx, requesting feature change 0x%llx",
 		  adapter->device_mode, net_dev->features,
 		  feature_change_req);
@@ -8009,8 +8011,10 @@ void hdd_set_netdev_flags(struct hdd_adapter *adapter)
 		adapter->dev->features |=
 			(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);
 
-	if (cdp_cfg_get(soc, cfg_dp_tso_enable) && enable_csum)
+	if (cdp_cfg_get(soc, cfg_dp_tso_enable) && enable_csum) {
 		adapter->dev->features |= TSO_FEATURE_FLAGS;
+		adapter->tso_csum_feature_enabled = 1;
+	}
 
 	if (cdp_cfg_get(soc, cfg_dp_sg_enable))
 		adapter->dev->features |= NETIF_F_SG;