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

Commit 81a3de1c authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by John W. Linville
Browse files

iwlwifi: add debug information on queue stop / wake



Users complain that the traffic gets stalled sometimes. This will
allow easier debugging.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0dcf50ca
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -800,7 +800,8 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
					       ctx->active.bssid_addr))
				continue;
			ctx->last_tx_rejected = false;
			iwl_trans_wake_any_queue(trans(priv), ctx->ctxid);
			iwl_trans_wake_any_queue(trans(priv), ctx->ctxid,
				"channel got active");
		}
	}

+2 −1
Original line number Diff line number Diff line
@@ -844,7 +844,8 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
			if (ctx->last_tx_rejected) {
				ctx->last_tx_rejected = false;
				iwl_trans_wake_any_queue(trans(priv),
							 ctx->ctxid);
							 ctx->ctxid,
							 "Disassoc: flush queue");
			}
			ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;

+2 −1
Original line number Diff line number Diff line
@@ -813,7 +813,8 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb,
			    iwl_is_associated_ctx(ctx) && ctx->vif &&
			    ctx->vif->type == NL80211_IFTYPE_STATION) {
				ctx->last_tx_rejected = true;
				iwl_trans_stop_queue(trans(priv), txq_id);
				iwl_trans_stop_queue(trans(priv), txq_id,
					"Tx on passive channel");

				IWL_DEBUG_TX_REPLY(priv,
					   "TXQ %d status %s (0x%08x) "
+2 −2
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static inline void iwl_dbgfs_unregister(struct iwl_priv *priv)
#define IWL_DL_11H		(1 << 28)
#define IWL_DL_STATS		(1 << 29)
#define IWL_DL_TX_REPLY		(1 << 30)
#define IWL_DL_UNUSED		(1 << 31)
#define IWL_DL_TX_QUEUES	(1 << 31)

#define IWL_DEBUG_INFO(p, f, a...)	IWL_DEBUG(p, IWL_DL_INFO, f, ## a)
#define IWL_DEBUG_MAC80211(p, f, a...)	IWL_DEBUG(p, IWL_DL_MAC80211, f, ## a)
@@ -203,7 +203,7 @@ static inline void iwl_dbgfs_unregister(struct iwl_priv *priv)
#define IWL_DEBUG_TX_REPLY(p, f, a...)	IWL_DEBUG(p, IWL_DL_TX_REPLY, f, ## a)
#define IWL_DEBUG_TX_REPLY_LIMIT(p, f, a...) \
		IWL_DEBUG_LIMIT(p, IWL_DL_TX_REPLY, f, ## a)
#define IWL_DEBUG_UNUSED(p, f, a...)	IWL_DEBUG(p, IWL_DL_UNUSED, f, ## a)
#define IWL_DEBUG_TX_QUEUES(p, f, a...)	IWL_DEBUG(p, IWL_DL_TX_QUEUES, f, ## a)
#define IWL_DEBUG_RADIO(p, f, a...)	IWL_DEBUG(p, IWL_DL_RADIO, f, ## a)
#define IWL_DEBUG_POWER(p, f, a...)	IWL_DEBUG(p, IWL_DL_POWER, f, ## a)
#define IWL_DEBUG_11H(p, f, a...)	IWL_DEBUG(p, IWL_DL_11H, f, ## a)
+29 −6
Original line number Diff line number Diff line
@@ -355,7 +355,7 @@ static inline void iwl_set_swq_id(struct iwl_tx_queue *txq, u8 ac, u8 hwq)
}

static inline void iwl_wake_queue(struct iwl_trans *trans,
				  struct iwl_tx_queue *txq)
				  struct iwl_tx_queue *txq, const char *msg)
{
	u8 queue = txq->swq_id;
	u8 ac = queue & 3;
@@ -363,13 +363,22 @@ static inline void iwl_wake_queue(struct iwl_trans *trans,
	struct iwl_trans_pcie *trans_pcie =
		IWL_TRANS_GET_PCIE_TRANS(trans);

	if (test_and_clear_bit(hwq, trans_pcie->queue_stopped))
		if (atomic_dec_return(&trans_pcie->queue_stop_count[ac]) <= 0)
	if (test_and_clear_bit(hwq, trans_pcie->queue_stopped)) {
		if (atomic_dec_return(&trans_pcie->queue_stop_count[ac]) <= 0) {
			iwl_wake_sw_queue(priv(trans), ac);
			IWL_DEBUG_TX_QUEUES(trans, "Wake hwq %d ac %d. %s",
					    hwq, ac, msg);
		} else {
			IWL_DEBUG_TX_QUEUES(trans, "Don't wake hwq %d ac %d"
					    " stop count %d. %s",
					    hwq, ac, atomic_read(&trans_pcie->
					    queue_stop_count[ac]), msg);
		}
	}
}

static inline void iwl_stop_queue(struct iwl_trans *trans,
				  struct iwl_tx_queue *txq)
				  struct iwl_tx_queue *txq, const char *msg)
{
	u8 queue = txq->swq_id;
	u8 ac = queue & 3;
@@ -377,9 +386,23 @@ static inline void iwl_stop_queue(struct iwl_trans *trans,
	struct iwl_trans_pcie *trans_pcie =
		IWL_TRANS_GET_PCIE_TRANS(trans);

	if (!test_and_set_bit(hwq, trans_pcie->queue_stopped))
		if (atomic_inc_return(&trans_pcie->queue_stop_count[ac]) > 0)
	if (!test_and_set_bit(hwq, trans_pcie->queue_stopped)) {
		if (atomic_inc_return(&trans_pcie->queue_stop_count[ac]) > 0) {
			iwl_stop_sw_queue(priv(trans), ac);
			IWL_DEBUG_TX_QUEUES(trans, "Stop hwq %d ac %d"
					    " stop count %d. %s",
					    hwq, ac, atomic_read(&trans_pcie->
					    queue_stop_count[ac]), msg);
		} else {
			IWL_DEBUG_TX_QUEUES(trans, "Don't stop hwq %d ac %d"
					    " stop count %d. %s",
					    hwq, ac, atomic_read(&trans_pcie->
					    queue_stop_count[ac]), msg);
		}
	} else {
		IWL_DEBUG_TX_QUEUES(trans, "stop hwq %d, but it is stopped/ %s",
				    hwq, msg);
	}
}

#ifdef ieee80211_stop_queue
Loading