Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4713874iob; Sun, 8 May 2022 22:59:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya+maW51g3KWX/CKKqdb+tOgy/hKkqNOKK1S3LcWlp+HcGYd9edno3N6flfeb8EQo0T4+i X-Received: by 2002:a17:903:1c2:b0:15e:c623:b518 with SMTP id e2-20020a17090301c200b0015ec623b518mr14543064plh.158.1652075991152; Sun, 08 May 2022 22:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652075991; cv=none; d=google.com; s=arc-20160816; b=MCo0wv4o1gOo/zmZnCG0Qima/nz711dNuxZCpXLmnyWpeuNU0JWc1FjNKLVK8MW2Ll IaygZqS8ScSmPYTrSwgBqcpOK3ImKwduVOJIYWRv1Hs68ecvyjekExlu32vFdEu18m/o fqfnrDnNYiQ5oDly7g6LekYEAoeCCy75FnDQN2ThyDBXoVEhNhQ6hH6KbkTwd21qcjhz VX5jTI35OCWYvmWFkqODXemS86FtnuS2Ucj9gdRddM6e2djTqAK3ZqSkNFO0IuyEdtvq HoL0iYo38nkBrKWY4U0HuCLB/mWTgjGQmZ41hHwLr4eifKGfqOATWED2B7IF0WBaWmwM dpaA== 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=ZYRzWLQJwALtz+6jjDAO6kxk/VQyyf63jq9MF8B8euY=; b=D1IYImRywWk8sOOQQo+Kj6RmbrI0dwbNnJGiKjNhxJiblmmIu9sUp6qI+Xx7zPglEA 7b1ppy+6LTu0RvGBAsCUfxSS15l8/X99/HVy/fN7aGS3qAjv3v0pUK210LYz5w9BCd9i toAjfJXyHtueDb9Ok2hBZ7RkwBShc0OMv0oOzbciecjJMuqWSu2AugV4DAGrkyRJG56+ ZrPvKQ76AqzJBZlLakkQXEwluFAs1ntr/3vtshwQ9kuLsDH8bml1seYejFY4jBoUPY7E uaEhk+YyIjpDmNP1WfztZPgIsXPipFSJyEqBeokj9owfmCremiRZnC1kik+ZbBkIZerJ dmTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=lp+XPVhk; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e14-20020a056a00162e00b0050acaaed691si11177526pfc.268.2022.05.08.22.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 22:59:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=lp+XPVhk; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B1953163F58; Sun, 8 May 2022 22:59:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbiEHFsQ (ORCPT + 69 others); Sun, 8 May 2022 01:48:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231214AbiEHFsN (ORCPT ); Sun, 8 May 2022 01:48:13 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8673FE010 for ; Sat, 7 May 2022 22:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZYRzWLQJwALtz+6jjDAO6kxk/VQyyf63jq9MF8B8euY=; b=lp+XPVhkQEXa9P11e7AmI5lb3N 4MjJck1Uorns71x78ieWwbbtHwj9N2OGkhE0ZyD5lrlHYEex5JElIEE8ZjC+7IH9/C6bOVmg/uyGf 4d4lKZ/zSFkWSDXTQ6kcplEVdeGt9RabuNhovYsudZaAaZguQFxgN37Ck/qvEWsZqFSE=; Received: from p200300daa70ef20064df27b80c0ef847.dip0.t-ipconnect.de ([2003:da:a70e:f200:64df:27b8:c0e:f847] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1nnZiJ-0001Ha-Aj; Sun, 08 May 2022 07:44:15 +0200 Message-ID: <65e6897d-e1ec-ffda-5f7a-4aec37621377@nbd.name> Date: Sun, 8 May 2022 07:44:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] mac80211: Use full queue selection code for control port tx Content-Language: en-US To: =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= , Alexander Wetzel , Johannes Berg Cc: linux-wireless@vger.kernel.org, Pierre Asselin References: <20220507083706.384513-1-alexander@wetzel-home.de> <87r1551t4c.fsf@toke.dk> From: Felix Fietkau In-Reply-To: <87r1551t4c.fsf@toke.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 07.05.22 13:26, Toke Høiland-Jørgensen wrote: > Alexander Wetzel writes: > >> Calling only __ieee80211_select_queue() for control port TX exposes >> drivers which do not support QoS to non-zero values in >> skb->queue_mapping and even can assign not available queues to >> info->hw_queue. >> This can cause issues for drivers like we did e.g. see in >> '746285cf81dc ("rtl818x: Prevent using not initialized queues")'. >> >> This also prevents a redundant call to __ieee80211_select_queue() when >> using control port TX with iTXQ (pull path). >> And it starts to prioritize 802.11 preauthentication frames >> (ETH_P_PREAUTH) on all TX paths. >> >> Pierre Asselin confirmed that this patch indeed prevents crashing his >> system without '746285cf81dc ("rtl818x: Prevent using not initialized >> queues")'. >> >> Tested-by: Pierre Asselin >> Signed-off-by: Alexander Wetzel >> --- >> >> Starting to prioritize ETH_P_PREAUTH was just added since I noticed that >> contradictory to at least my expectations control port does accept >> ETH_P_PREAUTH but handles these like a normal frame for the priority. >> That can be broken out or even drop, when needed. >> >> While looking at the code I also tripped over multiple other questions >> and I'll probably propose a much more invasive change how to handle >> the queue assignment. (End2end we seem to do some quite stupid things.) >> >> Additionally I really don't get why we call skb_get_hash() on queue >> assignment: >> I found the commit '180ac48ee62f ("mac80211: calculate skb hash early >> when using itxq")' but don't see why calculating the hash early is >> useful. Any hints here are appreciated. fq_flow_idx() seems to do that >> when needed and I can't find any other usage of the hash... > > The commit message of that commit has a hint: > > This avoids flow separation issues when using software encryption. > > The idea being that the packet contents can change on encryption, but > skb->hash is preserved, so you want it to run before encryption happens > to keep flows in the same queue. > > However, AFAICT ieee80211_tx_h_encrypt() is called after frames are > dequeued from the TXQs, so not actually sure this is needed. Adding > Felix, in the hope that he can explain the reasoning behind that commit :)Sorry, I don't remember the details on that one. One advantage that I can think of (which isn't mentioned in the commit msg) is that it is likely better for performance to calculate the hash early since there is a good chance that more of the skb data is still in the CPU cache. - Felix