All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Liad Kaufman <liad.kaufman@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 21/31] iwlwifi: mvm: support multi tid ba notif
Date: Wed, 28 Jun 2017 23:13:20 +0300	[thread overview]
Message-ID: <20170628201330.9432-22-luca@coelho.fi> (raw)
In-Reply-To: <20170628201330.9432-1-luca@coelho.fi>

From: Liad Kaufman <liad.kaufman@intel.com>

When receiving a BA_NOTIF on new TX API, it can
contain BAs for several TIDs. Go over them and
reclaim TX for every TID.

Note that although the small API change, the API
version still isn't bumped forward, as this NIC
isn't still officially released.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h |  4 +++-
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c        | 28 ++++++++++------------
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
index 9d2a991221cf..97d7eed32622 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h
@@ -668,13 +668,15 @@ struct iwl_mvm_ba_notif {
  * @q_num: TFD queue number
  * @tfd_index: Index of first un-acked frame in the  TFD queue
  * @scd_queue: For debug only - the physical queue the TFD queue is bound to
+ * @tid: TID of the queue (0-7)
  * @reserved: reserved for alignment
  */
 struct iwl_mvm_compressed_ba_tfd {
 	__le16 q_num;
 	__le16 tfd_index;
 	u8 scd_queue;
-	u8 reserved[3];
+	u8 tid;
+	u8 reserved[2];
 } __packed; /* COMPRESSED_BA_TFD_API_S_VER_1 */
 
 /**
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index c89bb453c496..627befb0d8d1 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -1813,6 +1813,7 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 	if (iwl_mvm_has_new_tx_api(mvm)) {
 		struct iwl_mvm_compressed_ba_notif *ba_res =
 			(void *)pkt->data;
+		int i;
 
 		sta_id = ba_res->sta_id;
 		ba_info.status.ampdu_ack_len = (u8)le16_to_cpu(ba_res->done);
@@ -1825,22 +1826,17 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 		if (!le16_to_cpu(ba_res->tfd_cnt))
 			goto out;
 
-		/*
-		 * TODO:
-		 * When supporting multi TID aggregations - we need to move
-		 * next_reclaimed to be per TXQ and not per TID or handle it
-		 * in a different way.
-		 * This will go together with SN and AddBA offload and cannot
-		 * be handled properly for now.
-		 */
-		WARN_ON(le16_to_cpu(ba_res->ra_tid_cnt) != 1);
-		tid = ba_res->ra_tid[0].tid;
-		if (tid == IWL_MGMT_TID)
-			tid = IWL_MAX_TID_COUNT;
-		iwl_mvm_tx_reclaim(mvm, sta_id, tid,
-				   (int)(le16_to_cpu(ba_res->tfd[0].q_num)),
-				   le16_to_cpu(ba_res->tfd[0].tfd_index),
-				   &ba_info, le32_to_cpu(ba_res->tx_rate));
+		/* Free per TID */
+		for (i = 0; i < le16_to_cpu(ba_res->tfd_cnt); i++) {
+			struct iwl_mvm_compressed_ba_tfd *ba_tfd =
+				&ba_res->tfd[i];
+
+			iwl_mvm_tx_reclaim(mvm, sta_id, ba_tfd->tid,
+					   (int)(le16_to_cpu(ba_tfd->q_num)),
+					   le16_to_cpu(ba_tfd->tfd_index),
+					   &ba_info,
+					   le32_to_cpu(ba_res->tx_rate));
+		}
 
 out:
 		IWL_DEBUG_TX_REPLY(mvm,
-- 
2.11.0

  parent reply	other threads:[~2017-06-28 20:15 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28 20:12 [PATCH 00/31] iwlwifi: updates intended for v4.13 2017-06-28 Luca Coelho
2017-06-28 20:13 ` [PATCH 01/31] iwlwifi: mvm: refactor geo init Luca Coelho
2017-06-28 20:13 ` [PATCH 02/31] iwlwifi: mvm: Add debugfs entry to retrieve SAR geographic profile Luca Coelho
2017-06-28 20:13 ` [PATCH 03/31] iwlwifi: mvm: remove some CamelCase from firmware API Luca Coelho
2017-06-28 20:13 ` [PATCH 04/31] iwlwifi: mvm: fix various "Excess ... description" kernel-doc warnings Luca Coelho
2017-06-28 20:13 ` [PATCH 05/31] iwlwifi: mvm: remove various unused command IDs/structs Luca Coelho
2017-06-28 20:13 ` [PATCH 06/31] iwlwifi: mvm: use __le16 even for reserved fields Luca Coelho
2017-06-28 20:13 ` [PATCH 07/31] iwlwifi: mvm: add documentation for all command IDs Luca Coelho
2017-06-28 20:13 ` [PATCH 08/31] iwlwifi: mvm: fix a bunch of kernel-doc warnings Luca Coelho
2017-06-28 20:13 ` [PATCH 09/31] iwlwifi: dvm: use macros for format strings Luca Coelho
2017-06-28 20:13 ` [PATCH 10/31] iwlwifi: pcie: only apply retention workaround on 9000-series A-step Luca Coelho
2017-06-28 20:13 ` [PATCH 11/31] iwlwifi: pcie: fix 9000-series RF-kill interrupt propagation Luca Coelho
2017-06-28 20:13 ` [PATCH 12/31] iwlwifi: mvm: change sta_id to u8 Luca Coelho
2017-06-28 20:13 ` [PATCH 13/31] iwlwifi: mvm: simplify CHECK_MLME_TRIGGER macro Luca Coelho
2017-06-28 20:13 ` [PATCH 14/31] iwlwifi: add the new a000_2ax series Luca Coelho
2017-06-28 20:13 ` [PATCH 15/31] iwlwifi: add twelve new 9560 series PCI IDs Luca Coelho
2017-06-28 20:13 ` [PATCH 16/31] iwlwifi: mvm: use proper CDB check in PHY context modify Luca Coelho
2017-06-28 20:13 ` [PATCH 17/31] iwlwifi: pcie: improve "invalid queue" warning Luca Coelho
2017-06-28 20:13 ` [PATCH 18/31] iwlwifi: mvm: support aggs of 64 frames in A000 family Luca Coelho
2017-06-28 20:13 ` [PATCH 19/31] iwlwifi: pcie: improve debug in iwl_pcie_rx_handle_rb() Luca Coelho
2017-06-28 20:43   ` Joe Perches
2017-06-29 18:59     ` Luca Coelho
2017-06-28 20:13 ` [PATCH 20/31] iwlwifi: mvm: change when the BT_COEX is sent Luca Coelho
2017-06-28 20:13 ` Luca Coelho [this message]
2017-06-28 20:13 ` [PATCH 22/31] iwlwifi: unify external & internal modparam names Luca Coelho
2017-06-28 20:13 ` [PATCH 23/31] iwlwifi: pcie: make ctxt-info free idempotent Luca Coelho
2017-06-28 20:13 ` [PATCH 24/31] iwlwifi: pcie: warn if paging is already initialized during init Luca Coelho
2017-06-28 20:13 ` [PATCH 25/31] iwlwifi: mvm: unconditionally stop device after init Luca Coelho
2017-06-28 20:13 ` [PATCH 26/31] iwlwifi: mvm: fix deduplication start logic Luca Coelho
2017-06-28 20:13 ` [PATCH 27/31] iwlwifi: mvm: rename iwl_shared_mem_cfg_v1 to the correct _v2 Luca Coelho
2017-06-28 20:13 ` [PATCH 28/31] iwlwifi: create new subdirectory for FW interaction Luca Coelho
2017-06-28 20:13 ` [PATCH 29/31] iwlwifi: move notification wait into fw/ Luca Coelho
2017-06-28 20:13 ` [PATCH 30/31] iwlwifi: move configuration into sub-directory Luca Coelho
2017-06-28 20:13 ` [PATCH 31/31] iwlwifi: mvm: remove version 2 of paging command Luca Coelho
2017-06-28 20:14 ` [PATCH 00/31] iwlwifi: updates intended for v4.13 2017-06-28 Coelho, Luciano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170628201330.9432-22-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=liad.kaufman@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.