Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a16942e6 authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo
Browse files

ath10k: bypass htc for htt tx path



Going through full htc tx path for htt tx is a
waste of resources. By skipping it it's possible
to easily submit scatter-gather to the pci hif for
reduced host cpu load and improved performance.

The new approach uses dma pool to store the
following metadata for each tx request:
 * msdu fragment list
 * htc header
 * htt tx command

The htt tx command contains a msdu prefetch.
Instead of copying it original mapped msdu address
is used to submit a second scatter-gather item to
hif to make a complete htt tx command.

The htt tx command itself hands over dma mapped
pointers to msdus and completion of the command
itself doesn't mean the frame has been sent and
can be unmapped/freed. This is why htc tx
completion is skipped for htt tx as all tx related
resources are freed upon htt tx completion
indication event (which also implicitly means htt
tx command itself was completed).

Since now each htt tx request effectively consists
of 2 copy engine items CE_HTT_H2T_MSG_SRC_NENTRIES
is updated to allow maximum of
TARGET_10X_NUM_MSDU_DESC msdus being queued. This
keeps the tx path resource management simple.

Signed-off-by: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 726346fc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1067,9 +1067,9 @@ struct ath10k_ce_pipe *ath10k_ce_init(struct ath10k *ar,
	 *
	 * For the lack of a better place do the check here.
	 */
	BUILD_BUG_ON(TARGET_NUM_MSDU_DESC >
	BUILD_BUG_ON(2*TARGET_NUM_MSDU_DESC >
		     (CE_HTT_H2T_MSG_SRC_NENTRIES - 1));
	BUILD_BUG_ON(TARGET_10X_NUM_MSDU_DESC >
	BUILD_BUG_ON(2*TARGET_10X_NUM_MSDU_DESC >
		     (CE_HTT_H2T_MSG_SRC_NENTRIES - 1));

	ret = ath10k_pci_wake(ar);
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@

/* Maximum number of Copy Engine's supported */
#define CE_COUNT_MAX 8
#define CE_HTT_H2T_MSG_SRC_NENTRIES 2048
#define CE_HTT_H2T_MSG_SRC_NENTRIES 4096

/* Descriptor rings must be aligned to this boundary */
#define CE_DESC_RING_ALIGN	8
+2 −3
Original line number Diff line number Diff line
@@ -67,9 +67,8 @@ struct ath10k_skb_cb {
	struct {
		u8 tid;
		bool is_offchan;

		u8 frag_len;
		u8 pad_len;
		struct ath10k_htt_txbuf *txbuf;
		u32 txbuf_paddr;
	} __packed htt;

	struct {
+1 −3
Original line number Diff line number Diff line
@@ -202,10 +202,8 @@ static int ath10k_htc_tx_completion_handler(struct ath10k *ar,
	struct ath10k_htc *htc = &ar->htc;
	struct ath10k_htc_ep *ep = &htc->endpoint[eid];

	if (!skb) {
		ath10k_warn("invalid sk_buff completion - NULL pointer. firmware crashed?\n");
	if (WARN_ON_ONCE(!skb))
		return 0;
	}

	ath10k_htc_notify_tx_completion(ep, skb);
	/* the skb now belongs to the completion handler */
+9 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

#include <linux/bug.h>
#include <linux/interrupt.h>
#include <linux/dmapool.h>

#include "htc.h"
#include "rx_desc.h"
@@ -1188,6 +1189,13 @@ struct htt_rx_info {
	bool mic_err;
};

struct ath10k_htt_txbuf {
	struct htt_data_tx_desc_frag frags[2];
	struct ath10k_htc_hdr htc_hdr;
	struct htt_cmd_hdr cmd_hdr;
	struct htt_data_tx_desc cmd_tx;
} __packed;

struct ath10k_htt {
	struct ath10k *ar;
	enum ath10k_htc_ep_id eid;
@@ -1269,6 +1277,7 @@ struct ath10k_htt {
	struct sk_buff **pending_tx;
	unsigned long *used_msdu_ids; /* bitmap */
	wait_queue_head_t empty_tx_wq;
	struct dma_pool *tx_pool;

	/* set if host-fw communication goes haywire
	 * used to avoid further failures */
Loading