Browse Source

qcacld-3.0: Do GRO en/dis based on qdisc only for standalone STA

In case of STA+SAP, ingress qdisc filters are getting
configured on both STA and SAP interface which is
causing GRO to be disabled.

Check for ingress qdisc to enable/disable GRO only in
case of stanalone STA and not do this in case of
concurrency.

Change-Id: I3542930c7b14d72e267378dd4687ee9721eed4ed
CRs-Fixed: 3062195
Yeshwanth Sriram Guntuka 3 years ago
parent
commit
450060b241

+ 3 - 2
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -1728,14 +1728,15 @@ struct policy_mgr_cdp_cbacks {
 /**
  * struct policy_mgr_dp_cbacks - CDP Callbacks to be invoked
  * from policy manager
- * @hdd_disable_rx_ol_in_concurrency: Callback to disable LRO/GRO offloads
+ * @hdd_rx_handle_concurrency: Callback to handle concurrency related
+ *  operations for rx
  * @hdd_set_rx_mode_rps_cb: Callback to set RPS
  * @hdd_ipa_set_mcc_mode_cb: Callback to set mcc mode for ipa module
  * @hdd_v2_flow_pool_map: Callback to create vdev flow pool
  * @hdd_v2_flow_pool_unmap: Callback to delete vdev flow pool
  */
 struct policy_mgr_dp_cbacks {
-	void (*hdd_disable_rx_ol_in_concurrency)(bool);
+	void (*hdd_rx_handle_concurrency)(bool);
 	void (*hdd_set_rx_mode_rps_cb)(bool);
 	void (*hdd_ipa_set_mcc_mode_cb)(bool);
 	void (*hdd_v2_flow_pool_map)(int);

+ 4 - 4
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -2877,8 +2877,8 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc,
 	    (policy_mgr_mode_specific_connection_count(psoc,
 						       PM_NDI_MODE,
 						       NULL) > 0)) {
-		if (pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency)
-			pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency(true);
+		if (pm_ctx->dp_cbacks.hdd_rx_handle_concurrency)
+			pm_ctx->dp_cbacks.hdd_rx_handle_concurrency(true);
 	};
 
 	/* Enable RPS if SAP interface has come up */
@@ -2972,8 +2972,8 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc,
 	     (policy_mgr_mode_specific_connection_count(psoc,
 							PM_NDI_MODE,
 							NULL) == 0))) {
-		if (pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency)
-			pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency(false);
+		if (pm_ctx->dp_cbacks.hdd_rx_handle_concurrency)
+			pm_ctx->dp_cbacks.hdd_rx_handle_concurrency(false);
 	};
 
 	/* Disable RPS if SAP interface has come up */

