Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4429rwe; Wed, 24 Aug 2022 14:54:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR7h0ZNakzdNMvhf9P3vTK5a3V9GmhkYpAjph173ch7k4kIUEsEKnGZSgYI9L/53JhOKrnRc X-Received: by 2002:a05:6402:206b:b0:446:ce5d:3e60 with SMTP id bd11-20020a056402206b00b00446ce5d3e60mr780115edb.139.1661378067170; Wed, 24 Aug 2022 14:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661378067; cv=none; d=google.com; s=arc-20160816; b=N1ls38n2Nk7Em4oqSOG4Tvuv43idV/c+oIPKffX+kFZe9cdB6DN044IbLCrRrKOBcd 9tJ1q6h6s/GHJy0ZXkoasQrebu2PQDcDOelrfporrVGB611NTjReEKs/H6d0A76o+R+a FSXPJWuGfgMRou7QvGgJEQJURLpT278ZyEKhnoBo+BgLf+BRDKYSKQ5/EXI4AE46tBDH +Z38uiBpnqXkuXhs+kk1qJ5LdnrRvjyWn3RDHKIVW7krZb8/LwIX+U7y0lvMF+TK3WvM uh8su3Zze0POpzds+dTSolU/Q12V6u8BvceTZc/NAnQHxPdKqdpAXOOu3sRIZnLTIooH VvJA== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=ea72jXn4qCwy1jlxXBuPqKsWGEHBoJlLe6ksUrb7XRo=; b=wIZdGR2ohrFVW8Rzr3bNcgNW/zsL0afHQunE2LC0uuUShDzxwsT/WKkcW/rLhQtdu5 W2qAfgVkFQyap1elvCWJvXPjGQ9QYO9+fiyzSCt8w8D/pN30b84AS9pnV8gvkzK/3GoN kVw0yB8SOKLDaeMHryQALKzHBdM3lIDAs/Tl7AzeVYYz812Mk/6MEcr1Fje+bF7Kn3V4 la43SMoSAk6PfSoQc6mtyEwaVQGWZWOryzgtJAeRSto2pr3lPa02LbFhBlz2ZgCJ0xPi E7Obd7b8hEBzBpapU7lnWw1tF4xnxQNOQ6/buJl97rpJzHNGzuKA6FKyH8T9xFysp6Vq Dckg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=p9ZTuOUr; 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 i14-20020a05640200ce00b004479f85b42esi558009edu.509.2022.08.24.14.54.07; Wed, 24 Aug 2022 14:54:27 -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=p9ZTuOUr; 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 S239484AbiHXVua (ORCPT + 63 others); Wed, 24 Aug 2022 17:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238715AbiHXVu2 (ORCPT ); Wed, 24 Aug 2022 17:50:28 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2BF74E845; Wed, 24 Aug 2022 14:50:27 -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: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:In-Reply-To:References; bh=ea72jXn4qCwy1jlxXBuPqKsWGEHBoJlLe6ksUrb7XRo=; t=1661377828; x=1662587428; b=p9ZTuOUrOkgT1V5Ozcja5FY0onyP+MEBLgcZ15HnvTKqxME6wMYOXhzrfr3BcRpgCIxvc66vF4D sJ5wXxYDQ0uxb8JejTm20GSm99kRYpGKJH1AsSsIuFVKSTsga/vsfgCXllUHIpmUUcznl7DqmZVZa ZKcNOWLmghYZbEe//e0Tt5LZEviemp8awsT1SW4RtziGof3mKqXm1OKP889WStlBQ+y/vC53MXPVA RzWIawGpS7VBXF+KuEaJOwWrMklTsLYLYxERJVndkU8lwUWkbSTUkJ1Fj8/l+BAAl/RMQba0/Npki Aj29aKlEaxdCHBMayC74JK8A2SQSyjqBakpg==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1oQyGR-00GND3-2X; Wed, 24 Aug 2022 23:50:19 +0200 Message-ID: <117aa7ded81af97c7440a9bfdcdf287de095c44f.camel@sipsolutions.net> Subject: taprio vs. wireless/mac80211 From: Johannes Berg To: netdev@vger.kernel.org Cc: Vinicius Costa Gomes , Toke =?ISO-8859-1?Q?H=F8iland-J=F8rgensen?= , Avi Stern , linux-wireless@vger.kernel.org Date: Wed, 24 Aug 2022 23:50:18 +0200 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-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,URIBL_BLOCKED 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 Hi, We're exploring the use of taprio with wireless/mac80211, and in mac80211 today (**) we don't have multiple queues (any more) since all the queuing actually happens in FQ/Codel inside mac80211. We also set IFF_NO_QUEUE, but that of course only really affects the default qdisc, not the fact that you could use it or not. In mac80211 thus we never back-pressure against the qdiscs, which is why we basically selected a single queue. Also, there's nothing else we do about the queue other than immediately pull a packet from it if available, so it'd basically pure overhead to have real queues there. In a sense, given that we cannot back-pressure against the queues, it feels a bit wrong to even have multiple queues. We also don't benefit in any way from splitting data structures onto multiple CPUs or something since we put it all into the same FQ/Codel anyway. Now, in order to use taprio, you're more or less assuming that you have multiple (equivalent) queues, as far as I can tell. Obviously we can trivially expose multiple equivalent queues from mac80211, but it feels somewhat wrong if that's just to make taprio be able to do something? Also how many should we have, there's more code to run so in many cases you probably don't want more than one, but if you want to use taprio you need at least two, but who says that's good enough, you might want more classes: /* taprio imposes that traffic classes map 1:n to tx queues */ if (qopt->num_tc > dev->num_tx_queues) { NL_SET_ERR_MSG(extack, "Number of traffic classes is greater than number of HW queues"); return -EINVAL; } The way taprio is done almost feels like maybe it shouldn't even care about the number of queues since taprio_dequeue_soft() anyway only queries the sub-qdiscs? I mean, it's scheduling traffic, if you over- subscribe and send more than the link can handle, you've already lost anyway, no? (But then Avi pointed out that the sub qdiscs are initialized per HW queue, so this doesn't really hold either ...) Anyone have recommendations what we should do? Thanks, johannes (**) Assuming internal TXQ usage, but let's do that, we even have a first patch somewhere that converts everything to use it; otherwise we used to have the queues mapped to the ACs with ndo_select_queue, which is also quite wrong from this perspective.