Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7472197rwd; Tue, 6 Jun 2023 11:09:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72k2NvV24LooJf96kUEKzCD0tMYjCT+4fRCUU1/YzEqsSffgD/jxF4ktbgUhd0zERriC1X X-Received: by 2002:a17:90b:30d4:b0:255:c461:6405 with SMTP id hi20-20020a17090b30d400b00255c4616405mr1440719pjb.15.1686074990815; Tue, 06 Jun 2023 11:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686074990; cv=none; d=google.com; s=arc-20160816; b=xqr39CmfJmoHrB7vJieX0B+UFELznVh95ikHCuau8QrEfUyTv3lAIIVLoaTCZtefEt YzHHACx4/DHa+r69YQmlTV4K85Voe+JKBE0NLhmDOj0KL9N9C9W5LaWfcxBwVS4OkJZl W4NCoD+HNOd1rb627Jgohd6NduAQUWqTqHfwh5VHwT7+ERKUTAmUjZizTgQCogw5aOQ/ IGRYLrUjgIMbWZLltRjkKFG7G89j6o2TFvIcwKg8DbTAPHKw5ybyiXuOZ2nMXUnT2ZE2 VXqgjZMI1kI+EtopL8hXqmspmQs2mJ365040mPXBuIWpqO63FyEgrbz0s+0F+XLOs5JA GmAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Qcl1xVv0DZKFv/tl9qF3aaNP9Nfg+EcmIEUZmmRBufc=; b=ZFzvIk/gpogRh6kYwlcQoYQNauyZU3I1Iq7g2AReRnY3fMHxnyyEEGNJ6txvNFAUgA Y23NrWeFOmOEu1QBpxuupb3sccYHBDBfH5TWFWdd3sw8JOHUSzRspmSa4PRVBSp3FGkm abbmNoDOybOOAKdxUYmdAFZs8iKiRbSDKWEZfFQ83+7fDAjdP+GpD+6F6LxlOeNIl3PU b4DRtJg29jSn22ObJJk5763/Ye5wfD06yFS4aKHhEJlSkuRXo92b7nyvnEyirwckeoFu n11lsI/Lpk0Z+l1IELgj4RxgjZtrS8cpfFb8BNgzQDYb9DRUuW6p/iJ9KyFw2pI7crVu 8IcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20221208.gappssmtp.com header.s=20221208 header.b=qc7dJ1SU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 d70-20020a633649000000b00543d326f7acsi2169412pga.886.2023.06.06.11.09.08; Tue, 06 Jun 2023 11:09:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@mojatatu-com.20221208.gappssmtp.com header.s=20221208 header.b=qc7dJ1SU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238614AbjFFRmf (ORCPT + 99 others); Tue, 6 Jun 2023 13:42:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238531AbjFFRmc (ORCPT ); Tue, 6 Jun 2023 13:42:32 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8958110F0 for ; Tue, 6 Jun 2023 10:42:31 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-ba8151a744fso7309751276.2 for ; Tue, 06 Jun 2023 10:42:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20221208.gappssmtp.com; s=20221208; t=1686073351; x=1688665351; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Qcl1xVv0DZKFv/tl9qF3aaNP9Nfg+EcmIEUZmmRBufc=; b=qc7dJ1SUYr4ppYF2g41koTNU6n3Y8g+nKQPoUBcUvC1gHq6zqDipikpYL3kNbWo6r/ /T/XPVgW+/VFt2BFFu3I9s5D33yPObqSpB4aL4v0LC4qRCpI4wp/w0ooja1XG7q5R/X3 fyRO4Nq5XPZjlVejykFBCNlC7A7hw1PcOiS580psL4E66wdu0TGIHlpik0ux9SmUVQQq f9XjEDANTUdqb7oTQOU1NOgldiCki0WkKYqOuwSmMLBMV5O/G85MtPm2/7itmWbixgoD FeGui90Rlt4xB250Uf4lxmmCLZzO/KvecElZ/HSpmEmHxPFU3pglGNOIQQ1RojLzKtmR DFkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686073351; x=1688665351; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qcl1xVv0DZKFv/tl9qF3aaNP9Nfg+EcmIEUZmmRBufc=; b=d0+emnJ1ro49MncmuorX1j50v3XLIXjEaE3pQBt62nNQaYaucRJt/IzUdcfEfX0Bl0 AW9EIG6hXwty1uSYD1ZjNfIaegc+5LUVs0FQhHQfO1KXr0kFB3Zg7shJOHrk/aORfAc8 rzphaAzlY5touAv3Q84lkTAuzO6Oq3NUqd0y5yJDXPStsHHQ5RVbOM7xII5/IKnplFIC DcC3stl9fEpc3xsEzLhB3c3b19FPzV7kTYSaEByg388vEVuU2lzgwmBZu7Sp7kz+xwOL Z7D3NIYLKWS4HrmD0JQkbB88ucMYq85mvN1qRoy6soYfB6XPY0JrUVdskWehCKOKq1ml Wghw== X-Gm-Message-State: AC+VfDz4g6LHbVW7agW4UWcpZtbl5UD635mhkH39fb+mPI36LTykmroB oh2u+1jWEDxbnPur/cnJqUNwLOWPsWg20uokwJTzRA== X-Received: by 2002:a81:4e44:0:b0:561:d6dd:bc84 with SMTP id c65-20020a814e44000000b00561d6ddbc84mr3585116ywb.48.1686073350739; Tue, 06 Jun 2023 10:42:30 -0700 (PDT) MIME-Version: 1.0 References: <20230602103750.2290132-1-vladimir.oltean@nxp.com> <20230605165353.tnjrwa7gbcp4qhim@skbuf> <20230606163156.7ee6uk7jevggmaba@skbuf> In-Reply-To: <20230606163156.7ee6uk7jevggmaba@skbuf> From: Jamal Hadi Salim Date: Tue, 6 Jun 2023 13:42:19 -0400 Message-ID: Subject: Re: [PATCH RESEND net-next 0/5] Improve the taprio qdisc's relationship with its children To: Vladimir Oltean Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Cong Wang , Jiri Pirko , Vinicius Costa Gomes , linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Muhammad Husaini Zulkifli , Peilin Ye , Pedro Tammela Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, 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-kernel@vger.kernel.org On Tue, Jun 6, 2023 at 12:32=E2=80=AFPM Vladimir Oltean wrote: > > On Tue, Jun 06, 2023 at 11:39:32AM -0400, Jamal Hadi Salim wrote: > > 1)Just some details become confusing in regards to offload vs not; F.e > > class grafting (taprio_graft()) is de/activating the device but that > > seems only needed for offload. Would it not be better to have those > > separate and call graft_offload vs graft_software, etc? We really need > > to create a generic document on how someone would write code for > > qdiscs for consistency (I started working on one but never completed > > it - if there is a volunteer i would be happy to work with one to > > complete it). > > I would be a happy reader of that document. I haven't studied whether > dev_deactivate() and dev_activate() are necessary for the pure software > data path, where the root taprio is also directly attached to the netdev > TXQs and that fact doesn't change across its lifetime. I didnt go that far in the doc but was intending to. It was supposed to be a tutorial somewhere and i ended not doing it. something like htb will be a good example to compare with (it is a classful qdisc which is also capable of offloading). It is not the same as mqprio which can only be root. > > 2) It seems like in mqprio this qdisc can only be root qdisc (like > > mqprio) > > so far so good > > > and you dont want to replace the children with other types of > > qdiscs i.e the children are always pfifo? i.e is it possible or > > intended for example to replace 8001:x with bfifo etc? or even change > > the pfifo queue size, etc? > > no, this is not true, why do you say this? I am just asking questions trying to understand;-> So if can i replace, for example, with a tbf would it make sense even in s/w? > > 3) Offload intention seems really to be bypassing enqueue() and going > > straigth to the driver xmit() for a specific DMA ring that the skb is > > mapped to. Except for the case where the driver says it's busy and > > refuses to stash the skb in ring in which case you have to requeue to > > the appropriate child qdisc/class. I am not sure how that would work > > here - mqprio gets away with it by not defining any of the > > en/de/requeue() callbacks > > wait, there is a requeue() callback? where? Hrm, someone removed that ops i guess at some point - not sure when, need to look at git history. But short answer is yes it used to be there; git will probably reveal from the commit its disappearance. > > > - but likely it will be the lack of requeue that makes it work. > > Looking at dev_requeue_skb(), isn't it always going to be requeued to > the same qdisc it was originally dequeued from? I don't see what is the > problem. In the basic case that approach is sufficient. For pfifo you want it to the first skb dequeued the next opportunity to send to h/w. Basically the idea is/was: if the hardware is busy you may need to run some algorithm (present in requeue but not in enqueu) to decide if you should put the skb at the head, at the tail, somewhere else, drop it, check if some time limit has exceeded and do something funky etc etc. > My understanding of the offload intention is not really to bypass dequeue= () > in general and as a matter of principle, but rather to bypass the root's > taprio_dequeue() specifically, as that could do unrelated work, and jump > right to the specific child's dequeue(). > > The child could have its own complex enqueue() and dequeue() and that is > perfectly fine - for example cbs_dequeue_soft() is a valid child dequeue > procedure - as long as the process isn't blocked in the sendmsg() call > by __qdisc_run() processing packets belonging to unrelated traffic > classes. Does it matter what type the child enqueue/dequeue? eg can i attach htb, et= c? cheers, jamal