Ver código fonte

qcacld-3.0: Save low latency connection count in DP vdev

The 11g and 11a connections are latency critical and
hence tx coalescing cannot be applied on traffic
running for these connections.

Detect the latency critical connections and save the
number of latency critical connections in DP vdev.
This information can be used by the Software latency
manager to skip tx register write coalescing when there
is a packet transmission for low latency connections.

Change-Id: I2ebf40e670cc3139b2bc41a690c79ebb31c7b9c7
CRs-Fixed: 2769026
Rakesh Pillai 4 anos atrás
pai
commit
d74aee1730

+ 31 - 10
core/hdd/inc/wlan_hdd_main.h

@@ -76,6 +76,7 @@
 #include <wlan_hdd_lro.h>
 #include "cdp_txrx_flow_ctrl_legacy.h"
 #include <cdp_txrx_peer_ops.h>
+#include <cdp_txrx_misc.h>
 #include "wlan_hdd_nan_datapath.h"
 #if defined(CONFIG_HL_SUPPORT)
 #include "wlan_tgt_def_config_hl.h"
@@ -2687,22 +2688,32 @@ bool hdd_is_any_adapter_connected(struct hdd_context *hdd_ctx);
 
 /**
  * hdd_add_latency_critical_client() - Add latency critical client
- * @hdd_ctx: Global HDD context
+ * @adapter: adapter handle (Should not be NULL)
  * @phymode: the phymode of the connected adapter
  *
- * This function adds to the latency critical count if the present
- * connection is also a latency critical one.
+ * This function checks if the present connection is latency critical
+ * and adds to the latency critical clients count and informs the
+ * datapath about this connection being latency critical.
  *
  * Returns: None
  */
 static inline void
