Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp925161imw; Fri, 8 Jul 2022 14:32:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uQW+LR3S27aYBNw6JBJz5rRzkRDWKX7FpiRJZqI5zWEWbKRQgFo2CeOFj1ZW6r+D3ToBR1 X-Received: by 2002:a17:90b:4d8d:b0:1ef:e3a1:d1bd with SMTP id oj13-20020a17090b4d8d00b001efe3a1d1bdmr2033542pjb.175.1657315941827; Fri, 08 Jul 2022 14:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657315941; cv=none; d=google.com; s=arc-20160816; b=CDBs3hXLPjSI2Cksf8p3MRH4NzKW/HTUjlebulIlPevD4uI+cTsf7/63QgnS/NIOJi Mg3zou+aVxdqEhJULyxDk9HEm/Yy3UttJaQAua0HmCX177kOOLIzCslzwDoXuf4fy3sz fkuzy6JFwI497P948myXudjKljtgNvZGOSUuuALMEmr6NKHzGy0FuDGSXQhkiW2bV2WC ysEGJ1vOYrRMlCZD0gOfhyrImYncE0Q7Vv6jntyICTI/b70bEz0xSozAqjWw2sZoTaQA 2hpMcPoVp4TRVHMbZgJaqJiuhGKqE4FRhgtAvvVEhZe+QJYfp/JSZqOXaomJmxrLmX4h 0s5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=n/M1fM2RChewEXKjg0ns64cNxye5PwAQ9pEQFaBqKtI=; b=uNDJ8Mdc9JXU9W9elKHlI/CqEYUix3vUEwZ/e2Ej0OTiucf344Y1oNmQ8lCBsh0voN iEp4FDPAofT/+jPtEL+dK3rHJawIVgnjtqoTS1PC7H/xVFTHaf1p7hpcJDFlEqHfk6h4 9PtjpGQon1SiSQPRrx5ctrabO7e+sU1KHIUvK6/4ioNZ7GzqveTruSHu7wLajiRvIN/l 8Qd2RZKu1sYFnEfK9CennCvLqvFHQsUJ5hO9QagrE8uXf7U9+X1Bt83HESvLLqjqEFwM TK7Zmxc8ZbLGlq1b1GiKYbNRGwKMCO5mPglo6UXx9ql9B8P6H3gW7O8xDVjBTgwao2k0 iERA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=E+VxdX+y; 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; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a056a00234d00b00525352a51a2si130194pfj.214.2022.07.08.14.32.08; Fri, 08 Jul 2022 14:32:21 -0700 (PDT) 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=@sipsolutions.net header.s=mail header.b=E+VxdX+y; 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; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240412AbiGHVMB (ORCPT + 66 others); Fri, 8 Jul 2022 17:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240050AbiGHVMB (ORCPT ); Fri, 8 Jul 2022 17:12:01 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1EF6A239A for ; Fri, 8 Jul 2022 14:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=n/M1fM2RChewEXKjg0ns64cNxye5PwAQ9pEQFaBqKtI=; t=1657314719; x=1658524319; b=E+VxdX+yoExXDC4eMcxvRLaxBBpEPR7DXht2+oxyyXw0FB+ Fwezp7gn4DpUZG8mx79ExwRmZlbuIm0VPCVpYvO7qV+ulTylsX5eYRbCxP6E39URB4FSgcPmQLpQc fJaE0np1epu+K/KS8n0RVMEZT7fozW5eTdwvjgMWZOD80Z3aGkNRX8uKW2Bm9YiSFhPr0iPgoKNuM JVVEkNU/Fc+nGje2vQnpB4e+moaYNxso583rrlSXlv6y3XU4U0rOp+si7J7Vv0mxV8GFkF958eiVu BA6xAFyPx9TrhMrmP8nr1R5EKbI6oQyu3ZIS9f55K6PlTH+Ul6S39kFXX8pP8G6Q==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1o9vGX-00APhk-9r; Fri, 08 Jul 2022 23:11:57 +0200 Message-ID: Subject: Re: [RFC] mac80211: Switch all drivers over to iTXQs From: Johannes Berg To: Alexander Wetzel Cc: linux-wireless@vger.kernel.org Date: Fri, 08 Jul 2022 23:11:56 +0200 In-Reply-To: <20220707143230.21686-1-alexander@wetzel-home.de> References: <20220707143230.21686-1-alexander@wetzel-home.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 (3.44.3-1.fc36) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Nice! I see your follow-up, but a few comments anyway here on this version. > + /* Driver has no native support for iTXQ, handle the queues */ > + ieee80211_txq_schedule_start(&local->hw, txq->txq.ac); > + while ((queue =3D ieee80211_next_txq(&local->hw, txq->txq.ac)) !=3D NUL= L) { > + control.sta =3D queue->sta; > + while ((skb =3D ieee80211_tx_dequeue(&local->hw, queue))) > + drv_tx(local, &control, skb); Yeah, I think I see how that might not work right - you don't necessarily want to pull out everything here. But it should be easy to break out here, I guess, and continue if the driver restarts the corresponding queue? > -/* Indicate which queue to use. */ > u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, > struct sk_buff *skb) > { > -[...] > + /* mac80211 only supports iTXQ nowadays. Only calculate the hash while > + * the skb is still hot in the CPU cache > + */ > + skb_get_hash(skb); > + return 0; Hmm. Is that really worth keeping? I'd probably rather remove the netdev_select_queue callbacks completely. Regardless, once this works I'm sure we can make a lot of cleanups elsewhere, e.g. a couple of "!txq" checks in tx.c (tx_prep_agg, amsdu_aggregate). Eventually with this implementation I think it'd be worth doing it for all the cases where ieee80211_get_txq() returns NULL or for where it's skipped in ieee80211_queue_skb(), i.e. * monitor mode, * management frames, * after-DTIM * PS response *=C2=A0STA not uploaded as well, and just going into the mac80211 iTXQ scheduling code you wrote in wake_tx_queue() for those cases. That way, we could get rid of all the special cases in ieee80211_queue_skb() and callers that depend on the return value. That would allow us to remove a LOT of code, all the stuff handling local->pending (tx_pending), tx_frags, etc. johannes