Skip to content

Commit

Permalink
iwlwifi: pcie: add TPT oriented prints
Browse files Browse the repository at this point in the history
Currently there is no way to debug RX/TX paths using prints
without harming tpt. Add prints to debug RX allocation path.
We can still get 1.9 gbps with those on.

Signed-off-by: Sara Sharon <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
  • Loading branch information
sara-s authored and lucacoelho committed Feb 14, 2019
1 parent ec4156a commit 6dcdd16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/intel/iwlwifi/iwl-debug.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/******************************************************************************
*
* Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
* Copyright (C) 2018 Intel Corporation
*
* Portions of this file are derived from the ipw3945 project.
*
Expand Down Expand Up @@ -159,7 +160,7 @@ do { \
/* 0x000F0000 - 0x00010000 */
#define IWL_DL_FW 0x00010000
#define IWL_DL_RF_KILL 0x00020000
#define IWL_DL_FW_ERRORS 0x00040000
#define IWL_DL_TPT 0x00040000
/* 0x00F00000 - 0x00100000 */
#define IWL_DL_RATE 0x00100000
#define IWL_DL_CALIB 0x00200000
Expand Down Expand Up @@ -193,7 +194,6 @@ do { \
#define IWL_DEBUG_CALIB(p, f, a...) IWL_DEBUG(p, IWL_DL_CALIB, f, ## a)
#define IWL_DEBUG_FW(p, f, a...) IWL_DEBUG(p, IWL_DL_FW, f, ## a)
#define IWL_DEBUG_RF_KILL(p, f, a...) IWL_DEBUG(p, IWL_DL_RF_KILL, f, ## a)
#define IWL_DEBUG_FW_ERRORS(p, f, a...) IWL_DEBUG(p, IWL_DL_FW_ERRORS, f, ## a)
#define IWL_DEBUG_DROP(p, f, a...) IWL_DEBUG(p, IWL_DL_DROP, f, ## a)
#define IWL_DEBUG_DROP_LIMIT(p, f, a...) \
IWL_DEBUG_LIMIT(p, IWL_DL_DROP, f, ## a)
Expand All @@ -215,6 +215,7 @@ do { \
#define IWL_DEBUG_DEV_RADIO(p, f, a...) IWL_DEBUG_DEV(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)
#define IWL_DEBUG_TPT(p, f, a...) IWL_DEBUG(p, IWL_DL_TPT, f, ## a)
#define IWL_DEBUG_RPM(p, f, a...) IWL_DEBUG(p, IWL_DL_RPM, f, ## a)
#define IWL_DEBUG_LAR(p, f, a...) IWL_DEBUG(p, IWL_DL_LAR, f, ## a)

Expand Down
20 changes: 14 additions & 6 deletions drivers/net/wireless/intel/iwlwifi/pcie/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ static void iwl_pcie_rx_allocator(struct iwl_trans *trans)
struct list_head local_empty;
int pending = atomic_read(&rba->req_pending);

IWL_DEBUG_RX(trans, "Pending allocation requests = %d\n", pending);
IWL_DEBUG_TPT(trans, "Pending allocation requests = %d\n", pending);

/* If we were scheduled - there is at least one request */
spin_lock(&rba->lock);
Expand Down Expand Up @@ -598,9 +598,10 @@ static void iwl_pcie_rx_allocator(struct iwl_trans *trans)

if (!pending) {
pending = atomic_read(&rba->req_pending);
IWL_DEBUG_RX(trans,
"Got more pending allocation requests = %d\n",
pending);
if (pending)
IWL_DEBUG_TPT(trans,
"Got more pending allocation requests = %d\n",
pending);
}

spin_lock(&rba->lock);
Expand All @@ -619,7 +620,7 @@ static void iwl_pcie_rx_allocator(struct iwl_trans *trans)
list_splice_tail(&local_empty, &rba->rbd_empty);
spin_unlock(&rba->lock);

IWL_DEBUG_RX(trans, "%s, exit.\n", __func__);
IWL_DEBUG_TPT(trans, "%s, exit.\n", __func__);
}

/*
Expand Down Expand Up @@ -1429,6 +1430,9 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans, int queue)
!emergency)) {
iwl_pcie_rx_move_to_allocator(rxq, rba);
emergency = true;
IWL_DEBUG_TPT(trans,
"RX path is in emergency. Pending allocations %d\n",
rb_pending_alloc);
}

IWL_DEBUG_RX(trans, "Q %d: HW = %d, SW = %d\n", rxq->id, r, i);
Expand Down Expand Up @@ -1458,8 +1462,12 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans, int queue)
count++;
if (count == 8) {
count = 0;
if (rb_pending_alloc < rxq->queue_size / 3)
if (rb_pending_alloc < rxq->queue_size / 3) {
IWL_DEBUG_TPT(trans,
"RX path exited emergency. Pending allocations %d\n",
rb_pending_alloc);
emergency = false;
}

rxq->read = i;
spin_unlock(&rxq->lock);
Expand Down

0 comments on commit 6dcdd16

Please sign in to comment.