From patchwork Wed Jun 26 17:28:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Pierre TOSONI X-Patchwork-Id: 2787471 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DF85F9F245 for ; Wed, 26 Jun 2013 17:28:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E469C2041D for ; Wed, 26 Jun 2013 17:28:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5EC3820402 for ; Wed, 26 Jun 2013 17:28:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752702Ab3FZR2v (ORCPT ); Wed, 26 Jun 2013 13:28:51 -0400 Received: from smtp26.msg.oleane.net ([62.161.4.26]:38537 "EHLO smtp26.msg.oleane.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751841Ab3FZR2u (ORCPT ); Wed, 26 Jun 2013 13:28:50 -0400 Received: from acksys.fr ([195.6.104.67]) (authenticated) by smtp26.msg.oleane.net (MTA) with ESMTP id r5QHSmaL031493 for ; Wed, 26 Jun 2013 19:28:48 +0200 Received: from localhost.localdomain ([192.168.1.29]) by acksys.fr with Microsoft SMTPSVC(6.0.3790.4675); Wed, 26 Jun 2013 19:29:33 +0200 From: Jean-Pierre Tosoni To: linux-wireless@vger.kernel.org Cc: "J.P. Tosoni" Subject: [RFC] mac80211: Use libnl-configurable values for retry counts Date: Wed, 26 Jun 2013 19:28:43 +0200 Message-Id: <1372267723-25072-1-git-send-email-jp.tosoni@acksys.fr> X-Mailer: git-send-email 1.7.2.5 X-OriginalArrivalTime: 26 Jun 2013 17:29:33.0828 (UTC) FILETIME=[B9339440:01CE7292] X-PMX-Spam: Probability=8% X-PFSI-Info: PMX 5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.6.26.171219 (no antivirus check) X-Orange-Auth: bWMxNDg4LTg= Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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: J.P. Tosoni In the rate control algorithms, the maximum retry count is limited by a) a constant value obtained from the hardware driver b) a constant limit (6ms) on the time allowed for all retries of each frame. Replace the retry count by existing configurable values from nl80211. Use wiphy->retry_short for management frames. Use wiphy->retry_long for other frames. Check that the configured value does not exceed driver capabilities. Caveat: in minstrel rate control, the retry count is reused for each rate of the rate table, potentially resulting in 4*max_retry retries. --- Please comment on the patch and the caveat above, then I'll proceed to update iw and to change the hard limit of 30 retries in ath9k. net/mac80211/cfg.c | 4 ++++ net/mac80211/rate.c | 2 +- net/mac80211/rc80211_minstrel.c | 6 +----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 082f270..4d3eb56 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2203,11 +2203,15 @@ static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) if (changed & WIPHY_PARAM_RETRY_SHORT) { if (wiphy->retry_short > IEEE80211_MAX_TX_RETRY) return -EINVAL; + if (wiphy->retry_short > local->hw.max_rate_tries) + return -EINVAL; local->hw.conf.short_frame_max_tx_count = wiphy->retry_short; } if (changed & WIPHY_PARAM_RETRY_LONG) { if (wiphy->retry_long > IEEE80211_MAX_TX_RETRY) return -EINVAL; + if (wiphy->retry_long > local->hw.max_rate_tries) + return -EINVAL; local->hw.conf.long_frame_max_tx_count = wiphy->retry_long; } if (changed & diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index a02bef3..9be3006 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -266,7 +266,7 @@ static void __rate_control_send_low(struct ieee80211_hw *hw, info->control.rates[0].count = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? - 1 : hw->max_rate_tries; + 1 : hw->conf.short_frame_max_tx_count; info->control.skip_table = 1; } diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index ac7ef54..502d0c9 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c @@ -592,11 +592,7 @@ minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) /* maximum time that the hw is allowed to stay in one MRR segment */ mp->segment_size = 6000; - if (hw->max_rate_tries > 0) - mp->max_retry = hw->max_rate_tries; - else - /* safe default, does not necessarily have to match hw properties */ - mp->max_retry = 7; + mp->max_retry = hw->conf.long_frame_max_tx_count; if (hw->max_rates >= 4) mp->has_mrr = true;