Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4685972iob; Sun, 8 May 2022 21:59:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2nHpI4AgMzKGdpz8+iaVady4tIQbfJs3+m+RLo0qBnCvGtuFqp5agVOt2mUPujfx5i5YU X-Received: by 2002:a17:90a:6a45:b0:1dd:11e4:b8e8 with SMTP id d5-20020a17090a6a4500b001dd11e4b8e8mr5117925pjm.89.1652072394873; Sun, 08 May 2022 21:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652072394; cv=none; d=google.com; s=arc-20160816; b=EKHoWtkCdMWbQeV6w7tfIICWxjMyYihlCY34SohPNI8kAElbcG1nFVsX6QqWncd0ib JJyIoZ9jZe5Cws5jg1IvlgYnHVrt3Lwu9zWcxG+fVvV/2JG8lloFrUgW5ELDPXk0swO4 p6xn8T+fqfe3Beo9nP8dMRIb0lodN8ri10Z3pZNYEJDZxit9Vjq31OxIGRFRgv6oBn5I wPZSr5PN1Vl5x1JMLePvklVbT1YCYEo053mipSYuYyKIMFiS7S4OgLUs+s9RN6u0WXoM 2dhlqVxUa+MH80Xrc+KISTMSHXIB1fEdKR9lor4ElqtZltWg7JzddKUB2UUmqbdPmAYh zoaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=55f228tfFhenVpv16aCG35mDGv/16glBhOHF//IqlBk=; b=UCiZvqmey5hlEVpxunPsbr2jxxV65J+HGZ77ncLd9TMMLYGoRhI7VW2FaCoCwcw3KY DOIuWFxMex5J5AvTB/nN9ksnQxJFQixrDWCWYIKhm4Tb4Fo7DTwdWueRCT91ltMcfK0D 5m8JHPEtlSaifkTP2mtt6Hpgw6U+53NmyeDSbIKEmDBDbxVILxKzpK6EF/quhsRk455N AWslp8csKwGPIVh6TrJCUoAMT0yDdgyF1MiSmutk2VuM5N8bISqeAtAM3WglOdKxg8T/ PRnRiP2XJ9zXBPmBStmTqDgBvzoOebhEPRIjkqPkdFrd09sVFYc46OTq+WZmfkUaQweE tSlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cBmxIL6f; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id ng6-20020a17090b1a8600b001d97a68ce61si17576761pjb.172.2022.05.08.21.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:59:54 -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=pass header.i=@kernel.org header.s=k20201202 header.b=cBmxIL6f; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0DCD61123; Sun, 8 May 2022 21:56:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232050AbiEGLaE (ORCPT + 69 others); Sat, 7 May 2022 07:30:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231339AbiEGLaD (ORCPT ); Sat, 7 May 2022 07:30:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E0A64992A for ; Sat, 7 May 2022 04:26:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AB4ADB83AC9 for ; Sat, 7 May 2022 11:26:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 513C3C385A9; Sat, 7 May 2022 11:26:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651922774; bh=N2L1rVyn7X741mmr4pGhvcJpfLHR2Xc2wFhoHOuHMyE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=cBmxIL6fNN8A9EzLQUmNq+5wSEqNWwBRODz7+j1IMIRqFimELhJK3glEGAU74nimT DdeGE5atp19wO9TyUxoRNGuBfZzSi4DF4EnkCI21DuIoAWA6p9+tL5KX2z5fLIM0yy 9nq1Czq8GVKzdlaxoA4ifYvOKHShMFl0d7DiGtB0W2KnyCqr/Kqmyku0SBLIzltU30 nQ26L6Rx3T+v0/xoL2yyYVR3oaFRPLCMjCLRB7yJw/xc0xYyd13oEW2p+Abag8zygo iJ5jkWMouvNbyjtL724PfLUdhb81MA4pgLlyXIRfgQe/fmLLlZYDzxDpoqYlDRcssu 1yTkMWCQOB7AA== Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id DD4C034D8C9; Sat, 7 May 2022 13:26:11 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Alexander Wetzel , Johannes Berg , Felix Fietkau Cc: linux-wireless@vger.kernel.org, Alexander Wetzel , Pierre Asselin Subject: Re: [PATCH] mac80211: Use full queue selection code for control port tx In-Reply-To: <20220507083706.384513-1-alexander@wetzel-home.de> References: <20220507083706.384513-1-alexander@wetzel-home.de> X-Clacks-Overhead: GNU Terry Pratchett Date: Sat, 07 May 2022 13:26:11 +0200 Message-ID: <87r1551t4c.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 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 :) -Toke