From patchwork Tue Sep 6 06:56:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 9315807 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 B059260760 for ; Tue, 6 Sep 2016 06:57:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9D1828886 for ; Tue, 6 Sep 2016 06:57:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE2E328891; Tue, 6 Sep 2016 06:57:41 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 D252728886 for ; Tue, 6 Sep 2016 06:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752848AbcIFG5h (ORCPT ); Tue, 6 Sep 2016 02:57:37 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:43452 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752345AbcIFG5g (ORCPT ); Tue, 6 Sep 2016 02:57:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1473145056; x=1504681056; h=from:to:cc:subject:date:message-id:mime-version; bh=LMEQ0YE96Gw1WIlhKoJvd5yJioIqc7o3sqaNeuSz+gQ=; b=cXkT0rzdY/rXf/eUROGx2tOX93vNEXAGMW0s7+mptVviCJPJmcccgFXE Ta9pXsY76IdhTIOzYKBLmAa1+osWIHL2mQWSBVyc6N4yyWsb4Eh6vFd6j Mw2NF99HvkvufBkmlVN86zEgwORRKOPxkt9I1zMj9zjILMI7VRzaqAvyg g=; X-IronPort-AV: E=Sophos;i="5.30,290,1470726000"; d="scan'208";a="317275964" Received: from unknown (HELO Ironmsg04-R.qualcomm.com) ([10.53.140.108]) by wolverine02.qualcomm.com with ESMTP; 05 Sep 2016 23:57:34 -0700 X-IronPort-AV: E=McAfee;i="5700,7163,8279"; a="1266791238" Received: from nasanexm01b.na.qualcomm.com ([10.85.0.82]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 05 Sep 2016 23:57:34 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM01B.na.qualcomm.com (10.85.0.82) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Mon, 5 Sep 2016 23:57:32 -0700 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 6 Sep 2016 12:27:24 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Tue, 06 Sep 2016 12:27:16 +0530 From: Rajkumar Manoharan To: CC: , , "Rajkumar Manoharan" Subject: [PATCH] mac80211: allow driver to handle packet-loss mechanism Date: Tue, 6 Sep 2016 12:26:24 +0530 Message-ID: <20160906065624.4062-1-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01b.ap.qualcomm.com (10.252.127.11) 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 mac80211 keeps track of missing acks and triggers CQM packet-loss mechanism whenever consecutive msdu failure reaches threshold limit (STA_LOST_PKT_THRESHOLD). Drivers like ath10k offlaoded rate countrol and aggregation to firmware. Such drivers have its own connection monitoring algorithm that is offloaded to firmware for triggering station kickout due to excessive tries. In VHT mode, single PPDU can have more than 50 msdus at higher rates. Under noisy environment, single ppdu failure can cause station kickout by current mac80211 lost_packet mechanism while firmware is trying to adapt its rate table. This is causing frequent connect and disconnect iteration when station is roaming around. In such scenario, driver (or firmware) is not given enough chance to tune its rate control. So for devices that report low ack events, add a hardware flag to rely on their mechnism. Signed-off-by: Rajkumar Manoharan --- include/net/mac80211.h | 5 +++++ net/mac80211/debugfs.c | 1 + net/mac80211/status.c | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index cca510a585c3..6619fa1ccd01 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -2014,6 +2014,10 @@ struct ieee80211_txq { * @IEEE80211_HW_TX_FRAG_LIST: Hardware (or driver) supports sending frag_list * skbs, needed for zero-copy software A-MSDU. * + * @IEEE80211_HW_REPORTS_LOW_ACK: The driver (or firmware) reports low ack event + * based on its own algorithm. For such devices, mac80211 does not report + * low ack event based on lost packets. + * * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { @@ -2054,6 +2058,7 @@ enum ieee80211_hw_flags { IEEE80211_HW_USES_RSS, IEEE80211_HW_TX_AMSDU, IEEE80211_HW_TX_FRAG_LIST, + IEEE80211_HW_REPORTS_LOW_ACK, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index 2906c1004e1a..e433319a67f1 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -302,6 +302,7 @@ static const char *hw_flag_names[] = { FLAG(USES_RSS), FLAG(TX_AMSDU), FLAG(TX_FRAG_LIST), + FLAG(REPORTS_LOW_ACK), #undef FLAG }; diff --git a/net/mac80211/status.c b/net/mac80211/status.c index fabd9ff710d9..6121ed196630 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -557,6 +557,12 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local, static void ieee80211_lost_packet(struct sta_info *sta, struct ieee80211_tx_info *info) { + /* Driver supports its own algorithm for triggering CQM packet-loss + * mechanism. + */ + if (ieee80211_hw_check(&sta->local->hw, REPORTS_LOW_ACK)) + return; + /* This packet was aggregated but doesn't carry status info */ if ((info->flags & IEEE80211_TX_CTL_AMPDU) && !(info->flags & IEEE80211_TX_STAT_AMPDU))