Browse Source

qcacmn: Populate MU-MIMO user pos and mu group id

populate TX OFDMA and TX MU MIMO information from
user rate tlv and display the same in fc_peer_stats.

Change-Id: If1dab15bbdf391fba00a701abd6024c420d1d8f7
nobelj 6 years ago
parent
commit
4e9d51f914
4 changed files with 120 additions and 3 deletions
  1. 7 0
      dp/inc/cdp_txrx_cmn_struct.h
  2. 27 0
      dp/inc/cdp_txrx_stats_struct.h
  3. 48 1
      dp/wifi3.0/dp_htt.c
  4. 38 2
      dp/wifi3.0/dp_main.c

+ 7 - 0
dp/inc/cdp_txrx_cmn_struct.h

@@ -1105,8 +1105,12 @@ struct cdp_tx_sojourn_stats {
  * @ba_bitmap: Block Ack bitmap
  * @start_seqa: Sequence number of first MPDU
  * @enq_bitmap: Enqueue MPDU bitmap
+ * @ru_start: RU start index
+ * @ru_tones: RU tones length
  * @is_mcast: MCAST or UCAST
  * @tx_rate: Transmission Rate
+ * @user_pos: user position
+ * @mu_group_id: mu group id
  */
 struct cdp_tx_completion_ppdu_user {
 	uint32_t completion_status:8,
@@ -1151,6 +1155,7 @@ struct cdp_tx_completion_ppdu_user {
 	uint32_t num_mpdu:9,
 		 num_msdu:16;
 	uint32_t tx_duration;
+	uint16_t ru_start;
 	uint16_t ru_tones;
 	bool is_mcast;
 	uint32_t tx_rate;
@@ -1158,6 +1163,8 @@ struct cdp_tx_completion_ppdu_user {
 	/*ack rssi for separate chains*/
 	uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
 	bool ack_rssi_valid;
+	uint32_t user_pos;
+	uint32_t mu_group_id;
 };
 
 /**

+ 27 - 0
dp/inc/cdp_txrx_stats_struct.h

@@ -53,6 +53,22 @@
 #define MAX_BW 7
 #define MAX_RECEPTION_TYPES 4
 
+#define MAX_TRANSMIT_TYPES	9
+#define SU_TX			0
+#define MUMIMO_TX		1
+#define MUOFDMA_TX		2
+#define MUMIMO_OFDMA_TX		3
+
+#define MAX_USER_POS		8
+#define MAX_MU_GROUP_ID		64
+#define MAX_RU_LOCATIONS	6
+#define RU_26			1
+#define RU_52			2
+#define RU_106			4
+#define RU_242			9
+#define RU_484			18
+#define RU_996			37
+
 /* WME stream classes */
 #define WME_AC_BE    0    /* best effort */
 #define WME_AC_BK    1    /* background */
@@ -229,6 +245,11 @@ struct cdp_pkt_type {
  * @failed_retry_count: packets failed due to retry above 802.11 retry limit
  * @retry_count: packets successfully send after one or more retry
  * @multiple_retry_count: packets successfully sent after more than one retry
+ * @transmit_type: tx transmit type
+ * @mu_group_id: mumimo mu group id
+ * @ru_start: RU start index
+ * @ru_tones: RU tones size
+ * @ru_loc: RU location 26/ 52/ 106/ 242/ 484 counter
  */
 struct cdp_tx_stats {
 	struct cdp_pkt_info comp_pkt;
@@ -308,6 +329,12 @@ struct cdp_tx_stats {
 	uint32_t retry_count;
 	uint32_t multiple_retry_count;
 	uint32_t last_tx_rate_used;
+
+	uint32_t transmit_type[MAX_TRANSMIT_TYPES];
+	uint32_t mu_group_id[MAX_MU_GROUP_ID];
+	uint32_t ru_start;
+	uint32_t ru_tones;
+	uint32_t ru_loc[MAX_RU_LOCATIONS];
 };
 
 /* struct cdp_rx_stats - rx Level Stats

+ 48 - 1
dp/wifi3.0/dp_htt.c

@@ -147,6 +147,44 @@ static void dp_tx_stats_update(struct dp_soc *soc, struct dp_peer *peer,
 	if (soc->process_tx_status)
 		return;
 
+	DP_STATS_INC(peer, tx.transmit_type[ppdu->ppdu_type], 1);
+
+	if (ppdu->mu_group_id <= MAX_MU_GROUP_ID && ppdu->ppdu_type != SU_TX) {
+		if (unlikely(!(ppdu->mu_group_id & (MAX_MU_GROUP_ID - 1))))
+			QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+				  "mu_group_id out of bound!!\n");
+		else
+			DP_STATS_UPD(peer, tx.mu_group_id[ppdu->mu_group_id],
+				     (ppdu->user_pos + 1));
+	}
+
+	if (ppdu->ppdu_type == MUMIMO_TX ||
+	    ppdu->ppdu_type == MUMIMO_OFDMA_TX) {
+		DP_STATS_UPD(peer, tx.ru_tones, ppdu->ru_tones);
+		DP_STATS_UPD(peer, tx.ru_start, ppdu->ru_start);
+		switch (ppdu->ru_tones) {
+		case RU_26:
+			DP_STATS_INC(peer, tx.ru_loc[0], 1);
+		break;
+		case RU_52:
+			DP_STATS_INC(peer, tx.ru_loc[1], 1);
+		break;
+		case RU_106:
+			DP_STATS_INC(peer, tx.ru_loc[2], 1);
+		break;
+		case RU_242:
+			DP_STATS_INC(peer, tx.ru_loc[3], 1);
+		break;
+		case RU_484:
+			DP_STATS_INC(peer, tx.ru_loc[4], 1);
+		break;
+		case RU_996:
+			DP_STATS_INC(peer, tx.ru_loc[5], 1);
+		break;
+		}
+	}
+
+	DP_STATS_INC(peer, tx.transmit_type[ppdu->ppdu_type], 1);
 	DP_STATS_INC_PKT(peer, tx.comp_pkt,
 			num_msdu, (ppdu->success_bytes +
 				ppdu->retry_bytes + ppdu->failed_bytes));
@@ -1889,8 +1927,17 @@ static void dp_process_ppdu_stats_user_rate_tlv(struct dp_pdev *pdev,
 	ppdu_user_desc->tid =
 		HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_GET(*tag_buf);
 
-	tag_buf += 2;
+	tag_buf += 1;
+
+	ppdu_user_desc->user_pos =
+		HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_GET(*tag_buf);
+	ppdu_user_desc->mu_group_id =
+		HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_GET(*tag_buf);
+
+	tag_buf += 1;
 
+	ppdu_user_desc->ru_start =
+		HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(*tag_buf);
 	ppdu_user_desc->ru_tones =
 		(HTT_PPDU_STATS_USER_RATE_TLV_RU_END_GET(*tag_buf) -
 		HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(*tag_buf)) + 1;

+ 38 - 2
dp/wifi3.0/dp_main.c

@@ -84,6 +84,8 @@ static void dp_ppdu_ring_cfg(struct dp_pdev *pdev);
 ((DP_WDS_AST_AGING_TIMER_DEFAULT_MS / DP_AST_AGING_TIMER_DEFAULT_MS) - 1)
 #define DP_MCS_LENGTH (6*MAX_MCS)
 #define DP_NSS_LENGTH (6*SS_COUNT)
+#define DP_MU_GROUP_SHOW 16
+#define DP_MU_GROUP_LENGTH (6 * DP_MU_GROUP_SHOW)
 #define DP_RXDMA_ERR_LENGTH (6*HAL_RXDMA_ERR_MAX)
 #define DP_MAX_INT_CONTEXTS_STRING_LENGTH (6 * WLAN_CFG_INT_NUM_CONTEXTS)
 #define DP_REO_ERR_LENGTH (6*HAL_REO_ERR_MAX)
@@ -6921,7 +6923,10 @@ static inline void dp_print_peer_stats(struct dp_peer *peer)
 {
 	uint8_t i;
 	uint32_t index;
+	uint32_t j;
 	char nss[DP_NSS_LENGTH];
+	char mu_group_id[DP_MU_GROUP_LENGTH];
+
 	DP_PRINT_STATS("Node Tx Stats:\n");
 	DP_PRINT_STATS("Total Packet Completions = %d",
 			peer->stats.tx.comp_pkt.num);
@@ -7006,8 +7011,39 @@ static inline void dp_print_peer_stats(struct dp_peer *peer)
 		index += qdf_snprint(&nss[index], DP_NSS_LENGTH - index,
 				" %d", peer->stats.tx.nss[i]);
 	}
-	DP_PRINT_STATS("NSS(1-8) = %s",
-			nss);
+	DP_PRINT_STATS("NSS(1-8) = %s", nss);
+
+	DP_PRINT_STATS("Transmit Type :");
+	DP_PRINT_STATS("SU %d, MU_MIMO %d, MU_OFDMA %d, MU_MIMO_OFDMA %d",
+		       peer->stats.tx.transmit_type[0],
+		       peer->stats.tx.transmit_type[1],
+		       peer->stats.tx.transmit_type[2],
+		       peer->stats.tx.transmit_type[3]);
+
+	for (i = 0; i < MAX_MU_GROUP_ID;) {
+		index = 0;
+		for (j = 0; j < DP_MU_GROUP_SHOW && i < MAX_MU_GROUP_ID;
+		     j++) {
+			index += qdf_snprint(&mu_group_id[index],
+					     DP_MU_GROUP_LENGTH - index,
+					     " %d",
+					     peer->stats.tx.mu_group_id[i]);
+			i++;
+		}
+
+		DP_PRINT_STATS("User position list for GID %02d->%d: [%s]",
+			       i - DP_MU_GROUP_SHOW, i - 1, mu_group_id);
+	}
+
+	DP_PRINT_STATS("Last Packet RU index [%d], Size [%d]",
+		       peer->stats.tx.ru_start, peer->stats.tx.ru_tones);
+	DP_PRINT_STATS("RU Locations RU[26 52 106 242 484 996]:");
+	DP_PRINT_STATS("RU_26: %d", peer->stats.tx.ru_loc[0]);
+	DP_PRINT_STATS("RU 52: %d", peer->stats.tx.ru_loc[1]);
+	DP_PRINT_STATS("RU 106: %d", peer->stats.tx.ru_loc[2]);
+	DP_PRINT_STATS("RU 242: %d", peer->stats.tx.ru_loc[3]);
+	DP_PRINT_STATS("RU 484: %d", peer->stats.tx.ru_loc[4]);
+	DP_PRINT_STATS("RU 996: %d", peer->stats.tx.ru_loc[5]);
 
 	DP_PRINT_STATS("Aggregation:");
 	DP_PRINT_STATS("	Number of Msdu's Part of Amsdu = %d",