From patchwork Tue Sep 26 09:59:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Gruszka X-Patchwork-Id: 9971597 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D7D70602BD for ; Tue, 26 Sep 2017 10:01:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2F0C28DEF for ; Tue, 26 Sep 2017 10:01:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7AF928DF4; Tue, 26 Sep 2017 10:01:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8120428DEF for ; Tue, 26 Sep 2017 10:01:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754454AbdIZKBi (ORCPT ); Tue, 26 Sep 2017 06:01:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50200 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754323AbdIZKBh (ORCPT ); Tue, 26 Sep 2017 06:01:37 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70B3B4E028; Tue, 26 Sep 2017 10:01:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 70B3B4E028 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=sgruszka@redhat.com Received: from localhost (unknown [10.43.2.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7BF7877EEE; Tue, 26 Sep 2017 10:01:34 +0000 (UTC) From: Stanislaw Gruszka To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, toke@toke.dk, Stanislaw Gruszka Subject: [PATCH] mac80211: make STA_SLOW_THRESHOLD local Date: Tue, 26 Sep 2017 11:59:47 +0200 Message-Id: <1506419987-22995-1-git-send-email-sgruszka@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 26 Sep 2017 10:01:37 +0000 (UTC) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP STA_SLOW_THRESHOLD is used only in one function, so don't need to be global define. Patch also fixes problem of htmldocs build I encountered: Error(.//net/mac80211/sta_info.h:416): cannot understand prototype: 'STA_SLOW_THRESHOLD 6000 ' Signed-off-by: Stanislaw Gruszka --- net/mac80211/sta_info.c | 8 +++++++- net/mac80211/sta_info.h | 8 -------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 6961501..b79c2d0 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -2319,10 +2319,16 @@ unsigned long ieee80211_sta_last_active(struct sta_info *sta) static void sta_update_codel_params(struct sta_info *sta, u32 thr) { + /* The bandwidth threshold below which the per-station CoDel parameters + * will be scaled to be more lenient (to prevent starvation of slow + * stations). Value will be scaled by the number of active stations. + */ + const unsigned int slow_threshold = 6000; /* 6Mbps */ + if (!sta->sdata->local->ops->wake_tx_queue) return; - if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) { + if (thr && thr < slow_threshold * sta->local->num_sta) { sta->cparams.target = MS2TIME(50); sta->cparams.interval = MS2TIME(300); sta->cparams.ecn = false; diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 3acbdfa..24eeab8 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h @@ -399,14 +399,6 @@ struct ieee80211_sta_rx_stats { }; /** - * The bandwidth threshold below which the per-station CoDel parameters will be - * scaled to be more lenient (to prevent starvation of slow stations). This - * value will be scaled by the number of active stations when it is being - * applied. - */ -#define STA_SLOW_THRESHOLD 6000 /* 6 Mbps */ - -/** * struct sta_info - STA information * * This structure collects information about a station that