Message ID | 042ff4af742ef0ed76fd5bb55b914403954b9d9f.1684825171.git.peilin.ye@bytedance.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1955172vqo; Tue, 23 May 2023 00:28:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72ay1deRbKX89Gcr89RtGfFrgcoKLBNbdIXJoPWhfHCvmPFu+b758IyKv41YNRItBUsndP X-Received: by 2002:a05:6a00:2ea4:b0:64a:f8c9:a421 with SMTP id fd36-20020a056a002ea400b0064af8c9a421mr20832855pfb.32.1684826906171; Tue, 23 May 2023 00:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684826906; cv=none; d=google.com; s=arc-20160816; b=VqXHcjNLtrD4lCMnp/9b78o7HprZnTHTDj0gKlF3shoKbWg2timuBFA1D7lQ2I/THh jB0l85bJh21Bf3GpXZVktlCzQwtggOIRtqULrbGk3rwd0rqijuCciNx1GPP+4asoK/F7 Ayl699RZyRHuYbbriTvPa5zH5x8+f3PyMIkbtlFZOWomtFg8xVWMzJfBDx1kTMtTIebT gNzhW0ZOFE1gxhyEkhvAKlCg3NKkfFb3rtdFPhimbmIBI8rp29s+L/3YApvN4BdqmQwG EW7GeM/kpupNdxTHCfDKvma+l3piNeLH7r6MIeAgR2Q54EXUWGBZcsJVq/RqGiq4g5EI hxpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=k4RT8KtH61VT5UBgWC5UXkvWjA8gZ1S4WED/F36PazM=; b=OMNVwZn+xe/EAsVf9F9srraf8ONs5WHwvUg3lROa0LaAek7nG1TfdCMV8o3nYu/PZ+ Xla2dHFd1h8iNLFIcg/cPFn+9Nr5jSXl1HHswcTl2QmMOx2N5znBv3/aBjMmDflNND1y ahnFGsf44IyDz3+fdNdrgBrJv+TtR2aMapYiHm2z1/GSsswkBCsal5Lgg1pZdX5sjD8x J8BMsl8FASiOi5eEAuEOFfWRvqHMfDN4H5cXAOftMKFW3PIKhsziFT8Ygl+2lMJXJt6j GflVu8lq+xOOr7QcbFNFuRT8JAKgdgtke07CeJPaj7x2abEaLwtMOzIZvA87UYzKrQH3 /NYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=APMod9rD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f196-20020a6238cd000000b006399bb6f5b2si827389pfa.25.2023.05.23.00.28.11; Tue, 23 May 2023 00:28:26 -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=@gmail.com header.s=20221208 header.b=APMod9rD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235361AbjEWHO4 (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Tue, 23 May 2023 03:14:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235401AbjEWHOx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 23 May 2023 03:14:53 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58A60109; Tue, 23 May 2023 00:14:52 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-3f392680773so34347771cf.0; Tue, 23 May 2023 00:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684826091; x=1687418091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k4RT8KtH61VT5UBgWC5UXkvWjA8gZ1S4WED/F36PazM=; b=APMod9rDv+JDt7Mke9LgtZqH3l4ccae3EMMMsQ8gqTojNI/LELDTXIsWVPQmHDkDtL h2UPoEEQsXZNS8uu2R4OkkqfJ3jLfGsees8LUcwP9BNiRVCjPwzxkukGtekCMjd/nRB6 OYPfZZGdS/Gjh1tHb5f8ZHRhVmOHDAEtMc3raW4QnyPWysPHYwoyitkxx68NXIbk3g6w tz+aGKzd8++nVVaShvpkGFQOCqDJDBfWV1nhQ4sHYKWfzU/oYpbgT9lLCLjdktGvG36+ 6QJJsBVxDuNGbUEwmccZ9yiAlBBCq5k3VpazaB37jyiUiiNJZt/Y/DwmV3Hq8bVpjxWY mNnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684826091; x=1687418091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k4RT8KtH61VT5UBgWC5UXkvWjA8gZ1S4WED/F36PazM=; b=CF9ES4w3+Q0RPwZrNOxO1YGFb1jsQzMYDT67v2KjQzJZXVIqjAZWluVR/QcNY6X6pB Go/Mkor3+fgVQfNe2ioShOViKAoxn9oN0KMncJ6ItVVLV1NPLzluePmWnunNOkzYjoI1 UJwQ4B98PDxt9ms8hwi4xk5LnUU6M/A3QjmVtIqpQu+wu5l+O4xdHDNSVqejycyVSbqu PL/JH0RptZgXvuppxjR8ty1ZrxhbiBzmt9WAi914lCxOm8XXZD/Sakm512WdWQvD/jcQ xSj/YavVKqT34LqMhG+Mc3qY90wvvRRwoa5tAU4aFhsHzcNL+evh0JLiMjGh01emXCS7 Mvow== X-Gm-Message-State: AC+VfDx4F7m7xUDnGLMbpidFF9YBNfgL9uxZRWZMjopS3bhEHAcngAeI TJF+C1vBKywMX9orz42GfQ== X-Received: by 2002:ac8:7d0c:0:b0:3f5:3982:fa26 with SMTP id g12-20020ac87d0c000000b003f53982fa26mr24549341qtb.14.1684826091444; Tue, 23 May 2023 00:14:51 -0700 (PDT) Received: from C02FL77VMD6R.bytedance.net ([2600:1700:d860:12b0:18c1:dc19:5e29:e9a0]) by smtp.gmail.com with ESMTPSA id b13-20020ac8754d000000b003f364778b2bsm1867381qtr.4.2023.05.23.00.14.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 May 2023 00:14:51 -0700 (PDT) From: Peilin Ye <yepeilin.cs@gmail.com> X-Google-Original-From: Peilin Ye <peilin.ye@bytedance.com> To: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jamal Hadi Salim <jhs@mojatatu.com>, Cong Wang <xiyou.wangcong@gmail.com>, Jiri Pirko <jiri@resnulli.us> Cc: Peilin Ye <peilin.ye@bytedance.com>, Daniel Borkmann <daniel@iogearbox.net>, John Fastabend <john.fastabend@gmail.com>, Vlad Buslov <vladbu@mellanox.com>, Pedro Tammela <pctammela@mojatatu.com>, Hillf Danton <hdanton@sina.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Wang <cong.wang@bytedance.com>, Peilin Ye <yepeilin.cs@gmail.com> Subject: [PATCH v4 net 2/6] net/sched: sch_clsact: Only create under TC_H_CLSACT Date: Tue, 23 May 2023 00:14:41 -0700 Message-Id: <042ff4af742ef0ed76fd5bb55b914403954b9d9f.1684825171.git.peilin.ye@bytedance.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <cover.1684825171.git.peilin.ye@bytedance.com> References: <cover.1684825171.git.peilin.ye@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766669058402220477?= X-GMAIL-MSGID: =?utf-8?q?1766669058402220477?= |
Series |
net/sched: Fixes for sch_ingress and sch_clsact
|
|
Commit Message
Peilin Ye
May 23, 2023, 7:14 a.m. UTC
From: Peilin Ye <peilin.ye@bytedance.com> 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") Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: Peilin Ye <peilin.ye@bytedance.com> --- change since v2: - add in-body From: tag net/sched/sch_ingress.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c index 3d71f7a3b4ad..13218a1fe4a5 100644 --- a/net/sched/sch_ingress.c +++ b/net/sched/sch_ingress.c @@ -222,6 +222,9 @@ static int clsact_init(struct Qdisc *sch, struct nlattr *opt, struct net_device *dev = qdisc_dev(sch); int err; + if (sch->parent != TC_H_CLSACT) + return -EOPNOTSUPP; + net_inc_ingress_queue(); net_inc_egress_queue();