Эх сурвалжийг харах

qcacmn: Track HTT nbuf map and unmap count

Add logs to track nbuf map and unmap count for HTT messages.

Change-Id: Ib2fdcdb03b2a8d5e574f34e3eef30601d3976664
CRs-Fixed: 3184850
Amit Mehta 3 жил өмнө
parent
commit
70a8e8a708
3 өөрчлөгдсөн 15 нэмэгдсэн , 1 устгасан
  1. 3 0
      htc/htc.c
  2. 4 0
      htc/htc_internal.h
  3. 8 1
      htc/htc_send.c

+ 3 - 0
htc/htc.c

@@ -200,6 +200,9 @@ static void htc_cleanup(HTC_TARGET *target)
 		qdf_mem_free(pPacket);
 	}
 #endif
+	HTC_INFO("%s: Non flow ctrl enabled endpoints nbuf map: %d, unamp: %d",
+		 __func__, target->nbuf_nfc_map_count,
+		 target->nbuf_nfc_unmap_count);
 
 	htc_flush_endpoint_txlookupQ(target, ENDPOINT_0, true);
 

+ 4 - 0
htc/htc_internal.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 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
@@ -264,6 +265,9 @@ typedef struct _HTC_TARGET {
 	/* Runtime count for H2T msg with response */
 	qdf_atomic_t htc_runtime_cnt;
 #endif
+	/* Non flow ctrl enabled endpoints nbuf map unmap count */
+	uint32_t nbuf_nfc_map_count;
+	uint32_t nbuf_nfc_unmap_count;
 } HTC_TARGET;
 
 

+ 8 - 1
htc/htc_send.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 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
@@ -131,6 +132,10 @@ static void send_packet_completion(HTC_TARGET *target, HTC_PACKET *pPacket)
 	HTC_ENDPOINT *pEndpoint = &target->endpoint[pPacket->Endpoint];
 	HTC_EP_SEND_PKT_COMPLETE EpTxComplete;
 
+	if ((pPacket->PktInfo.AsTx.Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) &&
+	    (!IS_TX_CREDIT_FLOW_ENABLED(pEndpoint)))
+		target->nbuf_nfc_unmap_count++;
+
 	restore_tx_packet(target, pPacket);
 
 	/*
@@ -1933,7 +1938,9 @@ static inline QDF_STATUS __htc_send_pkt(HTC_HANDLE HTCHandle,
 		status = qdf_nbuf_map(target->osdev,
 				      GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket),
 				      QDF_DMA_TO_DEVICE);
-		if (status != QDF_STATUS_SUCCESS) {
+		if (status == QDF_STATUS_SUCCESS) {
+			target->nbuf_nfc_map_count++;
+		} else {
 			AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
 					("%s: nbuf map failed, endpoint %pK, seq_no. %d\n",
 					 __func__, pEndpoint, pEndpoint->SeqNo));