diff options
| author | Debashis Dutt <ddutt@qca.qualcomm.com> | 2014-03-17 01:26:13 -0700 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-03-21 08:53:02 -0700 |
| commit | b7087266e71f007285bc089333e6fa6ad20cdbf3 (patch) | |
| tree | f40f2c31b2d4215fbdea92026a50454a03019227 | |
| parent | 94bbfab76308abdf77f81bc6332e0073b750a316 (diff) | |
qcacld: TxRx: Reduce CPU cycles for ol_tx_desc_ll() in Tx path.
HTT/HTC Tx descriptor resides in un-cached memory.
Current implementation of htt_tx_desc_init() causes memory
to be accessed for every bit being set in the 0th & 1st
words of the HTT/HTC descriptor. The current fix uses local
variables (& hence cached writes) to initialize the bits of
word0 & word1, before finally commiting this to memory.
Use of cached writes reduces the overall CPU utilization of the
calling function ol_tx_desc_ll() (as shown by "perf") by 2 to
5%. This fix is required to reduce the overall latency in the Tx path.
Change-Id: Icfaa8f83b93eb890ef688302d2f6269daad72f1a
| -rw-r--r-- | CORE/SERVICES/COMMON/ol_htt_tx_api.h | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/CORE/SERVICES/COMMON/ol_htt_tx_api.h b/CORE/SERVICES/COMMON/ol_htt_tx_api.h index 916a010db672..03d816831094 100644 --- a/CORE/SERVICES/COMMON/ol_htt_tx_api.h +++ b/CORE/SERVICES/COMMON/ol_htt_tx_api.h @@ -385,10 +385,10 @@ htt_tx_desc_init( struct htt_msdu_info_t *msdu_info) { u_int32_t *word0, *word1, *word3; + u_int32_t local_word0, local_word1; struct htt_host_tx_desc_t *htt_host_tx_desc = (struct htt_host_tx_desc_t *) (((char *) htt_tx_desc) - HTT_TX_DESC_VADDR_OFFSET); - word0 = (u_int32_t *) htt_tx_desc; word1 = word0 + 1; /* @@ -397,18 +397,25 @@ htt_tx_desc_init( */ word3 = word0 + 3; // Dword 3 - *word0 = 0; + /* + * HTT Tx Desc is in uncached memory. Used cached writes per word, to + * reduce unnecessary memory access. + */ + + local_word0 = 0; + HTT_H2T_MSG_TYPE_SET(local_word0, HTT_H2T_MSG_TYPE_TX_FRM); + HTT_TX_DESC_PKT_TYPE_SET(local_word0, msdu_info->info.l2_hdr_type); + HTT_TX_DESC_VDEV_ID_SET(local_word0, msdu_info->info.vdev_id); + HTT_TX_DESC_EXT_TID_SET(local_word0, msdu_info->info.ext_tid); + HTT_TX_DESC_CKSUM_OFFLOAD_SET(local_word0, msdu_info->action.cksum_offload); + HTT_TX_DESC_NO_ENCRYPT_SET(local_word0, msdu_info->action.do_encrypt ? 0 : 1); + *word0 = local_word0; - HTT_H2T_MSG_TYPE_SET(*word0, HTT_H2T_MSG_TYPE_TX_FRM); - HTT_TX_DESC_PKT_TYPE_SET(*word0, msdu_info->info.l2_hdr_type); - HTT_TX_DESC_VDEV_ID_SET(*word0, msdu_info->info.vdev_id); - HTT_TX_DESC_EXT_TID_SET(*word0, msdu_info->info.ext_tid); - HTT_TX_DESC_CKSUM_OFFLOAD_SET(*word0, msdu_info->action.cksum_offload); - HTT_TX_DESC_NO_ENCRYPT_SET(*word0, msdu_info->action.do_encrypt ? 0 : 1); + local_word1 = 0; + HTT_TX_DESC_FRM_LEN_SET(local_word1, adf_nbuf_len(msdu)); + HTT_TX_DESC_FRM_ID_SET(local_word1, msdu_id); + *word1 = local_word1; - *word1 = 0; - HTT_TX_DESC_FRM_LEN_SET(*word1, adf_nbuf_len(msdu)); - HTT_TX_DESC_FRM_ID_SET(*word1, msdu_id); /* Initialize peer_id to INVALID_PEER bcoz this is NOT Reinjection path*/ *word3 = HTT_INVALID_PEER; |
