Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5999367rwd; Wed, 24 May 2023 09:27:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4NRwcN8kr1rUqzbBHgIXmkqQqtuxMeodjSPIoo0ewKK11YcmM6PGhsmzFkzAgw469mX8G7 X-Received: by 2002:a05:6a00:b47:b0:643:59ed:5dc9 with SMTP id p7-20020a056a000b4700b0064359ed5dc9mr4025255pfo.12.1684945639070; Wed, 24 May 2023 09:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684945639; cv=none; d=google.com; s=arc-20160816; b=jcfYX1KR3mjdtWJ81UpbsCf708gXUcXhdNGgxT9kcHKlE7DyzdZt5qrjEtMSSjb1ZC iAyo/3/Bhnv3YFtY2ixYBPB7Tu2sjO3kgwKfXyyc/wcKymMlpP0pkpHg3hamIveVdy6x YlCjvUdX3cw0XQRwyxoqtKqmZGEvQz68a+9Z7ZmrRv76BZVx5Nc7EqQcDOi/4dfKGcf9 JsdjgRRp8X+uEswSuFMB5CJH6BmFqONhwrpgZ6Gv7uw4Ov5m+CZQXpfZ66qiIO+Zy7MW bpdzow33DociXUxLWiHERSz9SX7yN/efibswaoeaLg5MjWIqpG1Op5DouoDU0qE6OjtU g34Q== 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=RSx7NVpJoVUE0IuFsRNs5zc6b2qmaAfWzUGO43tnlIY=; b=aQ1HO0j5NNzU+eCFRXjLlVBL4IuO3v/5skIEemFfEt2jjn/W4Ei1qBMobiF4vICtKR BQXZMhXg+JZoD3kD7Y+YEPPAiQYZhRE8KjxK2ffB9H03irVo7pEHXyNq9HOooxzIBE6x 1HnELN8SqSzn/k/JgHs4SmJsKrsKPD7VB401Ro3k5QjtWShH2dDf4DHNseFNaX7T/aDt mWiXdJul8GX3DPlw7c6TkLmJGLq4Ef+764V7tr4N1z/ke9whwBbH8xoXkqBAXVRNn/by b2Cg6kms2ZfMZO7pfgrRUuG9v7Yu9brFLb+60MttgQwSAV2IbWF3S2ilTW2qKGr0ffAr 9JeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20221208.gappssmtp.com header.s=20221208 header.b=W4rnd1RR; 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 c190-20020a624ec7000000b00626007418c3si8863373pfb.289.2023.05.24.09.27.07; Wed, 24 May 2023 09:27:19 -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=W4rnd1RR; 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 S237942AbjEXQAV (ORCPT + 99 others); Wed, 24 May 2023 12:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238186AbjEXP7p (ORCPT ); Wed, 24 May 2023 11:59:45 -0400 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F8B21723 for ; Wed, 24 May 2023 08:58:50 -0700 (PDT) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-563b1e5f701so11038887b3.3 for ; Wed, 24 May 2023 08:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20221208.gappssmtp.com; s=20221208; t=1684943929; x=1687535929; 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=RSx7NVpJoVUE0IuFsRNs5zc6b2qmaAfWzUGO43tnlIY=; b=W4rnd1RRJz1sQhwjhVZnU2ah2ujkLS+8GpiMGyaepK7Hf7O0AU/dKF3UDVTBOW2MbM ljOMaNUr10NQMKWDExoAKBxc4jOYEJW/taW3f+yd1AAXA9DO8SzkFB68svmrfCXzojXl 1/qEK0Ccucb7BERzDY9sbNq5syJPaX1+yg5bxZt0/qfGVVTTOUV/VKO5UXyfvnxBp4Jk PfMwb7GO+CDr+tX0Veko9Jc9Z/F/b3hBJ7cor0XwUjkoYAKabYGGlsvqvjbbq8+/Z30i r2cHwE6SqzU9ajSbnfK8ZtA62YUo14P0Vh6LTQulkK8xVuU1uGAv9xWwY1UEyXhL0dSF hyFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684943929; x=1687535929; 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=RSx7NVpJoVUE0IuFsRNs5zc6b2qmaAfWzUGO43tnlIY=; b=GR5F24BONbWZ1I0wZMZELlfffAx7YM7TPdcYovJcDZugZNwAmgZ1Wulp6fveWEehJH n/lWO4pZ7PAmGRnGUQh0qpE1wS0IDUIhubyZkaQudQ+EopWRDyMc2uu6EpDHW8I4/HdI g1mFf4dauT8Imjfqqv4MLW+ZTXJtaqeFObXgG6eJ1Lwm8mhn0lelK1sVBSsdWquyNul0 Iv9riEy/IoT36taIWZHSLydcAYF7NnNhpDcSndolKk95gOuVBEv70eeLtH4sQZ7CDEI1 XNoMUqVfXA5irXX8+pc9mToogieH+kTBzfxmks0WJ4MoPIkVhsLxbh28Edd+yDuKlRd5 ukSA== X-Gm-Message-State: AC+VfDz2/tEJhN103egqiavcOD1byzEsvcuZ+sFhSBBDJRi5R4LlqlrZ dF7NRGOaFnSCEbOhnlxNOxPQc36u+NBfp1kMAXVlrw== X-Received: by 2002:a81:6507:0:b0:55a:6dc8:e084 with SMTP id z7-20020a816507000000b0055a6dc8e084mr21214734ywb.17.1684943929353; Wed, 24 May 2023 08:58:49 -0700 (PDT) MIME-Version: 1.0 References: <0c07bd5b72c67a2edf126cd2c6a9daadddb3ca95.1684887977.git.peilin.ye@bytedance.com> <5fda8703-9220-4abd-7859-0af973d0d1d7@mojatatu.com> In-Reply-To: <5fda8703-9220-4abd-7859-0af973d0d1d7@mojatatu.com> From: Jamal Hadi Salim Date: Wed, 24 May 2023 11:58:38 -0400 Message-ID: Subject: Re: [PATCH v5 net 2/6] net/sched: sch_clsact: Only create under TC_H_CLSACT To: Pedro Tammela Cc: Peilin Ye , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Cong Wang , Jiri Pirko , Peilin Ye , Daniel Borkmann , John Fastabend , Vlad Buslov , Hillf Danton , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Wang 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 Wed, May 24, 2023 at 11:38=E2=80=AFAM Pedro Tammela wrote: > > On 23/05/2023 22:18, Peilin Ye wrote: > > From: Peilin Ye > > > > clsact Qdiscs are only supposed to be created under TC_H_CLSACT (which > > equals TC_H_INGRESS). Return -EOPNOTSUPP if 'parent' is not > > TC_H_CLSACT. > > > > Fixes: 1f211a1b929c ("net, sched: add clsact qdisc") > > Signed-off-by: Peilin Ye > > Tested-by: Pedro Tammela > Reviewed-by: Jamal Hadi Salim Acked-by: Jamal Hadi Salim cheers, jamal > > --- > > change in v5: > > - avoid underflowing @egress_needed_key in ->destroy(), reported by > > Pedro > > > > change in v3, v4: > > - add in-body From: tag > > > > net/sched/sch_ingress.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c > > index f9ef6deb2770..35963929e117 100644 > > --- a/net/sched/sch_ingress.c > > +++ b/net/sched/sch_ingress.c > > @@ -225,6 +225,9 @@ static int clsact_init(struct Qdisc *sch, struct nl= attr *opt, > > struct net_device *dev =3D qdisc_dev(sch); > > int err; > > > > + if (sch->parent !=3D TC_H_CLSACT) > > + return -EOPNOTSUPP; > > + > > net_inc_ingress_queue(); > > net_inc_egress_queue(); > > > > @@ -254,6 +257,9 @@ static void clsact_destroy(struct Qdisc *sch) > > { > > struct clsact_sched_data *q =3D qdisc_priv(sch); > > > > + if (sch->parent !=3D TC_H_CLSACT) > > + return; > > + > > tcf_block_put_ext(q->egress_block, sch, &q->egress_block_info); > > tcf_block_put_ext(q->ingress_block, sch, &q->ingress_block_info); > > >