+ 3 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -791,8 +792,8 @@ QDF_STATUS policy_mgr_register_dp_cb(struct wlan_objmgr_psoc *psoc,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency =
-		dp_cbacks->hdd_disable_rx_ol_in_concurrency;
+	pm_ctx->dp_cbacks.hdd_rx_handle_concurrency =
+		dp_cbacks->hdd_rx_handle_concurrency;
 	pm_ctx->dp_cbacks.hdd_set_rx_mode_rps_cb =
 		dp_cbacks->hdd_set_rx_mode_rps_cb;
 	pm_ctx->dp_cbacks.hdd_ipa_set_mcc_mode_cb =

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

@@ -1937,6 +1937,7 @@ struct hdd_rtpm_tput_policy_context {
  * @twt_en_dis_work: work to send twt enable/disable cmd on MCC/SCC concurrency
  * @dump_in_progress: Stores value of dump in progress
  * @hdd_dual_sta_policy: Concurrent STA policy configuration
+ * @rx_skip_qdisc_chk_conc: flag to skip ingress qdisc check in concurrency
  */
 struct hdd_context {
 	struct wlan_objmgr_psoc *psoc;
@@ -2304,6 +2305,7 @@ struct hdd_context {
 #ifdef THERMAL_STATS_SUPPORT
 	bool is_therm_stats_in_progress;
 #endif
+	qdf_atomic_t rx_skip_qdisc_chk_conc;
 };
 
 /**

+ 5 - 3
core/hdd/inc/wlan_hdd_tx_rx.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -224,12 +225,13 @@ QDF_STATUS hdd_rx_pkt_thread_enqueue_cbk(void *adapter_context,
 int hdd_rx_ol_init(struct hdd_context *hdd_ctx);
 
 /**
- * hdd_disable_rx_ol_in_concurrency() - Disable Rx offload due to concurrency
- * @disable: true/false to disable/enable the Rx offload
+ * hdd_rx_handle_concurrency() - Handle concurrency related operations
+ *  for rx
+ * @is_concurrency: true if there are concurrenct connections else false
  *
  * Return: none
  */
-void hdd_disable_rx_ol_in_concurrency(bool disable);
+void hdd_rx_handle_concurrency(bool is_concurrency);
 
 /**
  * hdd_disable_rx_ol_for_low_tput() - Disable Rx offload in low TPUT scenario

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

@@ -14438,14 +14438,7 @@ int hdd_configure_cds(struct hdd_context *hdd_ctx)
 	if (ret)
 		goto cds_disable;
 
-	/*
-	 * Donot disable rx offload on concurrency for lithium and
-	 * beryllium based targets
-	 */
-	if (!hdd_ctx->is_wifi3_0_target)
-		if (hdd_ctx->ol_enable)
-			dp_cbs.hdd_disable_rx_ol_in_concurrency =
-					hdd_disable_rx_ol_in_concurrency;
+	dp_cbs.hdd_rx_handle_concurrency = hdd_rx_handle_concurrency;
 	dp_cbs.hdd_set_rx_mode_rps_cb = hdd_set_rx_mode_rps;
 	dp_cbs.hdd_ipa_set_mcc_mode_cb = hdd_ipa_set_mcc_mode;
 	dp_cbs.hdd_v2_flow_pool_map = hdd_v2_flow_pool_map;

+ 2 - 2
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -1038,7 +1038,7 @@ int hdd_ndp_new_peer_handler(uint8_t vdev_id, uint16_t sta_id,
 		if (hdd_ctx->ol_enable &&
 		    !NAN_CONCURRENCY_SUPPORTED(hdd_ctx->psoc)) {
 			hdd_debug("Disable LRO/GRO in NDI Mode");
-			hdd_disable_rx_ol_in_concurrency(true);
+			hdd_rx_handle_concurrency(true);
 		}
 
 		hdd_bus_bw_compute_prev_txrx_stats(adapter);
@@ -1089,7 +1089,7 @@ void hdd_cleanup_ndi(struct hdd_context *hdd_ctx,
 						PM_STA_MODE,
 						NULL) == 1)))) {
 		hdd_debug("Enable LRO/GRO");
-		hdd_disable_rx_ol_in_concurrency(false);
+		hdd_rx_handle_concurrency(false);
 	}
 }
 

+ 28 - 3
core/hdd/src/wlan_hdd_tx_rx.c

@@ -2084,14 +2084,30 @@ int hdd_rx_ol_init(struct hdd_context *hdd_ctx)
 	return 0;
 }
 
-void hdd_disable_rx_ol_in_concurrency(bool disable)
+void hdd_rx_handle_concurrency(bool is_concurrency)
 {
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 
 	if (!hdd_ctx)
 		return;
 
-	if (disable) {
+	if (hdd_ctx->is_wifi3_0_target) {
+		/*
+		 * Donot disable rx offload on concurrency for lithium and
+		 * beryllium based targets
+		 */
+		if (is_concurrency)
+			qdf_atomic_set(&hdd_ctx->rx_skip_qdisc_chk_conc, 1);
+		else
+			qdf_atomic_set(&hdd_ctx->rx_skip_qdisc_chk_conc, 0);
+
+		return;
+	}
+
+	if (!hdd_ctx->ol_enable)
+		return;
+
+	if (is_concurrency) {
 		if (HDD_MSM_CFG(hdd_ctx->config->enable_tcp_delack)) {
 			struct wlan_rx_tp_data rx_tp_data;
 
@@ -2127,7 +2143,7 @@ int hdd_rx_ol_init(struct hdd_context *hdd_ctx)
 	return -EPERM;
 }
 
-void hdd_disable_rx_ol_in_concurrency(bool disable)
+void hdd_rx_handle_concurrency(bool is_concurrency)
 {
 }
 
@@ -2300,6 +2316,15 @@ hdd_rx_check_qdisc_for_adapter(struct hdd_adapter *adapter, uint8_t rx_ctx_id)
 	if (qdf_unlikely(!soc))
 		return;
 
+	/*
+	 * Restrict the qdisc based dynamic GRO enable/disable to
+	 * standalone STA mode only. Reset the configuration for
+	 * any other device mode or concurrency.
+	 */
+	if (adapter->device_mode != QDF_STA_MODE ||
+	    (qdf_atomic_read(&adapter->hdd_ctx->rx_skip_qdisc_chk_conc)))
+		goto reset_wl;
+
 	if (!adapter->dev->ingress_queue)
 		goto reset_wl;