From patchwork Fri Nov 2 20:49:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10666101 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2A4C13B5 for ; Fri, 2 Nov 2018 20:50:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D46B42BF0A for ; Fri, 2 Nov 2018 20:50:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C90092BF11; Fri, 2 Nov 2018 20:50:11 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 154972BF14 for ; Fri, 2 Nov 2018 20:50:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726914AbeKCF6s (ORCPT ); Sat, 3 Nov 2018 01:58:48 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33445 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbeKCF6r (ORCPT ); Sat, 3 Nov 2018 01:58:47 -0400 Received: by mail-wr1-f66.google.com with SMTP id u1-v6so3271230wrn.0 for ; Fri, 02 Nov 2018 13:50:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XgsV9q+VqEHbvYsNWaC9/lJ9VUj/M+M+nCXzSkOzviI=; b=BzvWP7CW6rnQilsGGlfXOxBMHw0JjHlxhlr5pH84jRg9Lvx27WSKChRAEF+O4fAfvT feqiw7dG3YwvA51mIgpMuVkpzu5PBXimZSJO8ro3kGTDaG97rInN0CG0Ltl6VLlDZkg9 nNOxyq204kNEGmAAxlw3MRJ6iK8awp6B1WgJCd6yI50jOsZ60Ifa2GO5OZs+fBUJo7YI Y/3iSIFSxMMcdS9D82SgucD4RGo9IVL409M4X9imsg/G1p16TwsOXXS98aHNJJB+Zgr4 4oR6t7C+rAAtNtLD5RKtQ82dF7o2tBBXQXwIbEQJRpcT0Au2yG8lgEWvMEAFOy0XFVtY NFGQ== X-Gm-Message-State: AGRZ1gJr0AY5iEFFHQV2w3tOn64JalG5j+sA0Ot55eqYvwmMz1jXXb/h tvwCGJTW2kunJ7Q+EK36o01K3rkNQsc= X-Google-Smtp-Source: AJdET5c2Iw3pVdy/xUJpz3fPuGpsBhKZ0uPm97cTM/YfF1WfKeKpGz6CxT/mdiAsnncIck/kYvZhww== X-Received: by 2002:adf:ea12:: with SMTP id q18-v6mr11949967wrm.224.1541191808031; Fri, 02 Nov 2018 13:50:08 -0700 (PDT) Received: from localhost.localdomain ([151.66.16.197]) by smtp.gmail.com with ESMTPSA id c14-v6sm28349450wmh.44.2018.11.02.13.50.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 13:50:07 -0700 (PDT) From: Lorenzo Bianconi To: linux-wireless@vger.kernel.org Cc: koen.vandeputte@ncentric.com Subject: [PATCH 1/5] ath9k: dynack: use authentication messages for 'late' ack Date: Fri, 2 Nov 2018 21:49:55 +0100 Message-Id: <9ec0b086cfa7199bf7bc70d3118e9f835808b907.1541190974.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 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 In order to properly support dynack in ad-hoc mode running wpa_supplicant, take into account authentication frames for 'late ack' detection. This patch has been tested on devices mounted on offshore high-voltage stations connected through ~24Km link Reported-by: Koen Vandeputte Tested-by: Koen Vandeputte Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/ath/ath9k/dynack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c index 7334c9b09e82..cc0dc966c512 100644 --- a/drivers/net/wireless/ath/ath9k/dynack.c +++ b/drivers/net/wireless/ath/ath9k/dynack.c @@ -187,7 +187,8 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, /* late ACK */ if (ts->ts_status & ATH9K_TXERR_XRETRY) { if (ieee80211_is_assoc_req(hdr->frame_control) || - ieee80211_is_assoc_resp(hdr->frame_control)) { + ieee80211_is_assoc_resp(hdr->frame_control) || + ieee80211_is_auth(hdr->frame_control)) { ath_dbg(common, DYNACK, "late ack\n"); ath9k_hw_setslottime(ah, (LATEACK_TO - 3) / 2); ath9k_hw_set_ack_timeout(ah, LATEACK_TO); From patchwork Fri Nov 2 20:49:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10666103 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3A1314E2 for ; Fri, 2 Nov 2018 20:50:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94FD02BF14 for ; Fri, 2 Nov 2018 20:50:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 893B02BF2D; Fri, 2 Nov 2018 20:50:13 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 11D952BF14 for ; Fri, 2 Nov 2018 20:50:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727764AbeKCF6u (ORCPT ); Sat, 3 Nov 2018 01:58:50 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46183 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbeKCF6t (ORCPT ); Sat, 3 Nov 2018 01:58:49 -0400 Received: by mail-wr1-f68.google.com with SMTP id 74-v6so3226783wrb.13 for ; Fri, 02 Nov 2018 13:50:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u+mRUYfHTmGEjJLH9LCjuQm4BHNuLbn/kuaAbqu4TZw=; b=PVRYiNeW5rnH40wPl+g7I/iWW1vu7voHPBzSIVmZTcEprBmMswU1Ycr4T66TN6jYM2 n6bxS4teMyl8KxYPcY1rugCUac56Mle7YEvO8ofhHSwGzFVNStT7mmYuG8WUdXzNrTl/ znzX758Z81k9vH4Z0F/Wx0xtcjb0z/YThE2kdRdoUYuwK0hAgLqfxmby15BG5J05ktT+ M4CJaMwdqTJy0KHHy/mkya/qOjaPS5MZxX6UyEpLRHo3UGzJaRF/jdWjaviT39P9jbtS ap5NpnIRqcNp9T/bUqrIQAiLbQgCZmkxzVn2U5RvVz61B872E0DSvOA7tatl6AkPCkjr +WxQ== X-Gm-Message-State: AGRZ1gJQXsC7J+BJSC5Y+/XPflT1FSe0SOhURyNAKPX5//eMX92i4h1C 8N3yM3TPoE5S6+hUfSpv65K3qFkOEWo= X-Google-Smtp-Source: AJdET5f7+z7WwojujuJJ6jZDGUaVyvkfNIVb8pIt/VTjL0jlkBC1Qo61x5ZfHzG9Sibt2jnKbzsVsw== X-Received: by 2002:a5d:618c:: with SMTP id j12-v6mr3644149wru.300.1541191809692; Fri, 02 Nov 2018 13:50:09 -0700 (PDT) Received: from localhost.localdomain ([151.66.16.197]) by smtp.gmail.com with ESMTPSA id c14-v6sm28349450wmh.44.2018.11.02.13.50.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 13:50:09 -0700 (PDT) From: Lorenzo Bianconi To: linux-wireless@vger.kernel.org Cc: koen.vandeputte@ncentric.com Subject: [PATCH 2/5] ath9k: dynack: move debug log after buffer increments Date: Fri, 2 Nov 2018 21:49:56 +0100 Message-Id: <0b8fb1254282d676cee3e5896755f56067502f68.1541190974.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 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 Move debug log in ath_dynack_sample_tx_ts and ath_dynack_sample_ack_ts after timestamp buffer head/tail increments in order to make debugging more user friendly Tested-by: Koen Vandeputte Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/ath/ath9k/dynack.c | 26 ++++++++++++------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c index cc0dc966c512..5c969d833825 100644 --- a/drivers/net/wireless/ath/ath9k/dynack.c +++ b/drivers/net/wireless/ath/ath9k/dynack.c @@ -171,11 +171,12 @@ static void ath_dynack_compute_to(struct ath_hw *ah) void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, struct ath_tx_status *ts) { - u8 ridx; struct ieee80211_hdr *hdr; struct ath_dynack *da = &ah->dynack; struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + u32 dur = ts->duration; + u8 ridx; if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !da->enabled) return; @@ -203,14 +204,13 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, ridx = ts->ts_rateindex; da->st_rbf.ts[da->st_rbf.t_rb].tstamp = ts->ts_tstamp; - da->st_rbf.ts[da->st_rbf.t_rb].dur = ts->duration; ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_dest, hdr->addr1); ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_src, hdr->addr2); if (!(info->status.rates[ridx].flags & IEEE80211_TX_RC_MCS)) { - u32 phy, sifs; const struct ieee80211_rate *rate; struct ieee80211_tx_rate *rates = info->status.rates; + u32 phy; rate = &common->sbands[info->band].bitrates[rates[ridx].idx]; if (info->band == NL80211_BAND_2GHZ && @@ -219,19 +219,18 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, else phy = WLAN_RC_PHY_OFDM; - sifs = ath_dynack_get_sifs(ah, phy); - da->st_rbf.ts[da->st_rbf.t_rb].dur -= sifs; + dur -= ath_dynack_get_sifs(ah, phy); } - - ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n", - hdr->addr1, da->st_rbf.ts[da->st_rbf.t_rb].tstamp, - da->st_rbf.ts[da->st_rbf.t_rb].dur, da->st_rbf.h_rb, - (da->st_rbf.t_rb + 1) % ATH_DYN_BUF); + da->st_rbf.ts[da->st_rbf.t_rb].dur = dur; INCR(da->st_rbf.t_rb, ATH_DYN_BUF); if (da->st_rbf.t_rb == da->st_rbf.h_rb) INCR(da->st_rbf.h_rb, ATH_DYN_BUF); + ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n", + hdr->addr1, ts->ts_tstamp, dur, da->st_rbf.h_rb, + da->st_rbf.t_rb); + ath_dynack_compute_to(ah); spin_unlock_bh(&da->qlock); @@ -258,14 +257,13 @@ void ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb, spin_lock_bh(&da->qlock); da->ack_rbf.tstamp[da->ack_rbf.t_rb] = ts; - ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n", - da->ack_rbf.tstamp[da->ack_rbf.t_rb], - da->ack_rbf.h_rb, (da->ack_rbf.t_rb + 1) % ATH_DYN_BUF); - INCR(da->ack_rbf.t_rb, ATH_DYN_BUF); if (da->ack_rbf.t_rb == da->ack_rbf.h_rb) INCR(da->ack_rbf.h_rb, ATH_DYN_BUF); + ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n", + ts, da->ack_rbf.h_rb, da->ack_rbf.t_rb); + ath_dynack_compute_to(ah); spin_unlock_bh(&da->qlock); From patchwork Fri Nov 2 20:49:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10666105 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF2C914E2 for ; Fri, 2 Nov 2018 20:50:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1A492BF14 for ; Fri, 2 Nov 2018 20:50:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B60632BF75; Fri, 2 Nov 2018 20:50:14 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 547EF2BF14 for ; Fri, 2 Nov 2018 20:50:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728028AbeKCF6v (ORCPT ); Sat, 3 Nov 2018 01:58:51 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43181 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbeKCF6u (ORCPT ); Sat, 3 Nov 2018 01:58:50 -0400 Received: by mail-wr1-f68.google.com with SMTP id y3-v6so2943206wrh.10 for ; Fri, 02 Nov 2018 13:50:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ki2MvgubDdmFLQ/wk8y7i7JzQd4R4VZrQ63JkrFRQQw=; b=BUGSacGWuj5wLdbfjoRDHnVxrOXmhzAmIxu1DgyThW0aM7ZzNIS/kTwkTVycYy3Ne3 Bl4Z8DkVJGEFkzfYHg+mMJYt1bPoMatMPR86lHXBkdrHBLCmeWcQF6wKydXHkBzBpZG5 5g8fGoxIsjteRXksGKjYZCPtYwoqHD35sPoCy6EmIgrTulMM4AlE/nr8/ZgjRhHSE5C+ K7jixI5YPmshz7nluCqpRwS9v1TrhYixwmrMrhbVdivIfNLT7Me8LWtA9L1i0Yv4fpLO nhqTXxXoOHfunePuVvIKKzLHVeY5TlkJ542iXvD90KhkLY58SbfXaxurmW8jqJBKx8up 2qmQ== X-Gm-Message-State: AGRZ1gL7YKricDDFh6k2kEvIrTeEaieNKpgVOEx85mujGcbsuh8o3890 Fuk+29UyriZU4nQzOmbIffPA++Vnx9A= X-Google-Smtp-Source: AJdET5e/y6cHwu+WFhwBnw2S495yJidcJONJhrXQoRWPeyW/G2TWwvUYLkM3pQlG/2j+nJGCYKoh5Q== X-Received: by 2002:adf:e808:: with SMTP id o8-v6mr11520183wrm.112.1541191810974; Fri, 02 Nov 2018 13:50:10 -0700 (PDT) Received: from localhost.localdomain ([151.66.16.197]) by smtp.gmail.com with ESMTPSA id c14-v6sm28349450wmh.44.2018.11.02.13.50.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 13:50:10 -0700 (PDT) From: Lorenzo Bianconi To: linux-wireless@vger.kernel.org Cc: koen.vandeputte@ncentric.com Subject: [PATCH 3/5] ath9k: dynack: check da->enabled first in sampling routines Date: Fri, 2 Nov 2018 21:49:57 +0100 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 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 Check da->enabled flag first in ath_dynack_sample_tx_ts and ath_dynack_sample_ack_ts routines in order to avoid useless processing Tested-by: Koen Vandeputte Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/ath/ath9k/dynack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c index 5c969d833825..5c3b32f4e61b 100644 --- a/drivers/net/wireless/ath/ath9k/dynack.c +++ b/drivers/net/wireless/ath/ath9k/dynack.c @@ -178,7 +178,7 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, u32 dur = ts->duration; u8 ridx; - if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !da->enabled) + if (!da->enabled || (info->flags & IEEE80211_TX_CTL_NO_ACK)) return; spin_lock_bh(&da->qlock); @@ -251,7 +251,7 @@ void ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb, struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; - if (!ath_dynack_bssidmask(ah, hdr->addr1) || !da->enabled) + if (!da->enabled || !ath_dynack_bssidmask(ah, hdr->addr1)) return; spin_lock_bh(&da->qlock); From patchwork Fri Nov 2 20:49:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10666107 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BAE7213B5 for ; Fri, 2 Nov 2018 20:50:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABA592BF14 for ; Fri, 2 Nov 2018 20:50:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A02032BF75; Fri, 2 Nov 2018 20:50:16 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 258272BF14 for ; Fri, 2 Nov 2018 20:50:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728196AbeKCF6x (ORCPT ); Sat, 3 Nov 2018 01:58:53 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44398 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726948AbeKCF6x (ORCPT ); Sat, 3 Nov 2018 01:58:53 -0400 Received: by mail-wr1-f66.google.com with SMTP id d17-v6so3228356wre.11 for ; Fri, 02 Nov 2018 13:50:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zy4QVWunOdnJPJP/XCwwmcC2YCWo97QjZPUn++7SWrs=; b=r808MuSL6kpO9lN4wnVn7nReJoIdEz98EstQzFXvZE/Mq2L8B0nYTd3IDUTlB/kmhs KOIwk/yTFz5cqLS3mN8gLkbvlIQA3gz9CaWjdRiZpKbNlys2pupBppNM8jK5GzLC4SWE 6IbqQzCtxmIEJElLM3hWwoxV/Z31FIf8RR18xAP0hTQ1VO+XktrOJ031cjYcxt7DCl39 6YnxWQJG3GVMlDKo+dnmynPPTk1SiOFwH3NyJcddyo5wotpe7jYuns/OUYYRLXGZDBkD HDPQlOwOvux042n9J+B+mXtSaa4oNvRmz2zuE7qdD3UiPUPnib+gkKHTjPZwkKs8xFfB 4RbA== X-Gm-Message-State: AGRZ1gJWzqQ3AeOt0Gt8sNvvbZiu85TeHtJVxYM8+myFMxAncMouwwTj D1AwpkxCTlLpHSIKV29q4oe8PwVhaYY= X-Google-Smtp-Source: AJdET5eaeluMmsCxlX3p1DHhyCFq5tysBKM93nxrx3S26JvNyHZXFcr6vY9bcrWJZD+dqLzxj/KlPQ== X-Received: by 2002:adf:fa92:: with SMTP id h18-v6mr11336643wrr.74.1541191812682; Fri, 02 Nov 2018 13:50:12 -0700 (PDT) Received: from localhost.localdomain ([151.66.16.197]) by smtp.gmail.com with ESMTPSA id c14-v6sm28349450wmh.44.2018.11.02.13.50.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 13:50:12 -0700 (PDT) From: Lorenzo Bianconi To: linux-wireless@vger.kernel.org Cc: koen.vandeputte@ncentric.com Subject: [PATCH 4/5] ath9k: dynack: make ewma estimation faster Date: Fri, 2 Nov 2018 21:49:58 +0100 Message-Id: <106e87937eaa44339db58548614a0e97e833d5b2.1541190974.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 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 In order to make propagation time estimation faster, use current sample as ewma output value during 'late ack' tracking Tested-by: Koen Vandeputte Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/ath/ath9k/ath9k.h | 2 +- drivers/net/wireless/ath/ath9k/dynack.c | 28 ++++++++++++++++++------- drivers/net/wireless/ath/ath9k/dynack.h | 6 ++++-- drivers/net/wireless/ath/ath9k/xmit.c | 5 +++-- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 21ba20981a80..0fca44e91a71 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -272,7 +272,7 @@ struct ath_node { #endif u8 key_idx[4]; - u32 ackto; + int ackto; struct list_head list; }; diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c index 5c3b32f4e61b..f112fa5b2eac 100644 --- a/drivers/net/wireless/ath/ath9k/dynack.c +++ b/drivers/net/wireless/ath/ath9k/dynack.c @@ -29,9 +29,13 @@ * ath_dynack_ewma - EWMA (Exponentially Weighted Moving Average) calculation * */ -static inline u32 ath_dynack_ewma(u32 old, u32 new) +static inline int ath_dynack_ewma(int old, int new) { - return (new * (EWMA_DIV - EWMA_LEVEL) + old * EWMA_LEVEL) / EWMA_DIV; + if (old > 0) + return (new * (EWMA_DIV - EWMA_LEVEL) + + old * EWMA_LEVEL) / EWMA_DIV; + else + return new; } /** @@ -82,10 +86,10 @@ static inline bool ath_dynack_bssidmask(struct ath_hw *ah, const u8 *mac) */ static void ath_dynack_compute_ackto(struct ath_hw *ah) { - struct ath_node *an; - u32 to = 0; - struct ath_dynack *da = &ah->dynack; struct ath_common *common = ath9k_hw_common(ah); + struct ath_dynack *da = &ah->dynack; + struct ath_node *an; + int to = 0; list_for_each_entry(an, &da->nodes, list) if (an->ackto > to) @@ -144,7 +148,8 @@ static void ath_dynack_compute_to(struct ath_hw *ah) an->ackto = ath_dynack_ewma(an->ackto, ackto); ath_dbg(ath9k_hw_common(ah), DYNACK, - "%pM to %u\n", dst, an->ackto); + "%pM to %d [%u]\n", dst, + an->ackto, ackto); if (time_is_before_jiffies(da->lto)) { ath_dynack_compute_ackto(ah); da->lto = jiffies + COMPUTE_TO; @@ -166,10 +171,12 @@ static void ath_dynack_compute_to(struct ath_hw *ah) * @ah: ath hw * @skb: socket buffer * @ts: tx status info + * @sta: station pointer * */ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, - struct ath_tx_status *ts) + struct ath_tx_status *ts, + struct ieee80211_sta *sta) { struct ieee80211_hdr *hdr; struct ath_dynack *da = &ah->dynack; @@ -191,9 +198,16 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, ieee80211_is_assoc_resp(hdr->frame_control) || ieee80211_is_auth(hdr->frame_control)) { ath_dbg(common, DYNACK, "late ack\n"); + ath9k_hw_setslottime(ah, (LATEACK_TO - 3) / 2); ath9k_hw_set_ack_timeout(ah, LATEACK_TO); ath9k_hw_set_cts_timeout(ah, LATEACK_TO); + if (sta) { + struct ath_node *an; + + an = (struct ath_node *)sta->drv_priv; + an->ackto = -1; + } da->lto = jiffies + LATEACK_DELAY; } diff --git a/drivers/net/wireless/ath/ath9k/dynack.h b/drivers/net/wireless/ath/ath9k/dynack.h index 6d7bef976742..cf60224d40df 100644 --- a/drivers/net/wireless/ath/ath9k/dynack.h +++ b/drivers/net/wireless/ath/ath9k/dynack.h @@ -86,7 +86,8 @@ void ath_dynack_node_deinit(struct ath_hw *ah, struct ath_node *an); void ath_dynack_init(struct ath_hw *ah); void ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb, u32 ts); void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, - struct ath_tx_status *ts); + struct ath_tx_status *ts, + struct ieee80211_sta *sta); #else static inline void ath_dynack_init(struct ath_hw *ah) {} static inline void ath_dynack_node_init(struct ath_hw *ah, @@ -97,7 +98,8 @@ static inline void ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb, u32 ts) {} static inline void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, - struct ath_tx_status *ts) {} + struct ath_tx_status *ts, + struct ieee80211_sta *sta) {} #endif #endif /* DYNACK_H */ diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 25b3fc82d4ac..f448d5716639 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -629,7 +629,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, if (bf == bf->bf_lastbf) ath_dynack_sample_tx_ts(sc->sc_ah, bf->bf_mpdu, - ts); + ts, sta); } ath_tx_complete_buf(sc, bf, txq, &bf_head, sta, ts, @@ -773,7 +773,8 @@ static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, memcpy(info->control.rates, bf->rates, sizeof(info->control.rates)); ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok); - ath_dynack_sample_tx_ts(sc->sc_ah, bf->bf_mpdu, ts); + ath_dynack_sample_tx_ts(sc->sc_ah, bf->bf_mpdu, ts, + sta); } ath_tx_complete_buf(sc, bf, txq, bf_head, sta, ts, txok); } else From patchwork Fri Nov 2 20:49:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10666109 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A02B513B5 for ; Fri, 2 Nov 2018 20:50:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92FF12BF14 for ; Fri, 2 Nov 2018 20:50:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 879462BF75; Fri, 2 Nov 2018 20:50:17 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 4091D2BF14 for ; Fri, 2 Nov 2018 20:50:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728198AbeKCF6y (ORCPT ); Sat, 3 Nov 2018 01:58:54 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37015 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728184AbeKCF6x (ORCPT ); Sat, 3 Nov 2018 01:58:53 -0400 Received: by mail-wr1-f65.google.com with SMTP id z3-v6so3261280wru.4 for ; Fri, 02 Nov 2018 13:50:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oWHr0wwXRasiyzF8nzJYbCrk6mWK3KDKMBJNra/6ZZs=; b=gi+6yDycuP3C+6Kl2cx5vfj65igbOrVxQkr3cGYi+WccvgeXJw6LATh5la1R97FkE7 D7/TBqlZxM/2jnZABNUQwPSc6cjWkUm0zBBqDObbUMceTOSpfCNyU6XOodYyDPPp31Yb UKB+00ZFTj2jUQX9cNfiaRhCptXZcDv5PrJdNzpVBMpXyqxTkm+c8IK5afYKTsWUnHG9 1YBaFbOzX8yDy/b7ccagfgLWoL5GhkIGKGAQSglnkxBlUK969vTifqDNottVEUtjGhmL ZV5Gvt+4uVTkdrDM8qhg88WFxV49QLQeTCJdqvVwqgRFXh3bNa3gf+hBe5zOh+5T03TM 7EPw== X-Gm-Message-State: AGRZ1gJDy/QZkGVvYiGMHdJ//ivSz3Q0y1or3UoOXwjFh7u4iJK4s5KI pIToFy6+gbkm1cU7v26yOz9OLzExTJU= X-Google-Smtp-Source: AJdET5cyspBvYJxOj4o8kw2ufvgMZr7WOm8veMA9Ij/hJc2HRHvfUWBUDYtQUU+0e4DVYFzR3s9LRw== X-Received: by 2002:adf:f941:: with SMTP id q1-v6mr11072286wrr.151.1541191814062; Fri, 02 Nov 2018 13:50:14 -0700 (PDT) Received: from localhost.localdomain ([151.66.16.197]) by smtp.gmail.com with ESMTPSA id c14-v6sm28349450wmh.44.2018.11.02.13.50.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 13:50:13 -0700 (PDT) From: Lorenzo Bianconi To: linux-wireless@vger.kernel.org Cc: koen.vandeputte@ncentric.com Subject: [PATCH 5/5] ath9k: dynack: remove 'experimental' tag Date: Fri, 2 Nov 2018 21:49:59 +0100 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 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 Remove experimental tag from dynack Kconfig entry since it has been tested on outdoor 25Km links Tested-by: Koen Vandeputte Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/ath/ath9k/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/Kconfig b/drivers/net/wireless/ath/ath9k/Kconfig index 1f3523019509..ceca23a851d5 100644 --- a/drivers/net/wireless/ath/ath9k/Kconfig +++ b/drivers/net/wireless/ath/ath9k/Kconfig @@ -116,7 +116,7 @@ config ATH9K_DFS_CERTIFIED except increase code size. config ATH9K_DYNACK - bool "Atheros ath9k ACK timeout estimation algorithm (EXPERIMENTAL)" + bool "Atheros ath9k ACK timeout estimation algorithm" depends on ATH9K default n ---help---