aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/pcie/trans.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-03-21 08:30:03 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-04-13 02:35:47 -0400
commitf14d6b39c0b3519f8148e1371d2149c148893b61 (patch)
tree6fecbc98089f64d552cd23a7a70ab7f599568d9d /drivers/net/wireless/iwlwifi/pcie/trans.c
parent9a75b3df18477ef3bd16509bc05e83a7ce6a8019 (diff)
iwlwifi: pcie: implement GRO without NAPI
Use the new NAPI infrastructure added to mac80211 to get GRO. We don't really implement NAPI since we don't have a real poll function and we never schedule a NAPI poll. Instead of this, we collect all the packets we got from a single interrupt and then call napi_gro_flush(). This allows us to benefit from GRO. In half duplex medium like WiFi, its main advantage is that it reduces the number of TCP Acks, hence improving the TCP Rx performance. Since we call the Rx path with a spinlock held, remove the might_sleep mention from the op_mode's API. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Ido Yariv <ido@wizery.com> [Squash different patches and rewrite the commit message] Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie/trans.c')
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index dcfd6d866d09..97e6bd826880 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -1053,6 +1053,12 @@ static void iwl_trans_pcie_write_prph(struct iwl_trans *trans, u32 addr,
1053 iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val); 1053 iwl_trans_pcie_write32(trans, HBUS_TARG_PRPH_WDAT, val);
1054} 1054}
1055 1055
1056static int iwl_pcie_dummy_napi_poll(struct napi_struct *napi, int budget)
1057{
1058 WARN_ON(1);
1059 return 0;
1060}
1061
1056static void iwl_trans_pcie_configure(struct iwl_trans *trans, 1062static void iwl_trans_pcie_configure(struct iwl_trans *trans,
1057 const struct iwl_trans_config *trans_cfg) 1063 const struct iwl_trans_config *trans_cfg)
1058{ 1064{
@@ -1079,6 +1085,18 @@ static void iwl_trans_pcie_configure(struct iwl_trans *trans,
1079 1085
1080 trans_pcie->command_names = trans_cfg->command_names; 1086 trans_pcie->command_names = trans_cfg->command_names;
1081 trans_pcie->bc_table_dword = trans_cfg->bc_table_dword; 1087 trans_pcie->bc_table_dword = trans_cfg->bc_table_dword;
1088
1089 /* Initialize NAPI here - it should be before registering to mac80211
1090 * in the opmode but after the HW struct is allocated.
1091 * As this function may be called again in some corner cases don't
1092 * do anything if NAPI was already initialized.
1093 */
1094 if (!trans_pcie->napi.poll && trans->op_mode->ops->napi_add) {
1095 init_dummy_netdev(&trans_pcie->napi_dev);
1096 iwl_op_mode_napi_add(trans->op_mode, &trans_pcie->napi,
1097 &trans_pcie->napi_dev,
1098 iwl_pcie_dummy_napi_poll, 64);
1099 }
1082} 1100}
1083 1101
1084void iwl_trans_pcie_free(struct iwl_trans *trans) 1102void iwl_trans_pcie_free(struct iwl_trans *trans)
@@ -1099,6 +1117,9 @@ void iwl_trans_pcie_free(struct iwl_trans *trans)
1099 pci_disable_device(trans_pcie->pci_dev); 1117 pci_disable_device(trans_pcie->pci_dev);
1100 kmem_cache_destroy(trans->dev_cmd_pool); 1118 kmem_cache_destroy(trans->dev_cmd_pool);
1101 1119
1120 if (trans_pcie->napi.poll)
1121 netif_napi_del(&trans_pcie->napi);
1122
1102 kfree(trans); 1123 kfree(trans);
1103} 1124}
1104 1125