From patchwork Sat Sep 5 13:41:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 1358017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=david-bauer.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=Ohw6hhPa; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BkG3T30zJz9sSn for ; Sat, 5 Sep 2020 23:43:49 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=OKTgVNmdQfFIHhfX6UmVClOA3PWTmJ8cb38oMnHqT7s=; b=Ohw6hhPaQsfxfCzASu5DQ6mQaw z6w08XFWBUIvMrGBCuKJpGh2odgC+axqW5qVMnYKsa4DApZrsUJwkJvfvMOmI2lHm4EkbiXISH7TH OjWjTMaJbSbGS7EAtXMUrdALV5JuWNeaBqFCTY5OakPPpkIO1PiiSCGuTU+k4OUPik8OlHwI/kvmG gthEV/T3KqcxJFNa6P3V+ybpP+eE0cE9wgUDc1ACNfgwU0iHhkKpgPsIV1PN9g9QHjyoIdFAwGjg1 QLEQyY3NzPMuinh+wHj7rvmFaK60n2psPYhg5pC5ttnGu9UliZAqj10LtQRP+FDnFoZhgjDVT1/MT zJ8295hw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYSC-0007zg-Hw; Sat, 05 Sep 2020 13:42:04 +0000 Received: from mars.blocktrron.ovh ([2001:41d0:401:3000::cbd] helo=mail.blocktrron.ovh) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEYS8-0007z2-Pk for openwrt-devel@lists.openwrt.org; Sat, 05 Sep 2020 13:42:02 +0000 Received: from localhost.localdomain (p200300e53f2de800fa4e4b70cb8435e0.dip0.t-ipconnect.de [IPv6:2003:e5:3f2d:e800:fa4e:4b70:cb84:35e0]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.blocktrron.ovh (Postfix) with ESMTPSA id CB75123FF9 for ; Sat, 5 Sep 2020 15:41:57 +0200 (CEST) From: David Bauer To: openwrt-devel@lists.openwrt.org Subject: [PATCH] hostapd: add support for per-BSS airtime configuration Date: Sat, 5 Sep 2020 15:41:47 +0200 Message-Id: <20200905134147.30997-1-mail@david-bauer.net> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200905_094200_938917_9FBE5392 X-CRM114-Status: GOOD ( 13.00 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add support for per-BSS airtime weight configuration. This allows to set a airtime weight per BSS as well as a ratio limit based on the weight. Support for this feature is only enabled in the full flavors of hostapd. Consult the hostapd.conf documentation (Airtime policy configuration) for more information on the inner workings of the exposed settings. Signed-off-by: David Bauer --- package/network/services/hostapd/Makefile | 2 +- .../services/hostapd/files/hostapd-full.config | 2 +- package/network/services/hostapd/files/hostapd.sh | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 5e56a43e9a..8f94dce782 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 0ecce423e7..ab9d13aae7 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -384,7 +384,7 @@ CONFIG_TAXONOMY=y #CONFIG_OWE=y # Airtime policy support -#CONFIG_AIRTIME_POLICY=y +CONFIG_AIRTIME_POLICY=y # Override default value for the wpa_disable_eapol_key_retries configuration # parameter. See that parameter in hostapd.conf for more details. diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index fe5b407bc1..dd505f6841 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -110,7 +110,7 @@ hostapd_prepare_device_config() { local base_cfg= json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ - acs_chan_bias local_pwr_constraint spectrum_mgmt_required + acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode hostapd_set_log_options base_cfg @@ -118,6 +118,7 @@ hostapd_prepare_device_config() { set_default spectrum_mgmt_required 0 set_default doth 1 set_default legacy_rates 1 + set_default airtime_mode 0 [ "$hwmode" = "b" ] && legacy_rates=1 @@ -164,6 +165,7 @@ hostapd_prepare_device_config() { [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N" append base_cfg "beacon_int=$beacon_int" "$N" append base_cfg "dtim_period=$dtim_period" "$N" + [ "$airtime_mode" -gt 0 ] && append base_cfg "airtime_mode=$airtime_mode" "$N" json_get_values opts hostapd_options for val in $opts; do @@ -315,7 +317,8 @@ hostapd_set_bss_options() { iapp_interface eapol_version dynamic_vlan ieee80211w nasid \ acct_server acct_secret acct_port acct_interval \ bss_load_update_period chan_util_avg_period sae_require_mfp \ - multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key + multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key \ + airtime_bss_weight airtime_bss_limit set_default isolate 0 set_default maxassoc 0 @@ -333,6 +336,8 @@ hostapd_set_bss_options() { set_default chan_util_avg_period 600 set_default utf8_ssid 1 set_default multi_ap 0 + set_default airtime_bss_weight 0 + set_default airtime_bss_limit 0 append bss_conf "ctrl_interface=/var/run/hostapd" if [ "$isolate" -gt 0 ]; then @@ -345,6 +350,9 @@ hostapd_set_bss_options() { append bss_conf "ap_max_inactivity=$max_inactivity" "$N" fi + [ "$airtime_bss_weight" -gt 0 ] && append bss_conf "airtime_bss_weight=$airtime_bss_weight" "$N" + [ "$airtime_bss_limit" -gt 0 ] && append bss_conf "airtime_bss_limit=$airtime_bss_limit" "$N" + append bss_conf "bss_load_update_period=$bss_load_update_period" "$N" append bss_conf "chan_util_avg_period=$chan_util_avg_period" "$N" append bss_conf "disassoc_low_ack=$disassoc_low_ack" "$N"