Browse Source

qcacld-3.0: Increase buff size for ADDBA resp for EHT

The current maximum buffer size for an ADDBA response action frame is
256 bytes. This needs to be increased in case of EHT session.

Change-Id: I4e4dbe1dbe5c69954d26f73cf51177358c411083
CRs-Fixed: 3185336
Paul Zhang 2 years ago
parent
commit
6226c7ead9

+ 3 - 2
components/mlme/dispatcher/inc/cfg_qos.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021-2022 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
@@ -170,7 +171,7 @@
  * gRxAggregationSize - Gives an option to configure Rx aggregation size
  * in no of MPDUs
  * @Min: 1
- * @Max: 256
+ * @Max: 1024
  * @Default: 256
  *
  * gRxAggregationSize gives an option to configure Rx aggregation size
@@ -187,7 +188,7 @@
 #define CFG_RX_AGGREGATION_SIZE CFG_INI_UINT( \
 			"gRxAggregationSize", \
 			1, \
-			256, \
+			1024, \
 			256, \
 			CFG_VALUE_OR_DEFAULT, \
 			"Rx Aggregation size value")

+ 9 - 2
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -1566,6 +1566,7 @@ static void lim_process_addba_req(struct mac_context *mac_ctx, uint8_t *rx_pkt_i
 	uint16_t aid, buff_size;
 	bool he_cap = false;
 	bool eht_cap = false;
+	uint8_t extd_buff_size = 0;
 
 	mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
 	body_ptr = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
@@ -1609,15 +1610,21 @@ static void lim_process_addba_req(struct mac_context *mac_ctx, uint8_t *rx_pkt_i
 	if (mac_ctx->usr_cfg_ba_buff_size)
 		buff_size = mac_ctx->usr_cfg_ba_buff_size;
 
+	if (addba_req->addba_extn_element.present)
+		extd_buff_size = addba_req->addba_extn_element.extd_buff_size;
+
 	if (addba_req->addba_param_set.buff_size)
 		buff_size = QDF_MIN(buff_size,
 				    addba_req->addba_param_set.buff_size);
+	else if (extd_buff_size)
+		/* limit the buff size */
+		buff_size = QDF_MIN(buff_size, MAX_EHT_BA_BUFF_SIZE);
 
-	pe_debug("token %d tid %d timeout %d buff_size in frame %d buf_size calculated %d ssn %d",
+	pe_debug("token %d tid %d timeout %d buff_size in frame %d buf_size calculated %d ssn %d, extd buff size %d",
 		 addba_req->DialogToken.token, addba_req->addba_param_set.tid,
 		 addba_req->ba_timeout.timeout,
 		 addba_req->addba_param_set.buff_size, buff_size,
-		 addba_req->ba_start_seq_ctrl.ssn);
+		 addba_req->ba_start_seq_ctrl.ssn, extd_buff_size);
 
 	qdf_status = cdp_addba_requestprocess(
 					soc, mac_hdr->sa,

+ 52 - 23
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -5817,12 +5817,14 @@ QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx,
 	uint8_t tx_flag = 0;
 	uint8_t vdev_id = 0;
 	uint16_t buff_size, status_code, batimeout;
+	uint16_t frm_buff_size = 0;
 	uint8_t dialog_token;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	uint8_t he_frag = 0;
 	tpDphHashNode sta_ds = NULL;
 	uint16_t aid;
 	bool he_cap = false;
+	bool eht_cap = false;
 	struct wlan_mlme_qos *qos_aggr;
 
 	vdev_id = session->vdev_id;
@@ -5841,49 +5843,73 @@ QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx,
 
 	sta_ds = dph_lookup_hash_entry(mac_ctx, peer_mac, &aid,
 				       &session->dph.dphHashTable);
+
+	if (sta_ds && lim_is_session_he_capable(session))
+		he_cap = lim_is_sta_he_capable(sta_ds);
+
+	if (sta_ds && lim_is_session_eht_capable(session))
+		eht_cap = lim_is_sta_eht_capable(sta_ds);
+
 	if ((LIM_IS_STA_ROLE(session) && qos_aggr->rx_aggregation_size == 1 &&
 	    !mac_ctx->usr_cfg_ba_buff_size) || mac_ctx->reject_addba_req) {
 		frm.Status.status = STATUS_REQUEST_DECLINED;
 		pe_err("refused addba req for rx_aggregation_size: %d mac_ctx->reject_addba_req: %d",
 		       qos_aggr->rx_aggregation_size, mac_ctx->reject_addba_req);
 	} else if (LIM_IS_STA_ROLE(session) && !mac_ctx->usr_cfg_ba_buff_size) {
-		frm.addba_param_set.buff_size =
+		frm_buff_size =
 			QDF_MIN(qos_aggr->rx_aggregation_size, calc_buff_size);
-	} else {
-		if (sta_ds && lim_is_session_he_capable(session))
-			he_cap = lim_is_sta_he_capable(sta_ds);
+		pe_debug("rx_aggregation_size %d, calc_buff_size %d",
+			 qos_aggr->rx_aggregation_size, calc_buff_size);
 
+		if (eht_cap) {
+			if (frm_buff_size > MAX_EHT_BA_BUFF_SIZE)
+				frm_buff_size = MAX_EHT_BA_BUFF_SIZE;
+		} else {
+			if (frm_buff_size > MAX_BA_BUFF_SIZE)
+				frm_buff_size = MAX_BA_BUFF_SIZE;
+		}
+	} else {
 		if (sta_ds && sta_ds->staType == STA_ENTRY_NDI_PEER)
-			frm.addba_param_set.buff_size = calc_buff_size;
+			frm_buff_size = calc_buff_size;
+		else if (eht_cap)
+			frm_buff_size = MAX_EHT_BA_BUFF_SIZE;
 		else if (he_cap)
-			frm.addba_param_set.buff_size = MAX_BA_BUFF_SIZE;
+			frm_buff_size = MAX_BA_BUFF_SIZE;
 		else
-			frm.addba_param_set.buff_size =
-					SIR_MAC_BA_DEFAULT_BUFF_SIZE;
+			frm_buff_size = SIR_MAC_BA_DEFAULT_BUFF_SIZE;
 
 		if (mac_ctx->usr_cfg_ba_buff_size)
-			frm.addba_param_set.buff_size =
-					mac_ctx->usr_cfg_ba_buff_size;
+			frm_buff_size = mac_ctx->usr_cfg_ba_buff_size;
 
-		if (frm.addba_param_set.buff_size > MAX_BA_BUFF_SIZE)
-			frm.addba_param_set.buff_size = MAX_BA_BUFF_SIZE;
+		if (eht_cap) {
+			if (frm_buff_size > MAX_EHT_BA_BUFF_SIZE)
+				frm_buff_size = MAX_EHT_BA_BUFF_SIZE;
+		} else {
+			if (frm_buff_size > MAX_BA_BUFF_SIZE)
+				frm_buff_size = MAX_BA_BUFF_SIZE;
+		}
 
-		if (frm.addba_param_set.buff_size > SIR_MAC_BA_DEFAULT_BUFF_SIZE) {
+		if (frm_buff_size > SIR_MAC_BA_DEFAULT_BUFF_SIZE) {
 			if (session->active_ba_64_session) {
-				frm.addba_param_set.buff_size =
-					SIR_MAC_BA_DEFAULT_BUFF_SIZE;
+				frm_buff_size = SIR_MAC_BA_DEFAULT_BUFF_SIZE;
 			}
 		} else if (!session->active_ba_64_session) {
 			session->active_ba_64_session = true;
 		}
-		if (buff_size && (frm.addba_param_set.buff_size > buff_size)) {
+		if (buff_size && frm_buff_size > buff_size) {
 			pe_debug("buff size: %d larger than peer's capability: %d",
-				 frm.addba_param_set.buff_size, buff_size);
-			frm.addba_param_set.buff_size = buff_size;
+				 frm_buff_size, buff_size);
+			frm_buff_size = buff_size;
 		}
 	}
 
+	/* In case where AP advertizes BA window size which is different
+	 * than our max supported BA window size.
+	 */
+	cdp_tid_update_ba_win_size(soc, peer_mac, vdev_id, tid, frm_buff_size);
+
 	frm.addba_param_set.tid = tid;
+	frm.addba_param_set.buff_size = frm_buff_size % MAX_EHT_BA_BUFF_SIZE;
 
 	/* Enable RX AMSDU only in HE mode if supported */
 	if (mac_ctx->is_usr_cfg_amsdu_enabled &&
@@ -5900,6 +5926,8 @@ QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx,
 	if (addba_extn_present) {
 		frm.addba_extn_element.present = 1;
 		frm.addba_extn_element.no_fragmentation = 1;
+		frm.addba_extn_element.extd_buff_size =
+					frm_buff_size / MAX_EHT_BA_BUFF_SIZE;
 		if (lim_is_session_he_capable(session)) {
 			he_frag = lim_get_session_he_frag_cap(session);
 			if (he_frag != 0) {
@@ -5917,11 +5945,12 @@ QDF_STATUS lim_send_addba_response_frame(struct mac_context *mac_ctx,
 		 tid, frm.DialogToken.token, frm.Status.status,
 		 frm.addba_param_set.buff_size,
 		 frm.addba_param_set.amsdu_supp);
-	pe_debug("addba_extn %d he_capable %d no_frag %d he_frag %d",
-		addba_extn_present,
-		lim_is_session_he_capable(session),
-		frm.addba_extn_element.no_fragmentation,
-		frm.addba_extn_element.he_frag_operation);
+	pe_debug("addba_extn %d he_capable %d no_frag %d he_frag %d, exted buff size %d",
+		 addba_extn_present,
+		 lim_is_session_he_capable(session),
+		 frm.addba_extn_element.no_fragmentation,
+		 frm.addba_extn_element.he_frag_operation,
+		 frm.addba_extn_element.extd_buff_size);
 
 	status = dot11f_get_packed_addba_rsp_size(mac_ctx, &frm, &payload_size);
 	if (DOT11F_FAILED(status)) {