Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp747833ybz; Wed, 15 Apr 2020 18:05:34 -0700 (PDT) X-Google-Smtp-Source: APiQypLtnZ4xZmZQM/M8XK0UDqW6FJyI4HIhdrFfAHtIEwro9p/5cUqSBKIeNyGARmXhvaJ3mCXv X-Received: by 2002:a17:906:2558:: with SMTP id j24mr7716173ejb.72.1586999134825; Wed, 15 Apr 2020 18:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999134; cv=none; d=google.com; s=arc-20160816; b=JxWxLjsOtWtp3Tq4l8HFNT63CfoYkeJRE0qY2qBbEc+C9VctuAGK2xT4qNkXxlJh6U XGBHiNrWOwMCcsCp4dQIU6pf6V7yJzTZe2FM4dhvIiUUKriHSo3E1uJbVI3LMyt7vZBo L42sTw3eFS+6ZZdoZp9EVZ0zCdlA2iWy1Bch75GL8aJjINfjHnoH2G4lp8eQQXdgB0c3 rYgvleBc8GwC7u+YK3XrYtO9OFaaURpPWH2a1ORq6C8obB5DBRg6YgRwV3O8FUOGVwbY vjGgxjrLMfvD1gWe+2QMsqU9p/cDb1OtW/5a1fQ6Asn8LumnPAURDYxGFnfJK49Pepp2 rxEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pGUYUmn9DylHXf1GXAPNGAba+uAWk/kDQ7mnM5x6u4I=; b=z6dpknu7+Z4+8agE9Y4tCMaZR9tyGZIrJXEDxEbzIBGHE3UK51wK7sTfmMK/uglTWD DWubd+fkecGY8ZWS3MTImfqcZQo+meCX9lUNktdnKIgEywjNAVmQxDoQb495yXPCnpit /rb9GGPWk3QAP+T4rqhc1eJcVhIjf4ie8WfnWObsMEtNEXIAcLpZ7f3f+HW9r6J8zDwk CMss8go72+BH9C6+gquGnVq1s7xQCNoyh9JhF2Xn1NHzM+k6BiwYd7vCS4cH5qNQbZ3v CYdEiUWc8kNFSMEEmG9Gg+xWJlpOUtgKocTwM/MCt7UzC/SwGpjSYx3qBpqEDTDP8ebv VWeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si11467312edk.195.2020.04.15.18.05.02; Wed, 15 Apr 2020 18:05:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2636973AbgDOUcg (ORCPT + 99 others); Wed, 15 Apr 2020 16:32:36 -0400 Received: from mail.w1.fi ([212.71.239.96]:55072 "EHLO li674-96.members.linode.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2636955AbgDOUcT (ORCPT ); Wed, 15 Apr 2020 16:32:19 -0400 X-Greylist: delayed 502 seconds by postgrey-1.27 at vger.kernel.org; Wed, 15 Apr 2020 16:32:17 EDT Received: from localhost (localhost [127.0.0.1]) by li674-96.members.linode.com (Postfix) with ESMTP id 5FCA111D5F; Wed, 15 Apr 2020 20:23:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at w1.fi Received: from li674-96.members.linode.com ([127.0.0.1]) by localhost (mail.w1.fi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GdxQDhMDuwkT; Wed, 15 Apr 2020 20:23:45 +0000 (UTC) Received: by jm (sSMTP sendmail emulation); Wed, 15 Apr 2020 23:22:42 +0300 Date: Wed, 15 Apr 2020 23:22:42 +0300 From: Jouni Malinen To: Janusz Dziedzic Cc: linux-wireless , Johannes Berg Subject: Re: ath9k/mac80211 wrong hw RX filter? - tests, dpp_pkex* failed Message-ID: <20200415202242.GA12825@w1.fi> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sat, Mar 21, 2020 at 03:04:27PM +0100, Janusz Dziedzic wrote: > Just check dpp_pkex* test cases in my remote test environment (ath9k > devices) and seems by default fail: > - supplicant using remain_on_channel here > - we don't receive broadcast action frame(s) (PKEX exchange request) > - I suspect HW rx filter configuration don't work correctly here Yes, that's correct and thanks for the reminder. I had this in my queue somewhere, but never got as far as figuring out what exactly should be done to resolve this. > In case will add monitor interface to the iface that ath9k station > using, test case always pass (we receive this action frame(s) when > remain-on-channel). It does not actually need to be a monitor interface, i.e., any additional vif that is up should be sufficient.. The key point here is in getting ath9k to include ATH9K_RX_FILTER_MCAST_BCAST_ALL in the RX filter configuration. That happens if nvifs > 1 or FIF_OTHER_BSS is included (the former is based on multiple vifs and the latter is based on mesh being used). > Seems we pass this for hwsim, but I suspect we don't use hwsim filters? mac80211_hwsim does not filter out frames in the same manner as most hardware designs do on the RX path. > I see that wpa_supplicant register different action frames and finally > we configure this in mgmt_frame_register() next > ieee80211_mgmt_frame_register(). > Do we miss some functionality here (in mac80211) or this is pure ath9k bug? It's more of an undefined behavior.. DPP happens to be the first (and currently only) used of broadcast Public Action frames and it looks like number of WLAN designs filter such frames at one (or even multiple) points in the stack since there was no need to waste power in processing them. We don't currently have any means for user space to indicate that it would be nice to be able to receive broadcast Public Action frames (i.e., Management frames that are sent outside the context of an association with A1=A3=ff:ff:ff:ff:ff:ff). Since delivery of such frames to upper layers may require some designs to enable promiscuous RX behavior, this can result in undesired use of power in some devices and as such, it would be nice to be able to do this only when there is a known user for such frames (e.g., DPP listen mode enabled). That ath9k case of ATH9K_RX_FILTER_MCAST_BCAST_ALL may not be that expensive, but other drivers might need to enable full promiscuous receive and drop significantly larger number of undesired frames in mac80211 to have a noticeable impact. If we were to add that user space registration for broadcast Public Action frames, we could then handle that in mac80211 by adding a new enum ieee80211_filter_flags value (e.g., FIF_BROADCAST_PUBLIC_ACTION) and have ath9k map that to ATH9K_RX_FILTER_MCAST_BCAST_ALL. wpa_supplicant would then use this new registration mechanism based on when it expects to be able to receive DPP frames (i.e., when DPP_LISTEN is in progress). > Interesting, that 'monitor trick' doesn't work for intel-ax200. It should be noted that the frames can be dropped at other layers as well. There are WLAN firmware designs that drop these frames and make those cases work with DPP PKEX is likely going to require a firmware change.. Furthermore, the exact trick depends on the driver (that nvifs being larger then one in case of ath9k), so it is not surprising to see different behavior.. As another example, AR9170/carl9170 seems to work without any such tricks and same is the case for ath10k with firmware builds that enable this case explicitly for DPP. Anyway, it would be good to add this registration mechanism for broadcast Public Action frame RX to fix the known cases (at least ath9k and ath9k_htc) and to make this details about DPP more explicitly documented and known for others to find and address in driver or firmware design for RX filtering. -- Jouni Malinen PGP id EFC895FA