Commit 2f918ea9 authored by Wen Gong's avatar Wen Gong Committed by Kalle Valo

ath10k: enable alt data of TX path for sdio

The default credit size is 1792 bytes, but the IP mtu is 1500 bytes,
then it has about 290 bytes's waste for each data packet on sdio
transfer path for TX bundle, it will reduce the transmission utilization
ratio for data packet.

This patch enable the small credit size in firmware, firmware will use
the new credit size 1556 bytes, it will increase the transmission
utilization ratio for data packet on TX patch. It results in significant
performance improvement on TX path.

This patch only effect sdio chip, it will not effect PCI, SNOC etc.

Tested with QCA6174 SDIO with firmware
WLAN.RMH.4.4.1-00017-QCARMSWP-1.
Signed-off-by: default avatarWen Gong <wgong@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200410061400.14231-3-wgong@codeaurora.org
parent c8334512
...@@ -725,10 +725,10 @@ static int ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode) ...@@ -725,10 +725,10 @@ static int ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode)
param |= HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET; param |= HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET;
/* Alternate credit size of 1544 as used by SDIO firmware is if (mode == ATH10K_FIRMWARE_MODE_NORMAL)
* not big enough for mac80211 / native wifi frames. disable it param |= HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE;
*/ else
param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE;
if (mode == ATH10K_FIRMWARE_MODE_UTF) if (mode == ATH10K_FIRMWARE_MODE_UTF)
param &= ~HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; param &= ~HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET;
......
...@@ -957,12 +957,16 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) ...@@ -957,12 +957,16 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc)
*/ */
if (htc->control_resp_len >= if (htc->control_resp_len >=
sizeof(msg->hdr) + sizeof(msg->ready_ext)) { sizeof(msg->hdr) + sizeof(msg->ready_ext)) {
htc->alt_data_credit_size =
__le16_to_cpu(msg->ready_ext.reserved) &
ATH10K_HTC_MSG_READY_EXT_ALT_DATA_MASK;
htc->max_msgs_per_htc_bundle = htc->max_msgs_per_htc_bundle =
min_t(u8, msg->ready_ext.max_msgs_per_htc_bundle, min_t(u8, msg->ready_ext.max_msgs_per_htc_bundle,
HTC_HOST_MAX_MSG_PER_RX_BUNDLE); HTC_HOST_MAX_MSG_PER_RX_BUNDLE);
ath10k_dbg(ar, ATH10K_DBG_HTC, ath10k_dbg(ar, ATH10K_DBG_HTC,
"Extended ready message. RX bundle size: %d\n", "Extended ready message RX bundle size %d alt size %d\n",
htc->max_msgs_per_htc_bundle); htc->max_msgs_per_htc_bundle,
htc->alt_data_credit_size);
} }
INIT_WORK(&ar->bundle_tx_work, ath10k_htc_bundle_tx_work); INIT_WORK(&ar->bundle_tx_work, ath10k_htc_bundle_tx_work);
...@@ -1114,6 +1118,10 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc, ...@@ -1114,6 +1118,10 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc,
ep->tx_credits = tx_alloc; ep->tx_credits = tx_alloc;
ep->tx_credit_size = htc->target_credit_size; ep->tx_credit_size = htc->target_credit_size;
if (conn_req->service_id == ATH10K_HTC_SVC_ID_HTT_DATA_MSG &&
htc->alt_data_credit_size != 0)
ep->tx_credit_size = htc->alt_data_credit_size;
/* copy all the callbacks */ /* copy all the callbacks */
ep->ep_ops = conn_req->ep_ops; ep->ep_ops = conn_req->ep_ops;
......
...@@ -119,6 +119,8 @@ enum ath10k_htc_conn_flags { ...@@ -119,6 +119,8 @@ enum ath10k_htc_conn_flags {
#define ATH10K_HTC_CONN_FLAGS_RECV_ALLOC_LSB 8 #define ATH10K_HTC_CONN_FLAGS_RECV_ALLOC_LSB 8
}; };
#define ATH10K_HTC_MSG_READY_EXT_ALT_DATA_MASK 0xFFF
enum ath10k_htc_conn_svc_status { enum ath10k_htc_conn_svc_status {
ATH10K_HTC_CONN_SVC_STATUS_SUCCESS = 0, ATH10K_HTC_CONN_SVC_STATUS_SUCCESS = 0,
ATH10K_HTC_CONN_SVC_STATUS_NOT_FOUND = 1, ATH10K_HTC_CONN_SVC_STATUS_NOT_FOUND = 1,
...@@ -155,8 +157,14 @@ struct ath10k_htc_ready_extended { ...@@ -155,8 +157,14 @@ struct ath10k_htc_ready_extended {
struct ath10k_htc_ready base; struct ath10k_htc_ready base;
u8 htc_version; /* @enum ath10k_htc_version */ u8 htc_version; /* @enum ath10k_htc_version */
u8 max_msgs_per_htc_bundle; u8 max_msgs_per_htc_bundle;
u8 pad0; union {
u8 pad1; __le16 reserved;
struct {
u8 pad0;
u8 pad1;
} __packed;
} __packed;
} __packed; } __packed;
struct ath10k_htc_conn_svc { struct ath10k_htc_conn_svc {
...@@ -393,6 +401,7 @@ struct ath10k_htc { ...@@ -393,6 +401,7 @@ struct ath10k_htc {
int total_transmit_credits; int total_transmit_credits;
int target_credit_size; int target_credit_size;
u8 max_msgs_per_htc_bundle; u8 max_msgs_per_htc_bundle;
int alt_data_credit_size;
}; };
int ath10k_htc_init(struct ath10k *ar); int ath10k_htc_init(struct ath10k *ar);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment