From patchwork Tue Feb 19 20:25:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 10820793 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 E8FEE1399 for ; Tue, 19 Feb 2019 20:26:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D27EF2D5F2 for ; Tue, 19 Feb 2019 20:26:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C65AD2D604; Tue, 19 Feb 2019 20:26:04 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 553EB2D5FD for ; Tue, 19 Feb 2019 20:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date: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=Ebdl3vK1cUnbYTeG74jJtWHOClIE29gku4OiXW0WDSM=; b=e12pqy+K6ofFeW 1uch8Hse1qXu7fCiQr4jRKVUbDi1zct4/FEcxZW7CBVURc8vmoDuJeDwCcbWEs5n9XyztaA3t6YKm JNjxOVM+9IA9jNc7mSU7vPeaqY+EfpoS2emQAOqvQZ6FxkNET/VapZhty+kNx5u3syInxikny1Bfa nrKDkJMW6K6694jRJCY+MCOVhdtOtpyeH93t5XOAlJ71N21Gtrzqxkmq+QuWfVCcPazUZdmgreRHv HZWQNFvoYbqnkj5uNXuy5DmOIPsJRdAGwNWblWPJYA/v+Vn3tEpMVxgGiF92cfdHM7jG2pNAxUV8I R2B1QdSMAt9jOzcT1cCA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwBxp-0003iC-V7; Tue, 19 Feb 2019 20:26:01 +0000 Received: from mail-it1-x142.google.com ([2607:f8b0:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gwBxm-0003hU-Cx for ath10k@lists.infradead.org; Tue, 19 Feb 2019 20:26:00 +0000 Received: by mail-it1-x142.google.com with SMTP id m137so9389001ita.0 for ; Tue, 19 Feb 2019 12:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobcopeland-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=hgb5nBx4Dd0ae+CYh7s2ATgl1K/JojngybLrE/ijZ7k=; b=I/j+ZZpr9q/v9tE0svFM/FYNpnhT+2w2sB9EJUiBjl9BSScDkdHt+3lWvSyLXVNZSX OmYWn2gSQd7AE23jAf1FaK50lh95TnMkZa+WjbzZbhau6FPyUABj4kYntzZYQwr9rzre 7UDVytk/PFmHUdIvpCVZZIDzphacCA5gVwHnzeAAKJ1r6E8tVLWmIbWfEVyZ0/sG0niH Ewv4cFrd3nt3Sc+z+9oE+03p/u38D6CLSA5UTaBNtnimblzEOLneB8fbifOwHYm+m6fA yWIJrTX4adZqsz4dEeA2RPS7aN4UWdT/qySmuFESJ8/sNH4uoQbf/0/PaOQJN7txzMwo pbpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=hgb5nBx4Dd0ae+CYh7s2ATgl1K/JojngybLrE/ijZ7k=; b=S55zD2l/GV58ue5SCvpxf2uJv6TI5BBIxUCzKG6b3JDrFgojHLYz1au1gVIVn22ZNU BkU1R8IiYg683b/SQPQlrAspfSSOthNaA/ZcOH2QOMRuKHWCFHjNQzeakrs5l+h7qXbC I8hknzZZuP3aGtx6Qv+WBZjSfCBJPOvWIwLRXbAm83gy4ZxkIPRS58SZV202RqfmPXmg DZK2jf593l/pCGOli9R3l1englduCrrX0SSXBU4LPcRc5sVYd3HviZ0gJf68vGu1+AnJ vxlaKBoIXLlvok7Km3WNJlmTt87pLTvvxDLje2U6S+4TUZykF80xVJDbRjHYcnMg0b5W yTCA== X-Gm-Message-State: AHQUAuaoQ4H5ij2dd4dKxoJl3TSrY9SqgbLLAkoknk45qTYl2W+cqBVQ cszfsl6p9+ZE++3HGk3XB0sKG1hyvv4= X-Google-Smtp-Source: AHgI3IaXljlmdNc0cx+nhRcfUApRMP2IuyCgukzh+GXjErY+dKPAEtl2kvuoaIKpZqG7qMB9nhI4JA== X-Received: by 2002:a24:3953:: with SMTP id l80mr3611998ita.108.1550607956371; Tue, 19 Feb 2019 12:25:56 -0800 (PST) Received: from hash (CPE30b5c2fb365b-CM18593342f28f.cpe.net.cable.rogers.com. [99.232.51.173]) by smtp.gmail.com with ESMTPSA id q12sm7400317ioi.54.2019.02.19.12.25.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Feb 2019 12:25:55 -0800 (PST) Received: from bob by hash with local (Exim 4.92-RC4) (envelope-from ) id 1gwBxi-0007Q1-Ps for ath10k@lists.infradead.org; Tue, 19 Feb 2019 15:25:54 -0500 Date: Tue, 19 Feb 2019 15:25:54 -0500 From: Bob Copeland To: ath10k@lists.infradead.org Subject: [PATCH RFC] out-of-order frames Message-ID: <20190219202554.GA5065@localhost> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190219_122558_500866_7114B5D7 X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi all, I'm seeing an issue with ath10k delivering frames out of order. In encrypted networks, this is resulting in a ton of drops due to PN checks in mac80211 when some predecessor frames are dropped due to FCS fail, while later frames are processed without waiting. Some notes / observations: - This is on a 4.14.94 kernel: [ 12.454034] ath10k_pci 0000:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe [ 12.487148] ath10k_pci 0000:01:00.0: firmware ver 10.4-3.4-00104 api 5 features no-p2p,mfp,peer-flow-ctrl,btcoex-param,allows-mesh-bcast crc32 4317698a - I _very_ infrequently see the firmware indication that results in ath10k_htt_rx_addba() being called. This, despite seeing lots of successful ADDBA Request frames between the STAs captured on a third-party monitor. For example, I might see one indication, or none at all, while seeing dozens of BA sessions established on the monitor. - Because of the above, the mac80211 reorder buffer is never used (tid_rx is null). Yet ath10k evidently relies on it, e.g. this comment: /* Ignore this event because mac80211 takes care of Rx * aggregation reordering. */ - excerpt of printks showing that frame a81 is being processed after frame a85 was processed. If firmware has its own reorder buffer, it's not working: ieee80211_crypto_ccmp_decrypt: pn err: 00 00 00 00 15 e8 (q 0 seq a81 flag e8120a prev: q 0 seq a85) ieee80211_crypto_ccmp_decrypt: pn err2 00 00 00 00 16 08 [patch for those trace_printk()s: http://paste.debian.net/1069009/] - I can pretend there is a BA session when the station is added via the following hack, and it makes the issues go away (at least until mac80211 decides to end the BA session) but I'd rather not rely on this: Does this sound familiar to anyone? Is there possibly an updated firmware or software fix for this? diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 47e0cb59b948..0d8c4378db9f 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -6075,6 +6075,15 @@ static int ath10k_mac_tdls_vifs_count(struct ieee80211_hw *hw) return num_tdls_vifs; } +static void ath10k_init_ba_offload(struct ieee80211_vif *vif, + const u8 *addr) +{ + int i; + + for (i = 0; i < IEEE80211_NUM_TIDS; i++) + ieee80211_start_rx_ba_session_offl(vif, addr, i); +} + static int ath10k_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta, @@ -6163,6 +6172,8 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, goto exit; } + ath10k_init_ba_offload(vif, sta->addr); + arsta->peer_id = find_first_bit(peer->peer_ids, ATH10K_MAX_NUM_PEER_IDS);