From patchwork Sun Feb 22 20:16:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 5862541 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0AF6E9F269 for ; Sun, 22 Feb 2015 20:17:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02AC420552 for ; Sun, 22 Feb 2015 20:17:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A275F2041C for ; Sun, 22 Feb 2015 20:17:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752212AbbBVURE (ORCPT ); Sun, 22 Feb 2015 15:17:04 -0500 Received: from mga01.intel.com ([192.55.52.88]:50376 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752076AbbBVURD (ORCPT ); Sun, 22 Feb 2015 15:17:03 -0500 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 22 Feb 2015 12:16:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,626,1418112000"; d="scan'208,223";a="458047009" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by FMSMGA003.fm.intel.com with ESMTP; 22 Feb 2015 12:01:29 -0800 Received: from lcsmsx152.ger.corp.intel.com (10.186.165.231) by IRSMSX107.ger.corp.intel.com (163.33.3.99) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 22 Feb 2015 20:16:48 +0000 Received: from hasmsx107.ger.corp.intel.com ([169.254.6.116]) by LCSMSX152.ger.corp.intel.com ([169.254.4.216]) with mapi id 14.03.0195.001; Sun, 22 Feb 2015 22:16:47 +0200 From: "Grumbach, Emmanuel" To: "linux-wireless@mrs.ro" CC: "linux-wireless@vger.kernel.org" , "Harary, Eran" Subject: Re: iwlwifi: ampdu_factor for iwl-6000 is set to 0 Thread-Topic: iwlwifi: ampdu_factor for iwl-6000 is set to 0 Thread-Index: AQHQTpk++sZONYGY/0e7EQCDs6o3l5z8dNwAgACFYAA= Date: Sun, 22 Feb 2015 20:16:46 +0000 Message-ID: <1424636206.30822.1.camel@egrumbacBox> References: <54E9C852.50809@mrs.ro> <1424607564.20465.1.camel@egrumbacBox> In-Reply-To: <1424607564.20465.1.camel@egrumbacBox> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.255.198.60] MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi again (fixed your address, I hope it will not bounce this time...) Please test the patch attached. On Sun, 2015-02-22 at 14:19 +0200, Emmanuel Grumbach wrote: > Hi, > > On Sun, 2015-02-22 at 14:15 +0200, Valentin Manea wrote: > > Hi, > > > > Recently I started using kernel 3.19 from Ubuntu ppa and I noticed a > > big drop in Wifi throughput. After some investigation I found that my > > router was reporting the AMPDU factor changed from 3(in 3.18) to 0(in 3.19): > > cat > > /sys/kernel/debug/ieee80211/phy1/netdev:wlan1/stations/c4:xx:xx:xx:xx:xx/ht_capa: > > ht supported > > cap: 0x1066 > > HT20/HT40 > > Dynamic SM Power Save > > RX HT20 SGI > > RX HT40 SGI > > No RX STBC > > Max AMSDU length: 3839 bytes > > DSSS/CCK HT40 > > ampdu factor/density: 3/5 > > MCS mask: ff ff 00 00 00 00 00 00 00 00 > > MCS tx params: 1 > > > > ht supported > > cap: 0x1066 > > HT20/HT40 > > Dynamic SM Power Save > > RX HT20 SGI > > RX HT40 SGI > > No RX STBC > > Max AMSDU length: 3839 bytes > > DSSS/CCK HT40 > > ampdu factor/density: 0/5 > > MCS mask: ff ff 00 00 00 00 00 00 00 00 > > MCS tx params: 1 > > > > In my setup this means a 50% drop in downstream throughput(from > > 160Mbit/s to 80Mbit/s) > > > > I tracked down the offending commit and it seems this is it: > > iwlwifi: change max HT and VHT A-MPDU exponent > > c064ddf318aa51647a30108f7cd151c208c62eef > > A new mechanism was created to have per device ampd_factor: > > - ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; > > + ht_info->ampdu_factor = cfg->max_ht_ampdu_exponent; > > > > however the max_ht_ampdu_exponent is not set for any of the iwl-6000 > > devices(including mine Intel Corporation Centrino Advanced-N 6235) > > > > #define IWL_DEVICE_6035 \ > > .fw_name_pre = IWL6030_FW_PRE, \ > > .ucode_api_max = IWL6035_UCODE_API_MAX, \ > > .ucode_api_ok = IWL6035_UCODE_API_OK, \ > > .ucode_api_min = IWL6035_UCODE_API_MIN, \ > > .device_family = IWL_DEVICE_FAMILY_6030, \ > > .max_inst_size = IWL60_RTC_INST_SIZE, \ > > .max_data_size = IWL60_RTC_DATA_SIZE, \ > > .nvm_ver = EEPROM_6030_EEPROM_VERSION, \ > > .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ > > .base_params = &iwl6000_g2_base_params, \ > > .eeprom_params = &iwl6000_eeprom_params, \ > > .led_mode = IWL_LED_RF_STATE > > > > Since the original value of IEEE80211_HT_MAX_AMPDU_64K I would > > suggest adding it to some iwl-6000 devices. > > I did not submit any patches because I have no idea if there are > > device which would not support this feature, however it worked before > > with default value set to IEEE80211_HT_MAX_AMPDU_64K so I guess it must > > be supported. > > > > Thank you for your report and analysis. You saved us a lot of time. > I'll send a fix. From bb6f89bc21b1ebc93018bbddd5935f4badc6a12d Mon Sep 17 00:00:00 2001 From: Emmanuel Grumbach Date: Sun, 22 Feb 2015 22:10:35 +0200 Subject: [PATCH] iwlwifi: fix max_ht_ampdu_exponent for older devices The commit below didn't update the max_ht_ampdu_exponent for the devices listed in iwl-[1-6]000.c This had an impact in the Rx throughput. One user reported that because of this, his downstream throughput by a half. Fix that. CC: [3.19] Fixes: c064ddf318aa ("iwlwifi: change max HT and VHT A-MPDU exponent") Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-1000.c | 6 ++++-- drivers/net/wireless/iwlwifi/iwl-2000.c | 13 +++++++++---- drivers/net/wireless/iwlwifi/iwl-5000.c | 6 ++++-- drivers/net/wireless/iwlwifi/iwl-6000.c | 18 ++++++++++++------ 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index c3817fa..06f6cc0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c @@ -95,7 +95,8 @@ static const struct iwl_eeprom_params iwl1000_eeprom_params = { .nvm_calib_ver = EEPROM_1000_TX_POWER_VERSION, \ .base_params = &iwl1000_base_params, \ .eeprom_params = &iwl1000_eeprom_params, \ - .led_mode = IWL_LED_BLINK + .led_mode = IWL_LED_BLINK, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl1000_bgn_cfg = { .name = "Intel(R) Centrino(R) Wireless-N 1000 BGN", @@ -121,7 +122,8 @@ const struct iwl_cfg iwl1000_bg_cfg = { .base_params = &iwl1000_base_params, \ .eeprom_params = &iwl1000_eeprom_params, \ .led_mode = IWL_LED_RF_STATE, \ - .rx_with_siso_diversity = true + .rx_with_siso_diversity = true, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl100_bgn_cfg = { .name = "Intel(R) Centrino(R) Wireless-N 100 BGN", diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c index 21e5d08..890b95f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-2000.c +++ b/drivers/net/wireless/iwlwifi/iwl-2000.c @@ -123,7 +123,9 @@ static const struct iwl_eeprom_params iwl20x0_eeprom_params = { .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ .base_params = &iwl2000_base_params, \ .eeprom_params = &iwl20x0_eeprom_params, \ - .led_mode = IWL_LED_RF_STATE + .led_mode = IWL_LED_RF_STATE, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K + const struct iwl_cfg iwl2000_2bgn_cfg = { .name = "Intel(R) Centrino(R) Wireless-N 2200 BGN", @@ -149,7 +151,8 @@ const struct iwl_cfg iwl2000_2bgn_d_cfg = { .nvm_calib_ver = EEPROM_2000_TX_POWER_VERSION, \ .base_params = &iwl2030_base_params, \ .eeprom_params = &iwl20x0_eeprom_params, \ - .led_mode = IWL_LED_RF_STATE + .led_mode = IWL_LED_RF_STATE, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl2030_2bgn_cfg = { .name = "Intel(R) Centrino(R) Wireless-N 2230 BGN", @@ -170,7 +173,8 @@ const struct iwl_cfg iwl2030_2bgn_cfg = { .base_params = &iwl2000_base_params, \ .eeprom_params = &iwl20x0_eeprom_params, \ .led_mode = IWL_LED_RF_STATE, \ - .rx_with_siso_diversity = true + .rx_with_siso_diversity = true, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl105_bgn_cfg = { .name = "Intel(R) Centrino(R) Wireless-N 105 BGN", @@ -197,7 +201,8 @@ const struct iwl_cfg iwl105_bgn_d_cfg = { .base_params = &iwl2030_base_params, \ .eeprom_params = &iwl20x0_eeprom_params, \ .led_mode = IWL_LED_RF_STATE, \ - .rx_with_siso_diversity = true + .rx_with_siso_diversity = true, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl135_bgn_cfg = { .name = "Intel(R) Centrino(R) Wireless-N 135 BGN", diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 332bbed..724194e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c @@ -93,7 +93,8 @@ static const struct iwl_eeprom_params iwl5000_eeprom_params = { .nvm_calib_ver = EEPROM_5000_TX_POWER_VERSION, \ .base_params = &iwl5000_base_params, \ .eeprom_params = &iwl5000_eeprom_params, \ - .led_mode = IWL_LED_BLINK + .led_mode = IWL_LED_BLINK, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl5300_agn_cfg = { .name = "Intel(R) Ultimate N WiFi Link 5300 AGN", @@ -158,7 +159,8 @@ const struct iwl_cfg iwl5350_agn_cfg = { .base_params = &iwl5000_base_params, \ .eeprom_params = &iwl5000_eeprom_params, \ .led_mode = IWL_LED_BLINK, \ - .internal_wimax_coex = true + .internal_wimax_coex = true, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl5150_agn_cfg = { .name = "Intel(R) WiMAX/WiFi Link 5150 AGN", diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 8f2c3c8..21b2630 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c @@ -145,7 +145,8 @@ static const struct iwl_eeprom_params iwl6000_eeprom_params = { .nvm_calib_ver = EEPROM_6005_TX_POWER_VERSION, \ .base_params = &iwl6000_g2_base_params, \ .eeprom_params = &iwl6000_eeprom_params, \ - .led_mode = IWL_LED_RF_STATE + .led_mode = IWL_LED_RF_STATE, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl6005_2agn_cfg = { .name = "Intel(R) Centrino(R) Advanced-N 6205 AGN", @@ -199,7 +200,8 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = { .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ .base_params = &iwl6000_g2_base_params, \ .eeprom_params = &iwl6000_eeprom_params, \ - .led_mode = IWL_LED_RF_STATE + .led_mode = IWL_LED_RF_STATE, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl6030_2agn_cfg = { .name = "Intel(R) Centrino(R) Advanced-N 6230 AGN", @@ -235,7 +237,8 @@ const struct iwl_cfg iwl6030_2bg_cfg = { .nvm_calib_ver = EEPROM_6030_TX_POWER_VERSION, \ .base_params = &iwl6000_g2_base_params, \ .eeprom_params = &iwl6000_eeprom_params, \ - .led_mode = IWL_LED_RF_STATE + .led_mode = IWL_LED_RF_STATE, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl6035_2agn_cfg = { .name = "Intel(R) Centrino(R) Advanced-N 6235 AGN", @@ -290,7 +293,8 @@ const struct iwl_cfg iwl130_bg_cfg = { .nvm_calib_ver = EEPROM_6000_TX_POWER_VERSION, \ .base_params = &iwl6000_base_params, \ .eeprom_params = &iwl6000_eeprom_params, \ - .led_mode = IWL_LED_BLINK + .led_mode = IWL_LED_BLINK, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl6000i_2agn_cfg = { .name = "Intel(R) Centrino(R) Advanced-N 6200 AGN", @@ -322,7 +326,8 @@ const struct iwl_cfg iwl6000i_2bg_cfg = { .base_params = &iwl6050_base_params, \ .eeprom_params = &iwl6000_eeprom_params, \ .led_mode = IWL_LED_BLINK, \ - .internal_wimax_coex = true + .internal_wimax_coex = true, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl6050_2agn_cfg = { .name = "Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN", @@ -347,7 +352,8 @@ const struct iwl_cfg iwl6050_2abg_cfg = { .base_params = &iwl6050_base_params, \ .eeprom_params = &iwl6000_eeprom_params, \ .led_mode = IWL_LED_BLINK, \ - .internal_wimax_coex = true + .internal_wimax_coex = true, \ + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K const struct iwl_cfg iwl6150_bgn_cfg = { .name = "Intel(R) Centrino(R) Wireless-N + WiMAX 6150 BGN", -- 1.9.1