From patchwork Mon Sep 21 08:45:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Valkov X-Patchwork-Id: 1368171 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=fail (p=none dis=none) header.from=abv.bg 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=b2Iqnm7N; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=abv.bg header.i=@abv.bg header.a=rsa-sha256 header.s=smtp-out header.b=OEZqqX5o; 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 4Bvyl31TsDz9sPB for ; Mon, 21 Sep 2020 18:48:14 +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:To:Date:Message-Id:Subject:Mime-Version: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=Mj1DOaUgPi2QZNLLglSs4sSOQ9H6Vvv7yrZhbuzk3fc=; b=b2Iqnm7Nb3tyRpCKtL0yIK7dhP q8E48X7dpGy3FwhDDALO2myF043MsxFxbhAUydl4sip/5tU3TIySBH6rcfLfqN5G1BAMw8yXBR5Td krxZZsdLu8WUq6kihWy2ygp9auPtI9PPLNjcqmx4fKDoyuo3XLKbodxJBfjv9Hvyp8dwEGUxSDJ5U ItUwLpZaDrJvLarJ0HxauPNJgzvTBizY10E9x4IqCLvCo0pRiKp4Jz5PfNaMrWkby0vt65/EgaPks Corjw64Jcn7Fm8t/xeVf65WDjCupj7dmSrpkZ2NWwi+vkR5gtexBku51GVadSgpE1z+2hNriECLS0 krpQ4Zsg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKHSX-00028Q-5z; Mon, 21 Sep 2020 08:46:05 +0000 Received: from pop36.abv.bg ([194.153.145.227]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKHST-00027X-P8 for openwrt-devel@lists.openwrt.org; Mon, 21 Sep 2020 08:46:04 +0000 Received: from smtp.abv.bg (localhost [127.0.0.1]) by pop36.abv.bg (Postfix) with ESMTP id 7737C180AAA7 for ; Mon, 21 Sep 2020 11:45:59 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=abv.bg; s=smtp-out; t=1600677959; bh=e5+nVPJIE8yF87+bnizu+Ge7xi0q/3oX1BGZ43TaDC0=; h=From:Subject:Date:To:From; b=OEZqqX5o0hyILmk5In7guXSJWgx0R0jqQmaVBCvDUN4KSaqMe7RJ8mzl+n6yzRX9I zZWDFwAa/PeM6lik2oDYV1sEEw1h/7yFbRo7AcNus8+0beYw1rTfolaAT6Kr0GeIW5 EIOQz9JLW/m0sy7MPZxiWzlHKsxa+xqpSBBw8VBM= X-HELO: [192.168.192.3] Authentication-Results: smtp.abv.bg; auth=pass (plain) smtp.auth=gvalkov@abv.bg Received: from Unknown (HELO [192.168.192.3]) (87.118.177.198) by smtp.abv.bg (qpsmtpd/0.96) with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted); Mon, 21 Sep 2020 11:45:59 +0300 From: Georgi Valkov Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: mac80211: Fixed a bug: STA disconnects frequently Message-Id: Date: Mon, 21 Sep 2020 11:45:56 +0300 To: openwrt-devel@lists.openwrt.org X-Mailer: Apple Mail (2.3608.120.23.2.1) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200921_044602_204425_1B4BCD2D X-CRM114-Status: GOOD ( 19.81 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [gvalkov[at]abv.bg] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 Hi Felix! Please revise your patch: package/kernel/mac80211/patches/subsys/321-mac80211-optimize-station-connection-monitor.patch net/mac80211/mlme.c Function ieee80211_sta_tx_notify should check and reset sdata->u.mgd.probe_send_count = 0, when ack is true, before calling ieee80211_queue_work. Otherwise the counter accumulates over time and the STA will eventually disconnect periodically. Test conditions: STA (WDS): TL-WR1043ND v4 - fixing the STA firmware resolves the issue AP (WDS): WRT3200ACM - AP is not affected PC wired to AP: ping -t sta-ip-address - indicate lost packets Log: [ 1516.144323] br-lan: port 3(wifi) entered disabled state [ 1516.149836] br-lan: topology change detected, propagating [ 1517.097423] wifi: authenticate with 60:38:e0:xx:xx:xx [ 1517.116774] wifi: send auth to 60:38:e0:xx:xx:xx (try 1/3) [ 1517.159748] wifi: authenticated [ 1517.167704] wifi: associate with 60:38:e0:xx:xx:xx (try 1/3) [ 1517.191637] wifi: RX AssocResp from 60:38:e0:xx:xx:xx (capab=0x431 status=0 aid=1) [ 1517.199819] wifi: associated [ 1517.213115] br-lan: port 3(wifi) entered blocking state [ 1517.218579] br-lan: port 3(wifi) entered listening state [ 1519.121477] br-lan: port 3(wifi) entered disabled state [ 1519.126978] br-lan: topology change detected, propagating [ 1520.075548] wifi: authenticate with 60:38:e0:xx:xx:xx [ 1520.094883] wifi: send auth to 60:38:e0:xx:xx:xx (try 1/3) [ 1520.128702] wifi: authenticated [ 1520.133053] wifi: associate with 60:38:e0:xx:xx:xx (try 1/3) [ 1520.157807] wifi: RX AssocResp from 60:38:e0:xx:xx:xx (capab=0x431 status=0 aid=1) [ 1520.165962] wifi: associated [ 1520.176668] br-lan: port 3(wifi) entered blocking state [ 1520.182136] br-lan: port 3(wifi) entered listening state [ 1522.217602] br-lan: port 3(wifi) entered learning state Pull request with fix: https://github.com/openwrt/openwrt/pull/3443 Please grant me write access to OpenWRT, so I can contribute other important fixes in the future, such as: https://github.com/openwrt/openwrt/pull/3391 From 174bc62cf9157e06f6625ca68bb562c8c0a9ad32 Mon Sep 17 00:00:00 2001 From: Georgi Valkov Date: Sun, 20 Sep 2020 18:55:56 +0300 Subject: [PATCH] mac80211: Fixed a bug: STA disconnects frequently, because probe_send_count was not reset when ACK is received. Introduced in 317-mac80211-optimize-station-connection-monitor.patch Signed-off-by: Georgi Valkov --- ...-optimize-station-connection-monitor.patch | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/package/kernel/mac80211/patches/subsys/321-mac80211-optimize-station-connection-monitor.patch b/package/kernel/mac80211/patches/subsys/321-mac80211-optimize-station-connection-monitor.patch index ed9efb2b0d..bbf5ed0d35 100644 --- a/package/kernel/mac80211/patches/subsys/321-mac80211-optimize-station-connection-monitor.patch +++ b/package/kernel/mac80211/patches/subsys/321-mac80211-optimize-station-connection-monitor.patch @@ -46,34 +46,31 @@ Signed-off-by: Felix Fietkau static void ieee80211_reset_ap_probe(struct ieee80211_sub_if_data *sdata) { struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; -@@ -2521,21 +2504,13 @@ void ieee80211_sta_tx_notify(struct ieee +@@ -2521,13 +2504,10 @@ void ieee80211_sta_tx_notify(struct ieee { ieee80211_sta_tx_wmm_ac_notify(sdata, hdr, tx_time); - if (!ieee80211_is_data(hdr->frame_control)) - return; - -- if (ieee80211_is_any_nullfunc(hdr->frame_control) && -- sdata->u.mgd.probe_send_count > 0) { -- if (ack) + if (ieee80211_is_any_nullfunc(hdr->frame_control) && + sdata->u.mgd.probe_send_count > 0) { + if (ack) - ieee80211_sta_reset_conn_monitor(sdata); -- else -- sdata->u.mgd.nullfunc_failed = true; -- ieee80211_queue_work(&sdata->local->hw, &sdata->work); -+ if (!ieee80211_is_any_nullfunc(hdr->frame_control) || -+ !sdata->u.mgd.probe_send_count) - return; -- } ++ sdata->u.mgd.probe_send_count = 0; + else + sdata->u.mgd.nullfunc_failed = true; + ieee80211_queue_work(&sdata->local->hw, &sdata->work); +@@ -2535,7 +2515,7 @@ void ieee80211_sta_tx_notify(struct ieee + } -- if (ack) + if (ack) - ieee80211_sta_reset_conn_monitor(sdata); -+ if (!ack) -+ sdata->u.mgd.nullfunc_failed = true; -+ ieee80211_queue_work(&sdata->local->hw, &sdata->work); ++ sdata->u.mgd.probe_send_count = 0; } static void ieee80211_mlme_send_probe_req(struct ieee80211_sub_if_data *sdata, -@@ -3600,8 +3575,8 @@ static bool ieee80211_assoc_success(stru +@@ -3600,8 +3580,8 @@ static bool ieee80211_assoc_success(stru * Start timer to probe the connection to the AP now. * Also start the timer that will detect beacon loss. */ @@ -83,7 +80,7 @@ Signed-off-by: Felix Fietkau ret = true; out: -@@ -4569,10 +4544,26 @@ static void ieee80211_sta_conn_mon_timer +@@ -4569,10 +4549,26 @@ static void ieee80211_sta_conn_mon_timer from_timer(sdata, t, u.mgd.conn_mon_timer); struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_local *local = sdata->local;