Commit Message

From: Johannes Berg <johannes.berg@intel.com>
For HE-capable devices, we need to allocate more receive buffers as
there could be 256 frames aggregated into a single A-MPDU, and then
they might contain A-MSDUs as well. Until 22000 family, the devices
are able to put multiple frames into a single RB and the default RB
size is 4k, but starting from AX210 family this is no longer true.
On the other hand, those newer devices only use 2k receive buffers
(by default).
Modify the code and configuration to allocate an appropriate number
of RBs depending on the device capabilities:
* 4096 for AX210 HE devices, which use 2k buffers by default,
* 2048 for 22000 family devices which use 4k buffers by default,
* 512 for existing 9000 family devices, which doesn't really
change anything since that's the default before this patch,
* 512 also for AX210/22000 family devices that don't do HE.
Theoretically, for devices lower than AX210, we wouldn't have to
allocate that many RBs if the RB size was manually increased, but
to support that the code got more complex, and it didn't really
seem necessary as that's a use case for monitor mode only, where
hopefully the wasted memory isn't really much of a concern.
Note that AX210 devices actually support bigger than 12-bit VID,
which is required here as we want to allocate 4096 buffers plus
some for quick recycling, so adjust the code for that as well.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../net/wireless/intel/iwlwifi/cfg/22000.c | 55 +++++++++++++++++++
drivers/net/wireless/intel/iwlwifi/cfg/9000.c | 1 +
.../net/wireless/intel/iwlwifi/iwl-config.h | 3 +
.../wireless/intel/iwlwifi/iwl-context-info.h | 20 +++----
drivers/net/wireless/intel/iwlwifi/iwl-fh.h | 5 +-
.../intel/iwlwifi/pcie/ctxt-info-gen3.c | 2 +-
.../wireless/intel/iwlwifi/pcie/ctxt-info.c | 11 ++--
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 13 +++++
.../wireless/intel/iwlwifi/pcie/internal.h | 5 +-
drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 34 ++++++++----
10 files changed, 116 insertions(+), 33 deletions(-)