Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1753749rwb; Mon, 7 Nov 2022 05:30:54 -0800 (PST) X-Google-Smtp-Source: AMsMyM78KHw9HH2WeUaKzeLqNTsX9iBcFydzXSs3bMlT+S9u837NkOcmlj2LwFd8J+gkTQgQBOoW X-Received: by 2002:a17:902:d2c9:b0:186:f355:a42b with SMTP id n9-20020a170902d2c900b00186f355a42bmr49898482plc.58.1667827854563; Mon, 07 Nov 2022 05:30:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667827854; cv=none; d=google.com; s=arc-20160816; b=ZfeKWnXzPAd+C947LClONM2FvDXbuwxBB4CsvD5pOTWKCxlP915Zi/QYnYSQbYC3dN Je6I802pPkZE2fKODzdzQABB83uii8SMhcTk7cGpRMXP0CelHPziggKMqIb2TJ9MO5IC cGzEPRfUmWHRVkZ5Y1o2DhG+BfoyoMpRuoLB0jXE5DgDHEdTR7STDPnLUxEvZA4+wPWi fjnQmiCnxDpa8iRc16eklNFvsngszrPr33pXMwZMnyBSdG6yCMuPBQakxD1m1fq02U5v 5EwMEawxVBcg69MrI9d0J0racvt39lBvAEIufstmneJnlMCvs1YyN3RL5F41L4ZmPmB4 0n/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=19vCZvvBbxjS3Fq5qZKJPYVrjmqsYj9fRLwd0evsl/g=; b=eVKnzvDABnAy91JtBF3ltmsB74it64OluARfQ2voG1e4matVoKYnPQhs2Wkt3GF6ar a6Kpp4XT/qKQtGx887prxehD/9SY5K0PunuzWLQx85rJ9MMJhh990AgyNn/qaPgx8/yu I9anqmlJicHEaii2ya3kedky4CRVEp2Z6tPzpm1iZnWWuecQq1W5MhD0jQC7Z849fIRt 6heGV5CSBb1oakeWMyIQylL2lwAPb3WpW61sOyrts3+BUkuN89WLvd35SYbhFaGhQimM lC1uRinnmJxnP6lwm6Xrbv7oOsJj7xkAtC2FfnZbY4EVmDKBhq3KGloHbbtMXPv78VQQ tqiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b="t/en2HQ3"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020aa78884000000b0053837d7cf84si11449703pfe.254.2022.11.07.05.30.42; Mon, 07 Nov 2022 05:30:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b="t/en2HQ3"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231896AbiKGNXo (ORCPT + 67 others); Mon, 7 Nov 2022 08:23:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231433AbiKGNXn (ORCPT ); Mon, 7 Nov 2022 08:23:43 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85F75DBE; Mon, 7 Nov 2022 05:23:41 -0800 (PST) Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 59A2984DC3; Mon, 7 Nov 2022 14:23:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667827419; bh=19vCZvvBbxjS3Fq5qZKJPYVrjmqsYj9fRLwd0evsl/g=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=t/en2HQ36AFkVbax2zWG1g+Ktci1IA8vh7Eah9tgsZ3dAo7P9kFVUpLBuIPuyhfvq S/JjG1DtPErLkOeSyah+5FLHB8FpqJxcYAupa/BzMufmxx+cLZH2vDUqZQ5ZqhodEU 3blshWZyR9BM7hA1gMUHsYqr/ujIvtRxxUXGYOdNnmAySU8uhYY6mDXcrU6f2FJ40R J8vW3w/eCEYiZaiQ0oBpzb4jGb4Wwuwp2ITlFLnPAJZZMKKKraYEdeGqV81o+KhUBr BKJIbfvnt4kg6eCVrk+jUD87Q3TLuRnBfmzNINheIFK8pMPtpsAPFbrfCxUw3Ls0gS uKw+aSfnsX2QA== Message-ID: <7a3b6d5c-1d73-1d31-434f-00703c250dd6@denx.de> Date: Mon, 7 Nov 2022 14:23:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v5] wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port Content-Language: en-US To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Angus Ainslie , Jakub Kicinski , Johannes Berg , Martin Fuzzey , Martin Kepplinger , Prameela Rani Garnepudi , Sebastian Krzyszkowiak , Siva Rebbagondla , netdev@vger.kernel.org References: <20221104163339.227432-1-marex@denx.de> <87o7tjszyg.fsf@kernel.org> From: Marek Vasut In-Reply-To: <87o7tjszyg.fsf@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 11/7/22 13:37, Kalle Valo wrote: > Marek Vasut writes: > >> When using wpa_supplicant v2.10, this driver is no longer able to >> associate with any AP and fails in the EAPOL 4-way handshake while >> sending the 2/4 message to the AP. The problem is not present in >> wpa_supplicant v2.9 or older. The problem stems from HostAP commit >> 144314eaa ("wpa_supplicant: Send EAPOL frames over nl80211 where available") >> which changes the way EAPOL frames are sent, from them being send >> at L2 frames to them being sent via nl80211 control port. >> >> An EAPOL frame sent as L2 frame is passed to the WiFi driver with >> skb->protocol ETH_P_PAE, while EAPOL frame sent via nl80211 control >> port has skb->protocol set to ETH_P_802_3 . The later happens in >> ieee80211_tx_control_port(), where the EAPOL frame is encapsulated >> into 802.3 frame. >> >> The rsi_91x driver handles ETH_P_PAE EAPOL frames as high-priority >> frames and sends them via highest-priority transmit queue, while >> the ETH_P_802_3 frames are sent as regular frames. The EAPOL 4-way >> handshake frames must be sent as highest-priority, otherwise the >> 4-way handshake times out. >> >> Therefore, to fix this problem, inspect the skb control flags and >> if flag IEEE80211_TX_CTRL_PORT_CTRL_PROTO is set, assume this is >> an EAPOL frame and transmit the frame via high-priority queue just >> like other ETH_P_PAE frames. >> >> Fixes: 0eb42586cf87 ("rsi: data packet descriptor enhancements") >> Signed-off-by: Marek Vasut >> --- >> NOTE: I am really unsure about the method of finding out the exact >> place of ethernet header in the encapsulated packet and then >> extracting the ethertype from it. Is there maybe some sort of >> helper function for that purpose ? >> --- >> V2: - Turn the duplicated code into common function >> V3: - Simplify the TX EAPOL detection (Johannes) >> V4: - Drop the double !!() from test >> - Update commit message >> V5: - Inline the rsi_is_tx_eapol() again, undoes V2 change completely > > BTW did you test this on a real device? Yes, SDIO RS9116 on next-20221104 and 5.10.153 . What prompts this question ?