From patchwork Wed Aug 5 16:18:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 6951661 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1CB15C05AC for ; Wed, 5 Aug 2015 16:19:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22EDC20398 for ; Wed, 5 Aug 2015 16:18:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07AD82034E for ; Wed, 5 Aug 2015 16:18:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbbHEQSz (ORCPT ); Wed, 5 Aug 2015 12:18:55 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:34030 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752433AbbHEQSx (ORCPT ); Wed, 5 Aug 2015 12:18:53 -0400 Received: by oip136 with SMTP id 136so22905709oip.1 for ; Wed, 05 Aug 2015 09:18:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=pWpi8hDv4WCmot5Xn4+i8nYIrhh/TiljxmpXcisNwNU=; b=pvorxZ8t1ORuYncMXDr6azx4yjCJKPs+zPjlcpRK9Ux5lgRlU2w827+XBDvp8pGNEK 5zOduF1bEA8i/OgM81EEpMX0wy0/evmhu1/w6X4HxjP+J2bLlPb73QmTaxuxYc7s2u3Q J5QsmtpT1tuAD2zcIWKG2YRZbegzjL4lOHDrW16aFf6zzuXuX1uLzihfTe/qOAJhRs4t vnBPXQsAbgq/ie8Cq/PWUj79No6jgBlbR5RtqKtvO9MFeALdpxGqpN8fHy5u8yni+f6X Za2X4rUcZhj1RhyrwLcNOBq4EjBvihhJlECmLHylnUbm31qmvzTXjVcBcTSIF+kuf23O 807Q== X-Received: by 10.202.83.203 with SMTP id h194mr8404268oib.119.1438791532969; Wed, 05 Aug 2015 09:18:52 -0700 (PDT) Received: from linux.site (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id p133sm1975348oif.3.2015.08.05.09.18.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Aug 2015 09:18:52 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, pkshih , shaofu , Larry Finger Subject: [PATCH V2 NEXT 3/7] rtlwifi: Make retry limits depend on vif type Date: Wed, 5 Aug 2015 11:18:36 -0500 Message-Id: <1438791520-13216-4-git-send-email-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1438791520-13216-1-git-send-email-Larry.Finger@lwfinger.net> References: <1438791520-13216-1-git-send-email-Larry.Finger@lwfinger.net> 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,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 From: pkshih Making the retry limits depend on the vif type can boost performance. Signed-off-by: pkshih Signed-off-by: shaofu Signed-off-by: Larry Finger --- V2 - no changes --- drivers/net/wireless/rtlwifi/core.c | 19 +++++++++++++++---- drivers/net/wireless/rtlwifi/pci.c | 8 +++++++- drivers/net/wireless/rtlwifi/ps.c | 3 +++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c index 3b3a88b..19729ed 100644 --- a/drivers/net/wireless/rtlwifi/core.c +++ b/drivers/net/wireless/rtlwifi/core.c @@ -238,6 +238,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw, struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); int err = 0; + u8 retry_limit = 0x30; if (mac->vif) { RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING, @@ -275,7 +276,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw, mac->basic_rates = 0xff0; rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BASIC_RATE, (u8 *)(&mac->basic_rates)); - + retry_limit = 0x07; break; case NL80211_IFTYPE_P2P_GO: mac->p2p = P2P_ROLE_GO; @@ -292,6 +293,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw, mac->basic_rates = 0xff0; rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BASIC_RATE, (u8 *)(&mac->basic_rates)); + retry_limit = 0x07; break; case NL80211_IFTYPE_MESH_POINT: RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, @@ -326,6 +328,10 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw, memcpy(mac->mac_addr, vif->addr, ETH_ALEN); rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, mac->mac_addr); + mac->retry_long = retry_limit; + mac->retry_short = retry_limit; + rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT, + (u8 *)(&retry_limit)); out: mutex_unlock(&rtlpriv->locks.conf_mutex); return err; @@ -650,10 +656,15 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed) RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD, "IEEE80211_CONF_CHANGE_RETRY_LIMITS %x\n", hw->conf.long_frame_max_tx_count); - mac->retry_long = hw->conf.long_frame_max_tx_count; - mac->retry_short = hw->conf.long_frame_max_tx_count; - rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT, + /* On first open, everything changes (changed == ~0), + * so use our default value instead of wiphy's one. + */ + if (changed != ~0) { + mac->retry_long = hw->conf.long_frame_max_tx_count; + mac->retry_short = hw->conf.long_frame_max_tx_count; + rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT, (u8 *)(&hw->conf.long_frame_max_tx_count)); + } } if (changed & IEEE80211_CONF_CHANGE_CHANNEL && diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index f46c9d7..a621d7d 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c @@ -1227,6 +1227,10 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw, mac->current_ampdu_density = 7; mac->current_ampdu_factor = 3; + /* Retry Limit */ + mac->retry_short = 7; + mac->retry_long = 7; + /*QOS*/ rtlpci->acm_method = EACMWAY2_SW; @@ -1833,7 +1837,7 @@ static int rtl_pci_start(struct ieee80211_hw *hw) struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); - + struct rtl_mac *rtlmac = rtl_mac(rtl_priv(hw)); int err; rtl_pci_reset_trx_ring(hw); @@ -1850,6 +1854,8 @@ static int rtl_pci_start(struct ieee80211_hw *hw) "Failed to config hardware!\n"); return err; } + rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT, + &rtlmac->retry_long); rtlpriv->cfg->ops->enable_interrupt(hw); RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, "enable_interrupt OK\n"); diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c index b69321d..b6b6834 100644 --- a/drivers/net/wireless/rtlwifi/ps.c +++ b/drivers/net/wireless/rtlwifi/ps.c @@ -34,6 +34,7 @@ bool rtl_ps_enable_nic(struct ieee80211_hw *hw) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); + struct rtl_mac *rtlmac = rtl_mac(rtl_priv(hw)); /*<1> reset trx ring */ if (rtlhal->interface == INTF_PCI) @@ -46,6 +47,8 @@ bool rtl_ps_enable_nic(struct ieee80211_hw *hw) /*<2> Enable Adapter */ if (rtlpriv->cfg->ops->hw_init(hw)) return false; + rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT, + &rtlmac->retry_long); RT_CLEAR_PS_LEVEL(ppsc, RT_RF_OFF_LEVL_HALT_NIC); /*<3> Enable Interrupt */