iwlwifi: pcie: allocate shorter TX queues for 22000 devices
authorSara Sharon <sara.sharon@intel.com>
Thu, 4 Jan 2018 11:53:55 +0000 (13:53 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 20 Apr 2018 07:57:16 +0000 (10:57 +0300)
When support for shorter TX queues was introduced, it
didn't include the actual allocation of shorter queue,
which is the main motive for the change.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
drivers/net/wireless/intel/iwlwifi/pcie/tx.c

index b605b364ed3f86653af4cc0f16271ea5ce7f8ed8..734a5fc3584ded0ea730d3655f8e468a51715ede 100644 (file)
@@ -993,7 +993,7 @@ static void iwl_pcie_gen2_txq_free_memory(struct iwl_trans *trans,
        /* De-alloc circular buffer of TFDs */
        if (txq->tfds) {
                dma_free_coherent(dev,
-                                 trans_pcie->tfd_size * TFD_QUEUE_SIZE_MAX,
+                                 trans_pcie->tfd_size * txq->n_window,
                                  txq->tfds, txq->dma_addr);
                dma_free_coherent(dev,
                                  sizeof(*txq->first_tb_bufs) * txq->n_window,
index 86873b99e5d793282ff8a131951ba3fb2bf37faa..4493520aae1e2262d9075e25e60149fe63f6a3a5 100644 (file)
@@ -495,6 +495,9 @@ int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq,
        if (WARN_ON(txq->entries || txq->tfds))
                return -EINVAL;
 
+       if (trans->cfg->use_tfh)
+               tfd_sz = trans_pcie->tfd_size * slots_num;
+
        timer_setup(&txq->stuck_timer, iwl_pcie_txq_stuck_timer, 0);
        txq->trans_pcie = trans_pcie;