Commit d81686d3 authored by Wen Gong's avatar Wen Gong Committed by Kalle Valo
Browse files

ath10k: disable TX complete indication of htt for sdio



For sdio chip, it is high latency bus, all the TX packet's content will
be tranferred from HOST memory to firmware memory via sdio bus, then it
need much more memory in firmware than low latency bus chip, for low
latency chip, such as PCI-E, it only need to transfer the TX descriptor
via PCI-E bus to firmware memory. For sdio chip, reduce the complexity of
TX logic will help TX efficiency since its memory is limited, and it will
reduce the TX circle's time of each packet and then firmware will have more
memory for TX since TX complete also need memeory.

This patch disable TX complete indication from firmware for htt data
packet, it will not have TX complete indication from firmware to ath10k.
It will cut the cost of bus bandwidth of TX complete and make the TX
logic of firmware simpler, it results in significant performance
improvement on TX path.

Udp TX throughout is 130Mbps without this patch, and it arrives
400Mbps with this patch.

The downside of this patch is the command "iw wlan0 station dump" will
show 0 for "tx retries" and "tx failed" since all tx packet's status
is success.

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-QCARMSWPZ-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/20200212080415.31265-2-wgong@codeaurora.org
parent 2bbcaaee
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -723,10 +723,7 @@ static int ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode)
	if (ret)
		return ret;

	/* Data transfer is not initiated, when reduced Tx completion
	 * is used for SDIO. disable it until fixed
	 */
	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
	 * not big enough for mac80211 / native wifi frames. disable it
+9 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ struct ath10k_hif_ops {

	int (*swap_mailbox)(struct ath10k *ar);

	int (*get_htt_tx_complete)(struct ath10k *ar);

	int (*map_service_to_pipe)(struct ath10k *ar, u16 service_id,
				   u8 *ul_pipe, u8 *dl_pipe);

@@ -144,6 +146,13 @@ static inline int ath10k_hif_swap_mailbox(struct ath10k *ar)
	return 0;
}

static inline int ath10k_hif_get_htt_tx_complete(struct ath10k *ar)
{
	if (ar->hif.ops->get_htt_tx_complete)
		return ar->hif.ops->get_htt_tx_complete(ar);
	return 0;
}

static inline int ath10k_hif_map_service_to_pipe(struct ath10k *ar,
						 u16 service_id,
						 u8 *ul_pipe, u8 *dl_pipe)
+10 −0
Original line number Diff line number Diff line
@@ -660,6 +660,16 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc)
	return 0;
}

void ath10k_htc_change_tx_credit_flow(struct ath10k_htc *htc,
				      enum ath10k_htc_ep_id eid,
				      bool enable)
{
	struct ath10k *ar = htc->ar;
	struct ath10k_htc_ep *ep = &ar->htc.endpoint[eid];

	ep->tx_credit_flow_enabled = enable;
}

int ath10k_htc_connect_service(struct ath10k_htc *htc,
			       struct ath10k_htc_svc_conn_req *conn_req,
			       struct ath10k_htc_svc_conn_resp *conn_resp)
+3 −0
Original line number Diff line number Diff line
@@ -386,6 +386,9 @@ int ath10k_htc_start(struct ath10k_htc *htc);
int ath10k_htc_connect_service(struct ath10k_htc *htc,
			       struct ath10k_htc_svc_conn_req  *conn_req,
			       struct ath10k_htc_svc_conn_resp *conn_resp);
void ath10k_htc_change_tx_credit_flow(struct ath10k_htc *htc,
				      enum ath10k_htc_ep_id eid,
				      bool enable);
int ath10k_htc_send(struct ath10k_htc *htc, enum ath10k_htc_ep_id eid,
		    struct sk_buff *packet);
struct sk_buff *ath10k_htc_alloc_skb(struct ath10k *ar, int size);
+5 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include "htt.h"
#include "core.h"
#include "debug.h"
#include "hif.h"

static const enum htt_t2h_msg_type htt_main_t2h_msg_types[] = {
	[HTT_MAIN_T2H_MSG_TYPE_VERSION_CONF] = HTT_T2H_MSG_TYPE_VERSION_CONF,
@@ -153,6 +154,10 @@ int ath10k_htt_connect(struct ath10k_htt *htt)

	htt->eid = conn_resp.eid;

	htt->disable_tx_comp = ath10k_hif_get_htt_tx_complete(htt->ar);
	if (htt->disable_tx_comp)
		ath10k_htc_change_tx_credit_flow(&htt->ar->htc, htt->eid, true);

	return 0;
}

Loading