-hdd_add_latency_critical_client(struct hdd_context *hdd_ctx,
+hdd_add_latency_critical_client(struct hdd_adapter *adapter,
 				enum qca_wlan_802_11_mode phymode)
 {
+	struct hdd_context *hdd_ctx = adapter->hdd_ctx;
+
 	switch (phymode) {
 	case QCA_WLAN_802_11_MODE_11A:
 	case QCA_WLAN_802_11_MODE_11G:
-		qdf_atomic_inc(&hdd_ctx->num_latency_critical_clients);
+		if (adapter->device_mode == QDF_STA_MODE)
+			qdf_atomic_inc(&hdd_ctx->num_latency_critical_clients);
+
+		hdd_info("Adding latency critical connection for vdev %d",
+			 adapter->vdev_id);
+		cdp_vdev_inform_ll_conn(cds_get_context(QDF_MODULE_ID_SOC),
+					adapter->vdev_id,
+					CDP_VDEV_LL_CONN_ADD);
 		break;
 	default:
 		break;
@@ -2711,22 +2722,32 @@ hdd_add_latency_critical_client(struct hdd_context *hdd_ctx,
 
 /**
  * hdd_del_latency_critical_client() - Add tlatency critical client
- * @hdd_ctx: Global HDD context
+ * @adapter: adapter handle (Should not be NULL)
  * @phymode: the phymode of the connected adapter
  *
- * This function removes from the latency critical count if the present
- * connection is also a latency critical one.
+ * This function checks if the present connection was latency critical
+ * and removes from the latency critical clients count and informs the
+ * datapath about the removed connection being latency critical.
  *
  * Returns: None
  */
 static inline void
-hdd_del_latency_critical_client(struct hdd_context *hdd_ctx,
+hdd_del_latency_critical_client(struct hdd_adapter *adapter,
 				enum qca_wlan_802_11_mode phymode)
 {
+	struct hdd_context *hdd_ctx = adapter->hdd_ctx;
+
 	switch (phymode) {
 	case QCA_WLAN_802_11_MODE_11A:
 	case QCA_WLAN_802_11_MODE_11G:
-		qdf_atomic_dec(&hdd_ctx->num_latency_critical_clients);
+		if (adapter->device_mode == QDF_STA_MODE)
+			qdf_atomic_dec(&hdd_ctx->num_latency_critical_clients);
+
+		hdd_info("Removing latency critical connection for vdev %d",
+			 adapter->vdev_id);
+		cdp_vdev_inform_ll_conn(cds_get_context(QDF_MODULE_ID_SOC),
+					adapter->vdev_id,
+					CDP_VDEV_LL_CONN_DEL);
 		break;
 	default:
 		break;

+ 7 - 6
core/hdd/inc/wlan_hdd_softap_tx_rx.h

@@ -128,15 +128,16 @@ QDF_STATUS hdd_softap_deregister_sta(struct hdd_adapter *adapter,
  * @auth_required: is additional authentication required?
  * @privacy_required: should 802.11 privacy bit be set?
  * @sta_mac: station MAC address
- * @wmm_enabled: is WMM enabled for this STA?
+ * @event: STA assoc complete event (Can be NULL)
  *
  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
  */
-QDF_STATUS hdd_softap_register_sta(struct hdd_adapter *adapter,
-				   bool auth_required,
-				   bool privacy_required,
-				   struct qdf_mac_addr *sta_mac,
-				   bool wmm_enabled);
+QDF_STATUS
+hdd_softap_register_sta(struct hdd_adapter *adapter,
+			bool auth_required,
+			bool privacy_required,
+			struct qdf_mac_addr *sta_mac,
+			tSap_StationAssocReassocCompleteEvent *event);
 
 /**
  * hdd_softap_register_bc_sta() - Register the SoftAP broadcast STA

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

@@ -1595,7 +1595,7 @@ static void hdd_send_association_event(struct net_device *dev,
 #endif
 
 		hdd_add_latency_critical_client(
-			hdd_ctx,
+			adapter,
 			hdd_convert_cfgdot11mode_to_80211mode(
 				sta_ctx->conn_info.dot11mode));
 		/* start timer in sta/p2p_cli */
@@ -1638,7 +1638,7 @@ static void hdd_send_association_event(struct net_device *dev,
 					  adapter->vdev);
 
 		hdd_del_latency_critical_client(
-			hdd_ctx,
+			adapter,
 			hdd_convert_cfgdot11mode_to_80211mode(
 				sta_ctx->conn_info.dot11mode));
 		/* stop timer in sta/p2p_cli */

+ 4 - 13
core/hdd/src/wlan_hdd_hostapd.c

@@ -1397,17 +1397,7 @@ static int calcuate_max_phy_rate(int mode, int nss, int ch_width,
 	return maxrate;
 }
 
-/**
- * hdd_convert_dot11mode_from_phymode() - get dot11 mode from phymode
- * @phymode: phymode of sta associated to SAP
- *
- * The function is to convert the phymode to corresponding dot11 mode
- *
- * Return: dot11mode.
- */
-
-
-static int hdd_convert_dot11mode_from_phymode(int phymode)
+enum qca_wlan_802_11_mode hdd_convert_dot11mode_from_phymode(int phymode)
 {
 
 	switch (phymode) {
@@ -2289,7 +2279,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 						ap_ctx->privacy,
 						(struct qdf_mac_addr *)
 						wrqu.addr.sa_data,
-						event->wmmEnabled);
+						event);
 			if (!QDF_IS_STATUS_SUCCESS(qdf_status))
 				hdd_err("Failed to register STA %d "
 					QDF_MAC_ADDR_FMT, qdf_status,
@@ -2301,7 +2291,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 						ap_ctx->privacy,
 						(struct qdf_mac_addr *)
 						wrqu.addr.sa_data,
-						event->wmmEnabled);
+						event);
 			if (!QDF_IS_STATUS_SUCCESS(qdf_status))
 				hdd_err("Failed to register STA %d "
 					QDF_MAC_ADDR_FMT, qdf_status,
@@ -2526,6 +2516,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 						NULL,
 						adapter->device_mode);
 		}
+
 		/*stop timer in sap/p2p_go */
 		if (ap_ctx->ap_active == false) {
 			hdd_bus_bw_compute_reset_prev_txrx_stats(adapter);

+ 10 - 0
core/hdd/src/wlan_hdd_hostapd.h

@@ -278,6 +278,16 @@ void
 hdd_check_and_disconnect_sta_on_invalid_channel(struct hdd_context *hdd_ctx,
 						tSirMacReasonCodes reason);
 
+/**
+ * hdd_convert_dot11mode_from_phymode() - get dot11 mode from phymode
+ * @phymode: phymode of sta associated to SAP
+ *
+ * The function is to convert the phymode to corresponding dot11 mode
+ *
+ * Return: dot11mode.
+ */
+enum qca_wlan_802_11_mode hdd_convert_dot11mode_from_phymode(int phymode);
+
 /**
  * hdd_stop_sap_due_to_invalid_channel() - to stop sap in case of invalid chnl
  * @work: pointer to work structure

+ 12 - 2
core/hdd/src/wlan_hdd_softap_tx_rx.c

@@ -1230,6 +1230,8 @@ QDF_STATUS hdd_softap_deregister_sta(struct hdd_adapter *adapter,
 				      mac_addr->bytes) != QDF_STATUS_SUCCESS)
 			hdd_debug("WLAN_CLIENT_DISCONNECT event failed");
 	}
+
+	hdd_del_latency_critical_client(adapter, sta->dot11_mode);
 	hdd_sta_info_detach(&adapter->sta_info_list, &sta);
 
 	ucfg_mlme_update_oce_flags(hdd_ctx->pdev);
@@ -1241,7 +1243,7 @@ QDF_STATUS hdd_softap_register_sta(struct hdd_adapter *adapter,
 				   bool auth_required,
 				   bool privacy_required,
 				   struct qdf_mac_addr *sta_mac,
-				   bool wmm_enabled)
+				   tSap_StationAssocReassocCompleteEvent *event)
 {
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
 	struct ol_txrx_desc_type txrx_desc = {0};
@@ -1250,6 +1252,13 @@ QDF_STATUS hdd_softap_register_sta(struct hdd_adapter *adapter,
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	struct hdd_ap_ctx *ap_ctx;
 	struct hdd_station_info *sta_info;
+	bool wmm_enabled = false;
+	enum qca_wlan_802_11_mode dot11mode = QCA_WLAN_802_11_MODE_INVALID;
+
+	if (event) {
+		wmm_enabled = event->wmmEnabled;
+		dot11mode = hdd_convert_dot11mode_from_phymode(event->chan_info.info);
+	}
 
 	ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(adapter);
 
@@ -1275,6 +1284,7 @@ QDF_STATUS hdd_softap_register_sta(struct hdd_adapter *adapter,
 	}
 
 	txrx_desc.is_qos_enabled = wmm_enabled;
+	hdd_add_latency_critical_client(adapter, dot11mode);
 
 	/* Register the vdev transmit and receive functions */
 	qdf_mem_zero(&txrx_ops, sizeof(txrx_ops));
@@ -1379,7 +1389,7 @@ QDF_STATUS hdd_softap_register_bc_sta(struct hdd_adapter *adapter,
 
 	qdf_status = hdd_softap_register_sta(adapter, false,
 					     privacy_required,
-					     &broadcast_macaddr, 0);
+					     &broadcast_macaddr, NULL);
 
 	return qdf_status;
 }