From patchwork Fri Nov 8 19:42:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235439 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 020211515 for ; Fri, 8 Nov 2019 19:42:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE170206A3 for ; Fri, 8 Nov 2019 19:42:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="U9t4Mnim" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731283AbfKHTm0 (ORCPT ); Fri, 8 Nov 2019 14:42:26 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46156 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730685AbfKHTmZ (ORCPT ); Fri, 8 Nov 2019 14:42:25 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 4396213C2B0; Fri, 8 Nov 2019 11:42:25 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 4396213C2B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242145; bh=CWOFwbroLrpeV7aUmHEyw2QuTFO/ZM9C25Nk3YNcBdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U9t4Mnim31OuJPesUuIITcEkj8iTgVnBmak7n7yIahtF7XYRsF1GbE43OiItBKPWt L4Gj8CWQFKPANMPv6pe2uKzujDucZTCwDYH5XaOXsMUG8dSSQ9q5DOpPxOnCE31oA7 Bta/+SZPFKOeN+HIJEoY9zBs/7VBDy/ff5WMM44o= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 01/10] mac80211: Add comment about tx on monitor devs. Date: Fri, 8 Nov 2019 11:42:02 -0800 Message-Id: <20191108194210.23618-2-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108194210.23618-1-greearb@candelatech.com> References: <20191108194210.23618-1-greearb@candelatech.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear This tries to encapsulate email conversation with Johannes on this topic for posterity's sake. Signed-off-by: Ben Greear --- net/mac80211/tx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 1fa422782905..05982538c3cf 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -2277,6 +2277,12 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, * isn't always enough to find the interface to use; for proper * VLAN/WDS support we will need a different mechanism (which * likely isn't going to be monitor interfaces). + * + * I had a question about why we need to do this, and the answer + * is that old hostap used this API and expects it to work like this, + * and also monitor vdevs are not directly mapped into the driver + * (and have no chantx in my case, at least), so you cannot directly + * transmit on a monitor port anyway. */ sdata = IEEE80211_DEV_TO_SUB_IF(dev); From patchwork Fri Nov 8 19:42:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235457 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F78E1515 for ; Fri, 8 Nov 2019 19:42:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7018C206C3 for ; Fri, 8 Nov 2019 19:42:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="l4vHtLGI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732358AbfKHTmb (ORCPT ); Fri, 8 Nov 2019 14:42:31 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46158 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730720AbfKHTm0 (ORCPT ); Fri, 8 Nov 2019 14:42:26 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 73E3913C2B8; Fri, 8 Nov 2019 11:42:25 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 73E3913C2B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242145; bh=mZ1B91Q31N0eF1FTFMU7WwqKj9LBZGeMtHNrBG45SXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4vHtLGIf/+h+XmC9qB0tOFjWQ4EtrKVuXBtHSYmCFYZqxiAzi1y4eEHQAzt8X8iV mhZJw4ZW+YzqmiIXg107kXcZd8ml5ZPaC4qMxWBJJ8Vl9FJGRm2LMutjKGJELvWQG6 GeLrGfem2hfXpzXrFeqC2WuSaIZ2ftHBTW8jr8hA= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 02/10] mac80211: Change warn-on to warn-on-once Date: Fri, 8 Nov 2019 11:42:03 -0800 Message-Id: <20191108194210.23618-3-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108194210.23618-1-greearb@candelatech.com> References: <20191108194210.23618-1-greearb@candelatech.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear I saw a bunch of splats while reloading ath10k module, one splat is plenty. Signed-off-by: Ben Greear --- net/mac80211/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 0e05ff037672..670ae0cecc33 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -4553,7 +4553,7 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta, * The same happens when we're not even started, * but that's worth a warning. */ - if (WARN_ON(!local->started)) + if (WARN_ON_ONCE(!local->started)) goto drop; if (likely(!(status->flag & RX_FLAG_FAILED_PLCP_CRC))) { From patchwork Fri Nov 8 19:42:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235447 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87D991515 for ; Fri, 8 Nov 2019 19:42:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6761B206A3 for ; Fri, 8 Nov 2019 19:42:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="DptXW+4H" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732332AbfKHTm2 (ORCPT ); Fri, 8 Nov 2019 14:42:28 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46166 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730759AbfKHTm0 (ORCPT ); Fri, 8 Nov 2019 14:42:26 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id A8A5813C2B9; Fri, 8 Nov 2019 11:42:25 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com A8A5813C2B9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242145; bh=8ELRAG2n71de0dF7xggWJbz2Vlx0Mjl0IOo9finFisw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DptXW+4HMlZ3yQCRNZw6tOZCsyCEYFR5W5KbKXsZxrW+sTojG4wKux/ILPPdSemFP Azq6pMbXijLuQ4jaKCkmESwDhrDpczlh6ts/kGnTI1I/sHA/AVAFLSsNtmfXuwySHA AwqWHUJg2hFywvoGNVIql06LhHErafNNSzK/w1cs= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 03/10] mac80211: Don't spam kernel with sdata-in-driver failures. Date: Fri, 8 Nov 2019 11:42:04 -0800 Message-Id: <20191108194210.23618-4-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108194210.23618-1-greearb@candelatech.com> References: <20191108194210.23618-1-greearb@candelatech.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear Using 400 hwsim radios with 1 station on each, we see lots and lots of kernel warnings about sdata-in-driver check failures: Feb 19 17:08:22 kernel: WARNING: CPU: 0 PID: 24673 at /home/greearb/git/linux-4.2.dev.y/net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0xe7/0x166 [mac80211]() Feb 19 17:08:22 kernel: S170657910: Failed check-sdata-in-driver check, flags: 0x0 Feb 19 17:08:22 kernel: Modules linked in: nf_conntrack_netlink nf_conntrack nfnetlink wanlink(O) mac80211_hwsim nf_defrag_ipv4 mac80211 cfg80211 8021q mrp garp stp llc macvlan pktgen iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi vfat fat ipv6 ppdev pvpanic parport_pc parport 8250_fintek pcspkr joydev i2c_piix4 floppy cirrus ttm drm_kms_helper drm i2c_core [last unloaded: nfnetlink] Feb 19 17:08:22 kernel: CPU: 0 PID: 24673 Comm: iwconfig Tainted: G W O 4.2.8+ #53 Feb 19 17:08:22 kernel: Hardware name: OpenStack Foundation OpenStack Nova, BIOS Bochs 01/01/2011 Feb 19 17:08:22 kernel: 0000000000000009 ffff8800bb233b68 ffffffff81696197 0000000000000006 Feb 19 17:08:22 kernel: ffff8800bb233bb8 ffff8800bb233ba8 ffffffff810e1fb4 ffff8800bb233c68 Feb 19 17:08:22 kernel: ffffffffa02ec8f2 ffff88037424a800 0000000000040000 ffff88037424b018 Feb 19 17:08:22 kernel: Call Trace: Feb 19 17:08:22 kernel: [] dump_stack+0x4c/0x6e Feb 19 17:08:22 kernel: [] warn_slowpath_common+0x96/0xb0 Feb 19 17:08:22 kernel: [] ? ieee80211_bss_info_change_notify+0xe7/0x166 [mac80211] Feb 19 17:08:22 kernel: [] warn_slowpath_fmt+0x41/0x43 Feb 19 17:08:22 kernel: [] ieee80211_bss_info_change_notify+0xe7/0x166 [mac80211] Feb 19 17:08:22 kernel: [] ieee80211_recalc_txpower+0x28/0x2d [mac80211] Feb 19 17:08:22 kernel: [] ieee80211_set_tx_power+0x8a/0x152 [mac80211] Feb 19 17:08:22 kernel: [] cfg80211_wext_siwtxpower+0xdc/0x12b [cfg80211] Feb 19 17:08:22 kernel: [] ioctl_standard_call+0x4a/0xa3 Feb 19 17:08:22 kernel: [] ? iw_handler_get_private+0x49/0x49 Feb 19 17:08:22 kernel: [] ? call_commit_handler+0x2c/0x2c Feb 19 17:08:22 kernel: [] wireless_process_ioctl+0x6b/0x124 Feb 19 17:08:22 kernel: [] ? iw_handler_get_private+0x49/0x49 Feb 19 17:08:22 kernel: [] wext_handle_ioctl+0x64/0xa1 Feb 19 17:08:22 kernel: [] ? inode_init_always+0x109/0x1b0 Feb 19 17:08:22 kernel: [] dev_ioctl+0x5a5/0x5d6 Feb 19 17:08:22 kernel: [] ? handle_mm_fault+0xe6c/0xeb5 Feb 19 17:08:22 kernel: [] sock_ioctl+0x46/0x208 Feb 19 17:08:22 kernel: [] do_vfs_ioctl+0x372/0x420 Feb 19 17:08:22 kernel: [] ? current_kernel_time+0x9/0x2d Feb 19 17:08:22 kernel: [] ? __audit_syscall_entry+0xbc/0xde Feb 19 17:08:22 kernel: [] ? __fget_light+0x28/0x4a Feb 19 17:08:22 kernel: [] SyS_ioctl+0x55/0x7a Feb 19 17:08:22 kernel: [] entry_SYSCALL_64_fastpath+0x16/0x75 Feb 19 17:08:22 kernel: ---[ end trace d4e525588dd9d9fc ]--- Feb 19 17:08:22 kernel: cfg80211: Setting DFS Master region in update_regulatory, was: 00 unset, new: 00 unset lr: ffff8803ca63b300 regdom: ffffffffa0280f50 Instead, warn once, and then be silent after that. Signed-off-by: Ben Greear --- net/mac80211/driver-ops.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 2c9b3eb8b652..d8967cd461fe 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -19,6 +19,17 @@ static inline bool check_sdata_in_driver(struct ieee80211_sub_if_data *sdata) sdata->dev ? sdata->dev->name : sdata->name, sdata->flags); } +static inline bool _check_sdata_in_driver(struct ieee80211_sub_if_data *sdata, + bool can_warn) +{ + if (can_warn) + return !WARN(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER), + "%s: Failed check-sdata-in-driver check, flags: 0x%x\n", + sdata->dev ? sdata->dev->name : sdata->name, sdata->flags); + + return (sdata->flags & IEEE80211_SDATA_IN_DRIVER); +} + static inline struct ieee80211_sub_if_data * get_bss_sdata(struct ieee80211_sub_if_data *sdata) { @@ -153,6 +164,7 @@ static inline void drv_bss_info_changed(struct ieee80211_local *local, struct ieee80211_bss_conf *info, u32 changed) { + static int warn_once = true; might_sleep(); if (WARN_ON_ONCE(changed & (BSS_CHANGED_BEACON | @@ -170,8 +182,10 @@ static inline void drv_bss_info_changed(struct ieee80211_local *local, !(changed & BSS_CHANGED_TXPOWER)))) return; - if (!check_sdata_in_driver(sdata)) + if (!_check_sdata_in_driver(sdata, warn_once)) { + warn_once = false; return; + } trace_drv_bss_info_changed(local, sdata, info, changed); if (local->ops->bss_info_changed) From patchwork Fri Nov 8 19:42:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235453 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07ED01747 for ; Fri, 8 Nov 2019 19:42:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2632206C3 for ; Fri, 8 Nov 2019 19:42:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="MxTHki01" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731947AbfKHTm0 (ORCPT ); Fri, 8 Nov 2019 14:42:26 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46176 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730092AbfKHTm0 (ORCPT ); Fri, 8 Nov 2019 14:42:26 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id D156113C340; Fri, 8 Nov 2019 11:42:25 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com D156113C340 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242145; bh=5bXVOyMXQoclge2QBACXqbmVR/VjShxbU/QoQJ/qqgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MxTHki01V22vDIekHle8CbdEw2Y8LhgV+gpmszbc1Y5qXX04sfSrdsjw/V8hpJcGK oH659V+mJ77RXgcotAe9ivsnpXjl/Y9lwwmViB22gaIxiLqcoH2q/KvkVUxl/0FH3h otYuDZ15z1LbaksXkzPaO4o9VhYvvkbyNlGTaaM4= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 04/10] mac80211: Don't spam so loud about warned-sdata-in-driver. Date: Fri, 8 Nov 2019 11:42:05 -0800 Message-Id: <20191108194210.23618-5-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108194210.23618-1-greearb@candelatech.com> References: <20191108194210.23618-1-greearb@candelatech.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear Once per sdata is plenty, and possibly still too much. Signed-off-by: Ben Greear --- net/mac80211/driver-ops.h | 17 ++++++++++++++--- net/mac80211/ieee80211_i.h | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index d8967cd461fe..e734a85165ad 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -14,9 +14,20 @@ static inline bool check_sdata_in_driver(struct ieee80211_sub_if_data *sdata) { - return !WARN(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER), - "%s: Failed check-sdata-in-driver check, flags: 0x%x\n", - sdata->dev ? sdata->dev->name : sdata->name, sdata->flags); + if (unlikely(!(sdata->flags & IEEE80211_SDATA_IN_DRIVER))) { + if (!sdata->warned_sdata_in_driver) { + WARN(1, "%s: Failed check-sdata-in-driver check, flags: 0x%x\n", + sdata->dev ? sdata->dev->name : sdata->name, sdata->flags); + sdata->warned_sdata_in_driver = true; + } + else { + /* just print error instead of full WARN spam */ + sdata_err(sdata, "Failed check-sdata-in-driver check, flags: 0x%x\n", + sdata->flags); + } + return false; + } + return true; } static inline bool _check_sdata_in_driver(struct ieee80211_sub_if_data *sdata, diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 05406e9c05b3..5594ab80d9c1 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -932,6 +932,8 @@ struct ieee80211_sub_if_data { bool reserved_radar_required; bool reserved_ready; + bool warned_sdata_in_driver; + /* used to reconfigure hardware SM PS */ struct work_struct recalc_smps; From patchwork Fri Nov 8 19:42:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235451 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 433061747 for ; Fri, 8 Nov 2019 19:42:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2532D206C3 for ; Fri, 8 Nov 2019 19:42:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="noqZem4J" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732136AbfKHTm1 (ORCPT ); Fri, 8 Nov 2019 14:42:27 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46180 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730685AbfKHTm1 (ORCPT ); Fri, 8 Nov 2019 14:42:27 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 0814D13C341; Fri, 8 Nov 2019 11:42:26 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 0814D13C341 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242146; bh=nMvOiyU6DVG4vf3tcRO2C0Qbh2qxXH2+8qH6tp443h8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=noqZem4JUmVWxLt9cyL+pt4F9Cj5Axa/OrfeqqrLXWByyhE/PIrD0cwHXR0KgnPb0 M5BsFAIkHPRMZ6tG7nouDnLd0ozMakAO00Ty5ZI5S1m2uK7Bw8lG348OSNlFw/xLw7 0U27b0sf1Vs4/2Lz8AcKMEp5ywXOyCP+ORhm2kHM= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 05/10] mac80211: Improve connection-loss probing. Date: Fri, 8 Nov 2019 11:42:06 -0800 Message-Id: <20191108194210.23618-6-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108194210.23618-1-greearb@candelatech.com> References: <20191108194210.23618-1-greearb@candelatech.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear This makes the mlme code probe multiple times spread out across the time-out period instead of lots of probes all at once. It also makes the ap-probe and the nullfunc probe logic act similarly, which allows us to remove some code. Signed-off-by: Ben Greear --- net/mac80211/debug.h | 3 ++ net/mac80211/ieee80211_i.h | 1 - net/mac80211/mlme.c | 64 +++++++++++++++----------------------- 3 files changed, 28 insertions(+), 40 deletions(-) diff --git a/net/mac80211/debug.h b/net/mac80211/debug.h index d90a8f9cc3fd..6182608cd20f 100644 --- a/net/mac80211/debug.h +++ b/net/mac80211/debug.h @@ -194,6 +194,9 @@ do { \ _sdata_dbg(MAC80211_MLME_DEBUG, \ sdata, fmt, ##__VA_ARGS__) +#define mlme_wrn(sdata, fmt, ...) \ + _sdata_err(sdata, fmt, ##__VA_ARGS__) + #define mlme_dbg_ratelimited(sdata, fmt, ...) \ _sdata_dbg(MAC80211_MLME_DEBUG && net_ratelimit(), \ sdata, fmt, ##__VA_ARGS__) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 5594ab80d9c1..46bc9d3df591 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -444,7 +444,6 @@ struct ieee80211_if_managed { unsigned long beacon_timeout; unsigned long probe_timeout; int probe_send_count; - bool nullfunc_failed; bool connection_loss; struct cfg80211_bss *associated; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 54dd8849d1cc..6a458aac331d 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2464,8 +2464,6 @@ void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata, 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); return; } @@ -2495,6 +2493,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata) u8 *dst = ifmgd->associated->bssid; u8 unicast_limit = max(1, max_probe_tries - 3); struct sta_info *sta; + u32 max_tries; /* * Try sending broadcast probe requests for the last three @@ -2522,7 +2521,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata) } if (ieee80211_hw_check(&sdata->local->hw, REPORTS_TX_ACK_STATUS)) { - ifmgd->nullfunc_failed = false; + max_tries = max_nullfunc_tries; if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE)) ifmgd->probe_send_count--; else @@ -2530,6 +2529,8 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata) } else { int ssid_len; + max_tries = max_probe_tries; + rcu_read_lock(); ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); if (WARN_ON_ONCE(ssid == NULL)) @@ -2543,7 +2544,8 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata) rcu_read_unlock(); } - ifmgd->probe_timeout = jiffies + msecs_to_jiffies(probe_wait_ms); + ifmgd->probe_timeout = jiffies + + msecs_to_jiffies(probe_wait_ms / max_tries); run_again(sdata, ifmgd->probe_timeout); } @@ -4388,54 +4390,38 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) ifmgd->associated) { u8 bssid[ETH_ALEN]; int max_tries; + bool ack_status = ieee80211_hw_check(&local->hw, + REPORTS_TX_ACK_STATUS); memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); - if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) + if (ack_status) max_tries = max_nullfunc_tries; else max_tries = max_probe_tries; /* ACK received for nullfunc probing frame */ - if (!ifmgd->probe_send_count) + if (!ifmgd->probe_send_count) { + /* probe_send_count of zero means probe succeeded */ ieee80211_reset_ap_probe(sdata); - else if (ifmgd->nullfunc_failed) { - if (ifmgd->probe_send_count < max_tries) { - mlme_dbg(sdata, - "No ack for nullfunc frame to AP %pM, try %d/%i\n", - bssid, ifmgd->probe_send_count, - max_tries); - ieee80211_mgd_probe_ap_send(sdata); - } else { - mlme_dbg(sdata, - "No ack for nullfunc frame to AP %pM, disconnecting.\n", - bssid); - ieee80211_sta_connection_lost(sdata, bssid, - WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, - false); - } - } else if (time_is_after_jiffies(ifmgd->probe_timeout)) + } else if (time_is_after_jiffies(ifmgd->probe_timeout)) { + /* probe_timeout is after current jiffies + * Not time to (re)probe yet + */ run_again(sdata, ifmgd->probe_timeout); - else if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) { - mlme_dbg(sdata, - "Failed to send nullfunc to AP %pM after %dms, disconnecting\n", - bssid, probe_wait_ms); - ieee80211_sta_connection_lost(sdata, bssid, - WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, false); } else if (ifmgd->probe_send_count < max_tries) { - mlme_dbg(sdata, - "No probe response from AP %pM after %dms, try %d/%i\n", - bssid, probe_wait_ms, - ifmgd->probe_send_count, max_tries); + mlme_dbg(sdata, "No %s AP %pM, try %d/%i\n", + ack_status ? "ack for nullfunc frame to" : + "probe response from", + bssid, ifmgd->probe_send_count, max_tries); ieee80211_mgd_probe_ap_send(sdata); } else { - /* - * We actually lost the connection ... or did we? - * Let's make sure! - */ - mlme_dbg(sdata, - "No probe response from AP %pM after %dms, disconnecting.\n", - bssid, probe_wait_ms); + mlme_wrn(sdata, + "No %s AP %pM after %dms, tried %d/%i, disconnecting.\n", + ack_status ? "ack for nullfunc frame to" : + "probe response from", + bssid, probe_wait_ms, ifmgd->probe_send_count, + max_tries); ieee80211_sta_connection_lost(sdata, bssid, WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, false); From patchwork Fri Nov 8 19:42:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235441 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 934191864 for ; Fri, 8 Nov 2019 19:42:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73ADA206C3 for ; Fri, 8 Nov 2019 19:42:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="lMQADlGg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732087AbfKHTm0 (ORCPT ); Fri, 8 Nov 2019 14:42:26 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46176 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731422AbfKHTm0 (ORCPT ); Fri, 8 Nov 2019 14:42:26 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 42D0013C342; Fri, 8 Nov 2019 11:42:26 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 42D0013C342 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242146; bh=NV8g2arCv4enRYTpkjOzbuBqNX7QeHu72Lh1uVmAY4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lMQADlGgFZ6p+Mnq4ILUbTJC31gETgiVAt/LV7XzhuibcPFkrPARxoN9MbYyH2lBv JR9xYxDhpRZ+ejwVTyI+GSsepC7y/58lNgyabnPxp6m3Iv2MHhLr7r3UmplXlGScHS Ec7/OGO/0EfRqFs2vD1hFy8RHdEYucw7OIY9wuss= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 06/10] mac80211: Make max-auth-tries configurable as module option Date: Fri, 8 Nov 2019 11:42:07 -0800 Message-Id: <20191108194210.23618-7-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108194210.23618-1-greearb@candelatech.com> References: <20191108194210.23618-1-greearb@candelatech.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear In some cases, one might wish to have more retries before giving up on auth. For instance, ath10k 9984 radios take about 270ms to (re)calibrate when moving channels, and auth will not go out during that calibration period. I think that might be part of the issue I see with roaming stations on that radio. Signed-off-by: Ben Greear --- net/mac80211/mlme.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6a458aac331d..64336433925d 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -35,13 +35,17 @@ #define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2) #define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10) #define IEEE80211_AUTH_TIMEOUT_SAE (HZ * 2) -#define IEEE80211_AUTH_MAX_TRIES 3 #define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5) #define IEEE80211_ASSOC_TIMEOUT (HZ / 5) #define IEEE80211_ASSOC_TIMEOUT_LONG (HZ / 2) #define IEEE80211_ASSOC_TIMEOUT_SHORT (HZ / 10) #define IEEE80211_ASSOC_MAX_TRIES 3 +static int max_auth_tries = 3; +module_param(max_auth_tries, int, 0644); +MODULE_PARM_DESC(max_auth_tries, + "Maximum auth tries before giving up (default is 3)."); + static int max_nullfunc_tries = 2; module_param(max_nullfunc_tries, int, 0644); MODULE_PARM_DESC(max_nullfunc_tries, @@ -4189,9 +4193,9 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) auth_data->tries++; - if (auth_data->tries > IEEE80211_AUTH_MAX_TRIES) { - sdata_info(sdata, "authentication with %pM timed out\n", - auth_data->bss->bssid); + if (auth_data->tries > max_auth_tries) { + sdata_info(sdata, "authentication with %pM timed out after %d tries\n", + auth_data->bss->bssid, max_auth_tries); /* * Most likely AP is not in the range so remove the @@ -4210,7 +4214,7 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) sdata_info(sdata, "send auth to %pM (try %d/%d)\n", auth_data->bss->bssid, auth_data->tries, - IEEE80211_AUTH_MAX_TRIES); + max_auth_tries); auth_data->expected_transaction = 2; From patchwork Fri Nov 8 19:42:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235443 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 233741747 for ; Fri, 8 Nov 2019 19:42:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECC5C206A3 for ; Fri, 8 Nov 2019 19:42:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="EtFdXwCI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732214AbfKHTm1 (ORCPT ); Fri, 8 Nov 2019 14:42:27 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46184 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730092AbfKHTm1 (ORCPT ); Fri, 8 Nov 2019 14:42:27 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 6C16813C343; Fri, 8 Nov 2019 11:42:26 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 6C16813C343 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242146; bh=T8Eu9ww+e9qUtT2KOm46lyoa/qNUUUchUIgt8IP+Iyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EtFdXwCIID1evmH7wEbtc2nCvVifHk6friQbp+rQWEr3ClbYYOw3EWO3l5b8dgfV4 i5AjlVWSVqYl9q1gcv/+7KG642VUiN7NRr8rRg6JCau4FWCnJ6vFatCFc5LOTqEwfv h28H6UV/+A8k2zeD6dGkkd3kksx18R2vaeu7vGZw= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 07/10] mac80211: Revert some of e8e4f5, fixes setting single rate in ath10k. Date: Fri, 8 Nov 2019 11:42:08 -0800 Message-Id: <20191108194210.23618-8-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108194210.23618-1-greearb@candelatech.com> References: <20191108194210.23618-1-greearb@candelatech.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear This lets us successfully set a single rate in ath10k again. Signed-off-by: Ben Greear --- net/mac80211/cfg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 70739e746c13..41d55bd1b43a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2877,8 +2877,10 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, u32 basic_rates = sdata->vif.bss_conf.basic_rates; enum nl80211_band band = sdata->vif.bss_conf.chandef.chan->band; - if (!(mask->control[band].legacy & basic_rates)) - return -EINVAL; + if (!(mask->control[band].legacy & basic_rates)) { + pr_err("%s: WARNING: no legacy rates for band[%d] in set-bitrate-mask.\n", + sdata->dev->name, band); + } } if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) { From patchwork Fri Nov 8 19:42:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235449 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E3FF1864 for ; Fri, 8 Nov 2019 19:42:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F037206C3 for ; Fri, 8 Nov 2019 19:42:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="KmTBSzgd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732342AbfKHTm2 (ORCPT ); Fri, 8 Nov 2019 14:42:28 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46176 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732057AbfKHTm2 (ORCPT ); Fri, 8 Nov 2019 14:42:28 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 9A79F13C344; Fri, 8 Nov 2019 11:42:26 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 9A79F13C344 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242146; bh=dAfkrecoZ/4g9FfUejdYcZyZn8oAZsnLU+MkX3o2L+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KmTBSzgdf3iKFRgeMqbRSsqYCn0hJhml5bNDbt4lZim0FSZyJiDoQLI0zbpQ3/UQj eN7WlrHdTUpInhLCCwv4sEQdRdSxujgq98UjwDu9ZB0AM7RE3Ky24YOD1z+aiQH6Eh 8dvJfKNj6QSvlvlLSZGfA/qyEOA1WrZR89sWoMiM= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 08/10] mac80211: Support decrypting action frames for reinsertion into the driver. Date: Fri, 8 Nov 2019 11:42:09 -0800 Message-Id: <20191108194210.23618-9-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108194210.23618-1-greearb@candelatech.com> References: <20191108194210.23618-1-greearb@candelatech.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear Some drivers, like ath10k-ct support rxswcrypt, but the firmware needs to handle at least part of the blockack logic internally. Since firmware cannot decode the frame in rxswcrypt mode, this patch adds a way for the driver to request to be delivered the decrypted blockack action frames. The driver can then re-insert the decrypted frame for proper handling. Signed-off-by: Ben Greear --- include/net/mac80211.h | 10 ++++++++++ net/mac80211/driver-ops.c | 9 +++++++++ net/mac80211/driver-ops.h | 3 +++ net/mac80211/iface.c | 7 +++++++ 4 files changed, 29 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 523c6a09e1c8..7ea9a17c8cb8 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3752,6 +3752,14 @@ enum ieee80211_reconfig_type { * * @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep) * @abort_pmsr: abort peer measurement (this call can sleep) + * @consume_block_ack: Offer block-ack management frames back to driver to see + * if it wishes to consume it. This can be useful for when firmware wants + * to handle block-ack logic itself, but PMF is used and the firmware + * cannot actually decode the block-ack frames itself. So, firmware can + * pass the encoded block-ack up the stack, and receive it through this + * callback. If return value is zero, the mac80211 stack will not further + * process the skb. skb will be freed by calling code, so driver must + * make a copy of anything it needs in the skb before returning. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -4043,6 +4051,8 @@ struct ieee80211_ops { void (*del_nan_func)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u8 instance_id); + int (*consume_block_ack)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, struct sk_buff* skb); bool (*can_aggregate_in_amsdu)(struct ieee80211_hw *hw, struct sk_buff *head, struct sk_buff *skb); diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c index c9a8a2433e8a..aba803bd2718 100644 --- a/net/mac80211/driver-ops.c +++ b/net/mac80211/driver-ops.c @@ -49,6 +49,15 @@ void drv_stop(struct ieee80211_local *local) local->started = false; } +int drv_consume_block_ack(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) +{ + /*pr_warn("consume-block-ack: %p\n", local->ops->consume_block_ack);*/ + if (local->ops->consume_block_ack) + return local->ops->consume_block_ack(&local->hw, &sdata->vif, skb); + return -EINVAL; +} + int drv_add_interface(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata) { diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index e734a85165ad..b3cf5d88f83e 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -148,6 +148,9 @@ static inline void drv_set_wakeup(struct ieee80211_local *local, } #endif +int drv_consume_block_ack(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); + int drv_add_interface(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata); diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index af8b09214786..f050410d0986 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1249,6 +1249,11 @@ static void ieee80211_iface_work(struct work_struct *work) if (ieee80211_is_action(mgmt->frame_control) && mgmt->u.action.category == WLAN_CATEGORY_BACK) { int len = skb->len; + int barv = drv_consume_block_ack(local, sdata, skb); + + /*pr_err("called drv_consume_blockack, rv: %d\n", barv);*/ + if (barv == 0) + goto done_skb_free; mutex_lock(&local->sta_mtx); sta = sta_info_get_bss(sdata, mgmt->sa); @@ -1349,6 +1354,8 @@ static void ieee80211_iface_work(struct work_struct *work) break; } + done_skb_free: + kfree_skb(skb); } From patchwork Fri Nov 8 19:42:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235445 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56F1D1864 for ; Fri, 8 Nov 2019 19:42:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D63F206A3 for ; Fri, 8 Nov 2019 19:42:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="NmtTIL7x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732270AbfKHTm1 (ORCPT ); Fri, 8 Nov 2019 14:42:27 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46198 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731422AbfKHTm1 (ORCPT ); Fri, 8 Nov 2019 14:42:27 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id C964D13C345; Fri, 8 Nov 2019 11:42:26 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com C964D13C345 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242146; bh=9yAS5sc0FE5J2LJfFvzsHqDYBNzwes8YiVMiKrUTMzI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NmtTIL7xjY1ZqSxdomV3NWwVPn7uqRtkEH8wxqrVdOk73HPeI2DcfkeblsmBa9tOy KOj9fDJsveyoX0pRsKtgKe8kIGZu4nUPcdeowkYmR3swdoXMXywFZW8rOjdWa+1dUB DQwaC6mmi0Sb6vEB7cpqIN+6XIJIaCkyb0EwO9gE= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 09/10] mac80211: Use warn-on-once for queue mis-configuration. Date: Fri, 8 Nov 2019 11:42:10 -0800 Message-Id: <20191108194210.23618-10-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108194210.23618-1-greearb@candelatech.com> References: <20191108194210.23618-1-greearb@candelatech.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear Don't spam logs if a user manages to hit this warning. Signed-off-by: Ben Greear --- net/mac80211/util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 32a7a53833c0..21c2f439fc6a 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -387,8 +387,11 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue, trace_wake_queue(local, queue, reason); - if (WARN_ON(queue >= hw->queues)) + if (WARN_ON_ONCE(queue >= hw->queues)) { + pr_err("wake-queue, queue: %d > hw->queues: %d\n", + queue, hw->queues); return; + } if (!test_bit(reason, &local->queue_stop_reasons[queue])) return; From patchwork Fri Nov 8 19:44:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11235459 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 28E371747 for ; Fri, 8 Nov 2019 19:44:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 081FC207FA for ; Fri, 8 Nov 2019 19:44:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="aSn+mpfk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732305AbfKHToi (ORCPT ); Fri, 8 Nov 2019 14:44:38 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:46330 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729895AbfKHToi (ORCPT ); Fri, 8 Nov 2019 14:44:38 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 2EF1713C2B0; Fri, 8 Nov 2019 11:44:37 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 2EF1713C2B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1573242277; bh=r5PvEG8ppUzhu0J8qlE1UgXAyGtmFCfEQCtkjTmEro8=; h=From:To:Cc:Subject:Date:From; b=aSn+mpfkQfuQ5kgaNhdj34TS/+FLpVtf8HRkN+rRWYnFtKVy5l27mQlKLtEp1fdv1 x0CuYd2xWBJx18JW170hZY6vp4q5NbCdwYEhpi5rgjsdeMzILQaJn27gNaDbHIBKeO Dx7iYzbq/DfNb6sYltqmHv777QPX5KVhWh8DJvOQ= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Ben Greear Subject: [PATCH 10/10] mlme: Don't unlink bss on assoc timeout and similar. Date: Fri, 8 Nov 2019 11:44:33 -0800 Message-Id: <20191108194433.24021-1-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear With lots of virtual stations, we want to keep the bss entries around even if one station fails to associate for some reason. The timeouts should still get rid of truly stale ones eventually. Signed-off-by: Ben Greear --- net/mac80211/mlme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 64336433925d..240e5ff8e9df 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2691,7 +2691,7 @@ static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata) /* AP is probably out of range (or not reachable for another reason) so * remove the bss struct for that AP. */ - cfg80211_unlink_bss(local->hw.wiphy, ifmgd->associated); + //cfg80211_unlink_bss(local->hw.wiphy, ifmgd->associated); ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, @@ -4201,7 +4201,7 @@ static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) * Most likely AP is not in the range so remove the * bss struct for that AP. */ - cfg80211_unlink_bss(local->hw.wiphy, auth_data->bss); + //cfg80211_unlink_bss(local->hw.wiphy, auth_data->bss); return -ETIMEDOUT; } @@ -4267,7 +4267,7 @@ static int ieee80211_do_assoc(struct ieee80211_sub_if_data *sdata) * Most likely AP is not in the range so remove the * bss struct for that AP. */ - cfg80211_unlink_bss(local->hw.wiphy, assoc_data->bss); + //cfg80211_unlink_bss(local->hw.wiphy, assoc_data->bss); return -ETIMEDOUT; }