From ed268b7b2407c396850251f4dc989c58deeebec9 Mon Sep 17 00:00:00 2001 From: Tiger Yu Date: Wed, 7 Jun 2017 12:53:17 +0800 Subject: qcacld-2.0: Fix the TX packet drop after doing the TX bundle The driver will drop the TX packet if remaining depth of the sending queue is less than 2. This will casue the memory leak, credits missing and TCP stall issue when running the iperf test. The fix is to add back current packet before return, which just be dequeued. Change-Id: I9e0c69c16e9562afd627d0fc222a9fbd475c468c CRs-Fixed: 2056195 --- CORE/SERVICES/HTC/htc_send.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CORE/SERVICES/HTC/htc_send.c b/CORE/SERVICES/HTC/htc_send.c index 508e4f43d3ab..f416f6bdd95f 100644 --- a/CORE/SERVICES/HTC/htc_send.c +++ b/CORE/SERVICES/HTC/htc_send.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -482,13 +482,18 @@ static void HTCIssuePacketsBundle(HTC_TARGET *target, /* send out previous buffer */ HTCSendBundledNetbuf(target, pEndpoint, pBundleBuffer - last_creditPad, pPacketTx); - if (HTC_PACKET_QUEUE_DEPTH(pPktQueue) < HTC_MIN_MSG_PER_BUNDLE){ + /* One packet has been dequeued from sending queue when enter + * this loop, so need to add 1 back for this checking. + */ + if ((HTC_PACKET_QUEUE_DEPTH(pPktQueue) + 1) < HTC_MIN_MSG_PER_BUNDLE){ + HTC_PACKET_ENQUEUE_TO_HEAD(pPktQueue, pPacket); return; } bundlesSpaceRemaining = HTC_MAX_MSG_PER_BUNDLE_TX * pEndpoint->TxCreditSize; pPacketTx = AllocateHTCBundleTxPacket(target); if (!pPacketTx) { + HTC_PACKET_ENQUEUE_TO_HEAD(pPktQueue, pPacket); //good time to panic AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("AllocateHTCBundleTxPacket failed \n")); AR_DEBUG_ASSERT(FALSE); -- cgit v1.2.3