summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Babu Kumaravel <kganesh@qti.qualcomm.com>2014-08-28 18:41:38 +0530
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2014-09-04 11:51:36 +0530
commit902ef2b7c8cc02ebc3727e7ede12fb63ade4865e (patch)
treeb56495143ba9172bac17bbd05f58383915a362a7
parent5c29f0295dd76090e86d7326d28fd7a58692e68a (diff)
qcacld: Enable HTT batching
Currently HTT is batching the msdus but while handingover the msdu to HTC it is giving 1 msdu at a time. Inorder to enhance HTC bundling HTT will indicate HTC whether the msdu is part of batch of msdu's through more_data flag. HTT will set more_data flag as 1 for msdu's except the last msdu in the batch of msdu's. HTC will make use if information if HTC bundling is enabled. HTC will queue the packet with more_data flag set. Once the msdu_flag is set to 0 HTC will try to send the batch of msdu by bundling the data. This will help HTC to bundle more data and improve throughput. Change-Id: I33d104c2a37d90282ed16b2b0c542a7f8875c6fa CRs-Fixed: 716742
-rw-r--r--CORE/CLD_TXRX/HTT/htt_tx.c15
-rw-r--r--CORE/SERVICES/COMMON/htc_api.h3
-rw-r--r--CORE/SERVICES/HTC/htc_internal.h9
-rw-r--r--CORE/SERVICES/HTC/htc_send.c27
4 files changed, 40 insertions, 14 deletions
diff --git a/CORE/CLD_TXRX/HTT/htt_tx.c b/CORE/CLD_TXRX/HTT/htt_tx.c
index bece21d4d906..bddc9031e04e 100644
--- a/CORE/CLD_TXRX/HTT/htt_tx.c
+++ b/CORE/CLD_TXRX/HTT/htt_tx.c
@@ -417,7 +417,8 @@ htt_tx_send_base(
htt_pdev_handle pdev,
adf_nbuf_t msdu,
u_int16_t msdu_id,
- int download_len)
+ int download_len,
+ u_int8_t more_data)
{
struct htt_host_tx_desc_t *htt_host_tx_desc;
struct htt_htc_pkt *pkt;
@@ -467,8 +468,7 @@ htt_tx_send_base(
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msdu);
adf_nbuf_trace_update(msdu, "HT:T:");
-
- HTCSendDataPkt(pdev->htc_pdev, &pkt->htc_pkt);
+ HTCSendDataPkt(pdev->htc_pdev, &pkt->htc_pkt, more_data);
return 0; /* success */
}
@@ -482,7 +482,6 @@ htt_tx_send_batch(
u_int16_t *msdu_id_storage;
u_int16_t msdu_id;
adf_nbuf_t msdu;
-
/*
* FOR NOW, iterate through the batch, sending the frames singly.
* Eventually HTC and HIF should be able to accept a batch of
@@ -494,8 +493,10 @@ htt_tx_send_batch(
adf_nbuf_t next_msdu = adf_nbuf_next(msdu);
msdu_id_storage = ol_tx_msdu_id_storage(msdu);
msdu_id = *msdu_id_storage;
+
/* htt_tx_send_base returns 0 as success and 1 as failure */
- if (htt_tx_send_base(pdev, msdu, msdu_id, pdev->download_len)) {
+ if (htt_tx_send_base(pdev, msdu, msdu_id, pdev->download_len,
+ num_msdus)) {
adf_nbuf_set_next(msdu, rejected);
rejected = msdu;
}
@@ -525,7 +526,7 @@ htt_tx_send_nonstd(
HTT_TX_HDR_SIZE_802_1Q +
HTT_TX_HDR_SIZE_LLC_SNAP +
ol_cfg_tx_download_size(pdev->ctrl_pdev);
- return htt_tx_send_base(pdev, msdu, msdu_id, download_len);
+ return htt_tx_send_base(pdev, msdu, msdu_id, download_len, 0);
}
int
@@ -534,7 +535,7 @@ htt_tx_send_std(
adf_nbuf_t msdu,
u_int16_t msdu_id)
{
- return htt_tx_send_base(pdev, msdu, msdu_id, pdev->download_len);
+ return htt_tx_send_base(pdev, msdu, msdu_id, pdev->download_len, 0);
}
#endif /*ATH_11AC_TXCOMPACT*/
diff --git a/CORE/SERVICES/COMMON/htc_api.h b/CORE/SERVICES/COMMON/htc_api.h
index 9559ae71e440..05a358e53b03 100644
--- a/CORE/SERVICES/COMMON/htc_api.h
+++ b/CORE/SERVICES/COMMON/htc_api.h
@@ -434,7 +434,8 @@ A_STATUS HTCSendPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
A_STATUS HTCSendDataPkt(HTC_HANDLE HTCHandle, adf_nbuf_t netbuf,
int Epid, int ActualLength);
#else /*ATH_11AC_TXCOMPACT*/
-A_STATUS HTCSendDataPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
+A_STATUS HTCSendDataPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
+ A_UINT8 more_data);
#endif /*ATH_11AC_TXCOMPACT*/
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Flush HTC when target is removed surprisely service communications
diff --git a/CORE/SERVICES/HTC/htc_internal.h b/CORE/SERVICES/HTC/htc_internal.h
index 5325497c729e..3b50e9a76724 100644
--- a/CORE/SERVICES/HTC/htc_internal.h
+++ b/CORE/SERVICES/HTC/htc_internal.h
@@ -74,6 +74,15 @@ extern "C" {
#else
#define HTC_MAX_MSG_PER_BUNDLE 16
#endif
+/*
+ * HTC_MAX_TX_BUNDLE_SEND_LIMIT -
+ * This value is in units of tx frame fragments.
+ * It needs to be at least as large as the maximum number of tx frames in a
+ * HTC download bundle times the average number of fragments in each such frame
+ * (In certain operating systems, such as Linux, we expect to only have
+ * a single fragment per frame anyway.)
+ */
+#define HTC_MAX_TX_BUNDLE_SEND_LIMIT 255
#define HTC_PACKET_CONTAINER_ALLOCATION 32
#define NUM_CONTROL_TX_BUFFERS 2
diff --git a/CORE/SERVICES/HTC/htc_send.c b/CORE/SERVICES/HTC/htc_send.c
index 5704b1d4adcd..aa22965383f7 100644
--- a/CORE/SERVICES/HTC/htc_send.c
+++ b/CORE/SERVICES/HTC/htc_send.c
@@ -1158,8 +1158,8 @@ A_STATUS HTCSendDataPkt(HTC_HANDLE HTCHandle, adf_nbuf_t netbuf, int Epid,
}
#else /*ATH_11AC_TXCOMPACT*/
-
-A_STATUS HTCSendDataPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket)
+A_STATUS HTCSendDataPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
+ A_UINT8 more_data)
{
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
HTC_ENDPOINT *pEndpoint;
@@ -1210,6 +1210,12 @@ A_STATUS HTCSendDataPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket)
/* append new packet to pEndpoint->TxQueue */
HTC_PACKET_ENQUEUE(&pEndpoint->TxQueue, pPacket);
+#ifdef ENABLE_BUNDLE_TX
+ if (HTC_ENABLE_BUNDLE(target) && (more_data)) {
+ UNLOCK_HTC_TX(target);
+ return A_OK;
+ }
+#endif
} else {
LOCK_HTC_TX(target);
pEndpoint = &target->EndPoint[1];
@@ -1245,7 +1251,16 @@ A_STATUS HTCSendDataPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket)
}
#endif
UNLOCK_HTC_TX(target);
- } else {
+ }
+#ifdef ENABLE_BUNDLE_TX
+ else if (HTC_ENABLE_BUNDLE(target)) {
+ /* Dequeue max packets from endpoint tx queue */
+ GetHTCSendPackets(target, pEndpoint, &sendQueue,
+ HTC_MAX_TX_BUNDLE_SEND_LIMIT);
+ UNLOCK_HTC_TX(target);
+ }
+#endif
+ else {
/*
* Now drain the endpoint TX queue for transmission as long as we have
* enough transmit resources
@@ -1258,8 +1273,8 @@ A_STATUS HTCSendDataPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket)
while (TRUE) {
#if defined(HIF_USB) || defined(HIF_SDIO)
#ifdef ENABLE_BUNDLE_TX
- if(IS_TX_CREDIT_FLOW_ENABLED(pEndpoint) &&
- HTC_PACKET_QUEUE_DEPTH(&sendQueue) >= HTC_MIN_MSG_PER_BUNDLE){
+ if (HTC_ENABLE_BUNDLE(target) &&
+ HTC_PACKET_QUEUE_DEPTH(&sendQueue) >= HTC_MIN_MSG_PER_BUNDLE) {
HTCIssuePacketsBundle(target, pEndpoint, &sendQueue);
}
#endif
@@ -1661,7 +1676,7 @@ void HTCProcessCreditRpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, int NumEnt
HTCTrySend(target,pEndpoint,NULL);
#else
if (pEndpoint->ServiceID == HTT_DATA_MSG_SVC){
- HTCSendDataPkt(target, NULL);
+ HTCSendDataPkt(target, NULL, 0);
} else {
HTCTrySend(target,pEndpoint,NULL);
}