Skip to content

Commit 25edc8f

Browse files
jmberg-intellucacoelho
authored andcommitted
iwlwifi: pcie: properly implement NAPI
Instead of pretending to have NAPI and then relying entirely on interrupts anyway, properly implement NAPI and schedule the poll when we get an interrupt, re-enabling the interrupt only after the poll completed. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210117130510.a5951ac4fc06.I9c84a147288fcfb1b019572c6758f2d92949f5d7@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
1 parent d4e3a34 commit 25edc8f

File tree

5 files changed

+171
-83
lines changed

5 files changed

+171
-83
lines changed

drivers/net/wireless/intel/iwlwifi/pcie/internal.h

+6-8
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,7 @@ IWL_TRANS_GET_PCIE_TRANS(struct iwl_trans *trans)
418418
return (void *)trans->trans_specific;
419419
}
420420

421-
static inline void iwl_pcie_clear_irq(struct iwl_trans *trans,
422-
struct msix_entry *entry)
421+
static inline void iwl_pcie_clear_irq(struct iwl_trans *trans, int queue)
423422
{
424423
/*
425424
* Before sending the interrupt the HW disables it to prevent
@@ -429,7 +428,7 @@ static inline void iwl_pcie_clear_irq(struct iwl_trans *trans,
429428
* write 1 clear (W1C) register, meaning that it's being clear
430429
* by writing 1 to the bit.
431430
*/
432-
iwl_write32(trans, CSR_MSIX_AUTOMASK_ST_AD, BIT(entry->entry));
431+
iwl_write32(trans, CSR_MSIX_AUTOMASK_ST_AD, BIT(queue));
433432
}
434433

435434
static inline struct iwl_trans *
@@ -462,7 +461,6 @@ int iwl_pcie_rx_stop(struct iwl_trans *trans);
462461
void iwl_pcie_rx_free(struct iwl_trans *trans);
463462
void iwl_pcie_free_rbs_pool(struct iwl_trans *trans);
464463
void iwl_pcie_rx_init_rxb_lists(struct iwl_rxq *rxq);
465-
int iwl_pcie_dummy_napi_poll(struct napi_struct *napi, int budget);
466464
void iwl_pcie_rxq_alloc_rbs(struct iwl_trans *trans, gfp_t priority,
467465
struct iwl_rxq *rxq);
468466

@@ -569,9 +567,9 @@ static inline void iwl_disable_interrupts(struct iwl_trans *trans)
569567
{
570568
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
571569

572-
spin_lock(&trans_pcie->irq_lock);
570+
spin_lock_bh(&trans_pcie->irq_lock);
573571
_iwl_disable_interrupts(trans);
574-
spin_unlock(&trans_pcie->irq_lock);
572+
spin_unlock_bh(&trans_pcie->irq_lock);
575573
}
576574

577575
static inline void _iwl_enable_interrupts(struct iwl_trans *trans)
@@ -601,9 +599,9 @@ static inline void iwl_enable_interrupts(struct iwl_trans *trans)
601599
{
602600
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
603601

604-
spin_lock(&trans_pcie->irq_lock);
602+
spin_lock_bh(&trans_pcie->irq_lock);
605603
_iwl_enable_interrupts(trans);
606-
spin_unlock(&trans_pcie->irq_lock);
604+
spin_unlock_bh(&trans_pcie->irq_lock);
607605
}
608606
static inline void iwl_enable_hw_int_msk_msix(struct iwl_trans *trans, u32 msk)
609607
{

0 commit comments

Comments
 (0)