Browse Source

qcacmn: improve mboxping TX t-put for SDIO project

qcacld-2.0 to qcacmn propagation

Return HTC_SEND_FULL_KEEP directly in epping_tx_queue_full function
and give nodrop pkts higher priority over normal pkts

Change-Id: Ib36e1a9f34eb9054b12f0e8ba54a86ace7d6c8f8
CRs-Fixed: 990726
gbian 8 years ago
parent
commit
b417db2f04
4 changed files with 42 additions and 5 deletions
  1. 1 0
      htc/htc.c
  2. 13 0
      htc/htc_api.h
  3. 6 0
      htc/htc_internal.h
  4. 22 5
      htc/htc_send.c

+ 1 - 0
htc/htc.c

@@ -266,6 +266,7 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, qdf_device_t osdev,
 	qdf_spinlock_create(&target->HTCRxLock);
 	qdf_spinlock_create(&target->HTCTxLock);
 	qdf_spinlock_create(&target->HTCCreditLock);
+	target->is_nodrop_pkt = false;
 
 	do {
 		qdf_mem_copy(&target->HTCInitInfo, pInfo,

+ 13 - 0
htc/htc_api.h

@@ -637,6 +637,19 @@ A_STATUS htc_add_receive_pkt_multiple(HTC_HANDLE HTCHandle,
 bool htc_is_endpoint_active(HTC_HANDLE HTCHandle,
 			      HTC_ENDPOINT_ID Endpoint);
 
+/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+   @desc: Set up nodrop pkt flag for mboxping nodrop pkt
+   @function name: htc_set_nodrop_pkt
+   @input:  HTCHandle - HTC handle
+	isNodropPkt - indicates whether it is nodrop pkt
+   @output:
+   @return:
+   @notes:
+   @example:
+   @see also:
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+void htc_set_nodrop_pkt(HTC_HANDLE HTCHandle, A_BOOL isNodropPkt);
+
 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    @desc: Get the number of recv buffers currently queued into an HTC endpoint
    @function name: htc_get_num_recv_buffers

+ 6 - 0
htc/htc_internal.h

@@ -201,6 +201,12 @@ typedef struct _HTC_TARGET {
 #endif
 
 	uint32_t con_mode;
+
+	/*
+	 * This flag is from the mboxping tool. It indicates that we cannot
+	 * drop it. Besides, nodrop pkts have higher priority than normal pkts.
+	 */
+	A_BOOL is_nodrop_pkt;
 } HTC_TARGET;
 
 #if defined ENABLE_BUNDLE_TX

+ 22 - 5
htc/htc_send.c

@@ -1122,11 +1122,22 @@ static HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target,
 	LOCK_HTC_TX(target);
 
 	if (!HTC_QUEUE_EMPTY(&sendQueue)) {
-		/* transfer packets to tail */
-		HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&pEndpoint->TxQueue,
-						  &sendQueue);
-		A_ASSERT(HTC_QUEUE_EMPTY(&sendQueue));
-		INIT_HTC_PACKET_QUEUE(&sendQueue);
+		if (target->is_nodrop_pkt) {
+			/*
+			 * nodrop pkts have higher priority than normal pkts,
+			 * insert nodrop pkt to head for proper
+			 * start/termination of test.
+			 */
+			HTC_PACKET_QUEUE_TRANSFER_TO_HEAD(&pEndpoint->TxQueue,
+					&sendQueue);
+			target->is_nodrop_pkt = false;
+		} else {
+			/* transfer packets to tail */
+			HTC_PACKET_QUEUE_TRANSFER_TO_TAIL(&pEndpoint->TxQueue,
+					&sendQueue);
+			A_ASSERT(HTC_QUEUE_EMPTY(&sendQueue));
+			INIT_HTC_PACKET_QUEUE(&sendQueue);
+		}
 	}
 
 	/* increment tx processing count on entry */
@@ -2034,6 +2045,12 @@ bool htc_is_endpoint_active(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint)
 	return true;
 }
 
+void htc_set_nodrop_pkt(HTC_HANDLE HTCHandle, A_BOOL isNodropPkt)
+{
+	HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
+	target->is_nodrop_pkt = isNodropPkt;
+}
+
 /**
  * htc_process_credit_rpt() - process credit report, call distribution function
  * @target: pointer to HTC_TARGET