From patchwork Sun May 30 11:40:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Sukholitko X-Patchwork-Id: 450781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8713C47091 for ; Sun, 30 May 2021 11:41:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80A62610A8 for ; Sun, 30 May 2021 11:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229805AbhE3LnQ (ORCPT ); Sun, 30 May 2021 07:43:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbhE3LnP (ORCPT ); Sun, 30 May 2021 07:43:15 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F3B2C06174A for ; Sun, 30 May 2021 04:41:37 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id g24so5034670pji.4 for ; Sun, 30 May 2021 04:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=ndUOIIrvVzaRBYA4AyCggPznCbc9NhiDsupXfJfLUDk=; b=ICkx3tvtrkk4KBPQN6kd+qZZBa8XwxmAZT/0km0KWlNCwO6AceOWNrHinSMHedghVH TDvgc+Cr5JnHOViE6qXmYqud1cei+LYb0Y6Sm/H0Kk0Y5Er9E3Cujiy6x1T9iWdD2K3a 1udNQzcd8CQ0BwkD4rWMCkU0eLOoB9tWBiq94= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=ndUOIIrvVzaRBYA4AyCggPznCbc9NhiDsupXfJfLUDk=; b=EJLQ6AFSM6516d78M5+ykYewOj95U0TD5ojwJs9pZIZRiZB7a4lb8vrgtdBPLqIyZG YuaPKgxE5/WNQ5IVHyCUZYW8X9B4E2zgQsgmq4/+AKFYSMPvaZcCxuNCxFKGnnEHZYKp r8X4XCTVVOF35ZJ+u+ySAXiiBbaoFLTXWDxiMFLSVacusDMdkxjKK0d+xyRFKP8oJXU5 7N26GOLpUerU+OHhvuMsei1l2Gm2omr8sT0fDvA4ciTaIqEyvzZPe4a9wgP/ki1i1XWU WkEO7j8PR4rm6q3XD9uCOclzALasi4TmB/RefdmBliBsTkiwH/O8oAeNgZJFiEbwWZOS JqsQ== X-Gm-Message-State: AOAM532wjJ+xlaLsspid5isfoIrqopvFCt4EzB8oTUwf2MKlrguk4Uyz 6JbQ3JM5wKdKudBpwVDFMCfwycA4HnVXEci4qx2nq9r3Ga78NxFcVxMsxa9R6QQ4bNwVFjz5n/B 3L2DtDc4GvW/a6cfF/zYVufYp6yjre2y+noAxZVbqAtBhZxk6+SSBkCQ+XOdCjCYyGNEKUByF6w 6KUljKZ1s= X-Google-Smtp-Source: ABdhPJzgZ5P/Vi2XsqaxHoYccjYFnGrWIny2RsDSQ9KMu5WCSVV/OqlkFMYNTt6mR2h8qFTMTX4/5g== X-Received: by 2002:a17:902:6b81:b029:ea:dcc5:b841 with SMTP id p1-20020a1709026b81b02900eadcc5b841mr15982183plk.29.1622374896303; Sun, 30 May 2021 04:41:36 -0700 (PDT) Received: from localhost.localdomain ([192.19.250.250]) by smtp.gmail.com with ESMTPSA id o17sm8126093pjp.33.2021.05.30.04.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 May 2021 04:41:35 -0700 (PDT) From: Boris Sukholitko To: netdev@vger.kernel.org, Jamal Hadi Salim , Jiri Pirko , Cong Wang Cc: linux-kselftest@vger.kernel.org, shuah@kernel.org, Ilya Lifshits , Shmulik Ladkani , Jakub Kicinski , Davide Caratti , Boris Sukholitko Subject: [PATCH net-next v3 1/3] net/sched: act_vlan: Fix modify to allow 0 Date: Sun, 30 May 2021 14:40:50 +0300 Message-Id: <20210530114052.16483-2-boris.sukholitko@broadcom.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20210530114052.16483-1-boris.sukholitko@broadcom.com> References: <20210530114052.16483-1-boris.sukholitko@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently vlan modification action checks existence of vlan priority by comparing it to 0. Therefore it is impossible to modify existing vlan tag to have priority 0. For example, the following tc command will change the vlan id but will not affect vlan priority: tc filter add dev eth1 ingress matchall action vlan modify id 300 \ priority 0 pipe mirred egress redirect dev eth2 The incoming packet on eth1: ethertype 802.1Q (0x8100), vlan 200, p 4, ethertype IPv4 will be changed to: ethertype 802.1Q (0x8100), vlan 300, p 4, ethertype IPv4 although the user has intended to have p == 0. The fix is to add tcfv_push_prio_exists flag to struct tcf_vlan_params and rely on it when deciding to set the priority. Fixes: 45a497f2d149a4a8061c (net/sched: act_vlan: Introduce TCA_VLAN_ACT_MODIFY vlan action) Signed-off-by: Boris Sukholitko --- include/net/tc_act/tc_vlan.h | 1 + net/sched/act_vlan.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/net/tc_act/tc_vlan.h b/include/net/tc_act/tc_vlan.h index f051046ba034..f94b8bc26f9e 100644 --- a/include/net/tc_act/tc_vlan.h +++ b/include/net/tc_act/tc_vlan.h @@ -16,6 +16,7 @@ struct tcf_vlan_params { u16 tcfv_push_vid; __be16 tcfv_push_proto; u8 tcfv_push_prio; + bool tcfv_push_prio_exists; struct rcu_head rcu; }; diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 1cac3c6fbb49..a108469c664f 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -70,7 +70,7 @@ static int tcf_vlan_act(struct sk_buff *skb, const struct tc_action *a, /* replace the vid */ tci = (tci & ~VLAN_VID_MASK) | p->tcfv_push_vid; /* replace prio bits, if tcfv_push_prio specified */ - if (p->tcfv_push_prio) { + if (p->tcfv_push_prio_exists) { tci &= ~VLAN_PRIO_MASK; tci |= p->tcfv_push_prio << VLAN_PRIO_SHIFT; } @@ -121,6 +121,7 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla, struct tc_action_net *tn = net_generic(net, vlan_net_id); struct nlattr *tb[TCA_VLAN_MAX + 1]; struct tcf_chain *goto_ch = NULL; + bool push_prio_exists = false; struct tcf_vlan_params *p; struct tc_vlan *parm; struct tcf_vlan *v; @@ -189,7 +190,8 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla, push_proto = htons(ETH_P_8021Q); } - if (tb[TCA_VLAN_PUSH_VLAN_PRIORITY]) + push_prio_exists = !!tb[TCA_VLAN_PUSH_VLAN_PRIORITY]; + if (push_prio_exists) push_prio = nla_get_u8(tb[TCA_VLAN_PUSH_VLAN_PRIORITY]); break; case TCA_VLAN_ACT_POP_ETH: @@ -241,6 +243,7 @@ static int tcf_vlan_init(struct net *net, struct nlattr *nla, p->tcfv_action = action; p->tcfv_push_vid = push_vid; p->tcfv_push_prio = push_prio; + p->tcfv_push_prio_exists = push_prio_exists || action == TCA_VLAN_ACT_PUSH; p->tcfv_push_proto = push_proto; if (action == TCA_VLAN_ACT_PUSH_ETH) { From patchwork Sun May 30 11:40:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Sukholitko X-Patchwork-Id: 450464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30743C47091 for ; Sun, 30 May 2021 11:41:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0452860230 for ; Sun, 30 May 2021 11:41:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229814AbhE3Ln0 (ORCPT ); Sun, 30 May 2021 07:43:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229810AbhE3LnZ (ORCPT ); Sun, 30 May 2021 07:43:25 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE3E5C061574 for ; Sun, 30 May 2021 04:41:47 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id b15-20020a17090a550fb029015dad75163dso5099314pji.0 for ; Sun, 30 May 2021 04:41:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=YPiZ+Ti+hk3NrozLRodgguH6djqTkuizz+c1SHc/lbQ=; b=JfGhJiFyXqmemoqcI7xMJXp5HdLZHtLNREUwOOcIASL/27RBOdbHfDr29IGlRrivi1 KlIUmCxOzCwUFmpjLRXLMjLVGXmbeLY9xFcbE0TSc+mGipcEt1RhxZxHD7P3P3JPAI7+ VYFbIRhohJLYiLNVfvzHOnvrJIDXboA01QgUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=YPiZ+Ti+hk3NrozLRodgguH6djqTkuizz+c1SHc/lbQ=; b=lpMs3L3zoBxIayg/CecAzKPFHMLpLP8IeRFMn0dYF7NvJHP6B2OBPmFZGwvBPt2YWn OfBLUTZvTGo9KwXD3lHqGtEqFkvVj306hEN/OOfPrdg9vnO1yp6GXWgRxTeRFkkhF1OP uzG8WhVmaaKYDCJA+prKnDsQg+nm98uVQsqXGPEIs9uWzHb5KAFTqLAb85zMDig4xij2 d0TEAF+TwMhXobZxwUrGPCGHYOZnKYD/bMkCIdS7JE4cvqxWvBMf7O7Y+0Ht2BZMU/K6 Tigz/B192r22h3W3L+yXd/jhmdEos3vn9W63ofopXcKjcOO3xDtmoEeiEQs3aDkrjLLP 8pEQ== X-Gm-Message-State: AOAM532ojBO9ZTQQ2YrprktDxdzBCnqReHLRDPt/5pFhOmq/+u2dtUSm dfVQdywxxOHDxoZIs6XX4U0Z04jimxQavteJP+nOmUvkV7rFBiszyhi2qDBJtRNNz7+3Fw+0UKr 9N7DO16MY18bG213ja57PvrGn+Ng08G3TVZcqIaCzDn0fLMKvqx7h7yV3OEWAooKuVea1nMEfiA goMU8M1iM= X-Google-Smtp-Source: ABdhPJwfEE/JdsLGRjkYlwdc4OtTscgN37CdPC+Rqws+UNJAHfIj3wB4y7QYKw667gfROrwtmo/TtA== X-Received: by 2002:a17:902:c3d5:b029:100:742f:fce9 with SMTP id j21-20020a170902c3d5b0290100742ffce9mr12363207plj.46.1622374906752; Sun, 30 May 2021 04:41:46 -0700 (PDT) Received: from localhost.localdomain ([192.19.250.250]) by smtp.gmail.com with ESMTPSA id o17sm8126093pjp.33.2021.05.30.04.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 May 2021 04:41:46 -0700 (PDT) From: Boris Sukholitko To: netdev@vger.kernel.org, Jamal Hadi Salim , Jiri Pirko , Cong Wang Cc: linux-kselftest@vger.kernel.org, shuah@kernel.org, Ilya Lifshits , Shmulik Ladkani , Jakub Kicinski , Davide Caratti , Boris Sukholitko Subject: [PATCH net-next v3 2/3] net/sched: act_vlan: No dump for unset priority Date: Sun, 30 May 2021 14:40:51 +0300 Message-Id: <20210530114052.16483-3-boris.sukholitko@broadcom.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20210530114052.16483-1-boris.sukholitko@broadcom.com> References: <20210530114052.16483-1-boris.sukholitko@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Dump vlan priority only if it has been previously set. Fix the tests accordingly. Signed-off-by: Boris Sukholitko --- net/sched/act_vlan.c | 19 ++++++++++++++----- .../tc-testing/tc-tests/actions/vlan.json | 4 ++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index a108469c664f..ccd1acfa4c55 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c @@ -307,8 +307,8 @@ static int tcf_vlan_dump(struct sk_buff *skb, struct tc_action *a, (nla_put_u16(skb, TCA_VLAN_PUSH_VLAN_ID, p->tcfv_push_vid) || nla_put_be16(skb, TCA_VLAN_PUSH_VLAN_PROTOCOL, p->tcfv_push_proto) || - (nla_put_u8(skb, TCA_VLAN_PUSH_VLAN_PRIORITY, - p->tcfv_push_prio)))) + (p->tcfv_push_prio_exists && + nla_put_u8(skb, TCA_VLAN_PUSH_VLAN_PRIORITY, p->tcfv_push_prio)))) goto nla_put_failure; if (p->tcfv_action == TCA_VLAN_ACT_PUSH_ETH) { @@ -362,10 +362,19 @@ static int tcf_vlan_search(struct net *net, struct tc_action **a, u32 index) static size_t tcf_vlan_get_fill_size(const struct tc_action *act) { - return nla_total_size(sizeof(struct tc_vlan)) + struct tcf_vlan *v = to_vlan(act); + struct tcf_vlan_params *p; + size_t ret = nla_total_size(sizeof(struct tc_vlan)) + nla_total_size(sizeof(u16)) /* TCA_VLAN_PUSH_VLAN_ID */ - + nla_total_size(sizeof(u16)) /* TCA_VLAN_PUSH_VLAN_PROTOCOL */ - + nla_total_size(sizeof(u8)); /* TCA_VLAN_PUSH_VLAN_PRIORITY */ + + nla_total_size(sizeof(u16)); /* TCA_VLAN_PUSH_VLAN_PROTOCOL */ + + spin_lock_bh(&v->tcf_lock); + p = rcu_dereference_protected(v->vlan_p, lockdep_is_held(&v->tcf_lock)); + if (p->tcfv_push_prio_exists) + ret += nla_total_size(sizeof(u8)); /* TCA_VLAN_PUSH_VLAN_PRIORITY */ + spin_unlock_bh(&v->tcf_lock); + + return ret; } static struct tc_action_ops act_vlan_ops = { diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json b/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json index 527ce5410314..1d9d261aa0b3 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json @@ -463,7 +463,7 @@ "cmdUnderTest": "$TC actions add action vlan modify protocol 802.1Q id 5 index 100", "expExitCode": "0", "verifyCmd": "$TC actions get action vlan index 100", - "matchPattern": "action order [0-9]+: vlan.*modify id 100 protocol 802.1Q priority 0 pipe.*index 100 ref", + "matchPattern": "action order [0-9]+: vlan.*modify id 100 protocol 802.1Q pipe.*index 100 ref", "matchCount": "0", "teardown": [ "$TC actions flush action vlan" @@ -487,7 +487,7 @@ "cmdUnderTest": "$TC actions add action vlan modify protocol 802.1ad id 500 reclassify index 12", "expExitCode": "0", "verifyCmd": "$TC actions get action vlan index 12", - "matchPattern": "action order [0-9]+: vlan.*modify id 500 protocol 802.1ad priority 0 reclassify.*index 12 ref", + "matchPattern": "action order [0-9]+: vlan.*modify id 500 protocol 802.1ad reclassify.*index 12 ref", "matchCount": "1", "teardown": [ "$TC actions flush action vlan" From patchwork Sun May 30 11:40:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Sukholitko X-Patchwork-Id: 450780 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75185C47093 for ; Sun, 30 May 2021 11:42:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 511FB60FDB for ; Sun, 30 May 2021 11:42:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbhE3Lnh (ORCPT ); Sun, 30 May 2021 07:43:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbhE3Lng (ORCPT ); Sun, 30 May 2021 07:43:36 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D996C061574 for ; Sun, 30 May 2021 04:41:58 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id e15so3816080plh.1 for ; Sun, 30 May 2021 04:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=C5vET+AXYEW91TYn85g/M8EW40hhV4DYIJr4nbEVFi8=; b=dvlyt70qfMRvOtGnqM8CtnFhtOA5R5czRmCoGvzaluzXC3TtmfgGrxxkHFTGJfQHyu ETiWxFLNX1LN8R44WanfzWhMEA8VTDPFUeYg2YdepcV4HL8tjwVVsjDC7y2MRCpCxQ13 Viz6osRokGisasn90zVBdJq5OosA4zEGoz1f8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=C5vET+AXYEW91TYn85g/M8EW40hhV4DYIJr4nbEVFi8=; b=gR7mRBY2MXpxVwBAQ7mlRRLIenR/RX8jWw20pMDcjOlEksiHT/OiBGLYueiyz1fD39 pdMy6CEcXyf5EozuW5P4b//cYgxP866NWqYfXgH2YaqDxbk+32V7hJ6wzk+FRIw+UAOr VKYYmrhCxZRxh4AZj7LnAbqme7bJObsHHcfaN7w1cF3l2FyFqFwoHG5r6QCLBIs64A0F zxiC81CCGzvU+g9ut6mU+9n3BKFuy0l5jL7Qubw0TKFEsxbWjeH88O8k+PMKkH1VKHvs UM+JrDFbeIrHvYWPlZ6QsZxa5nZHGYQw8SBtx3gIxnUcmNAXISBpeecpsE74EVHsNf1M lWRA== X-Gm-Message-State: AOAM533XuiGMsgYmeJ4L1D93gVP9CDf7o6fWvTH4hG/Arm3MEwOPPA4p ieKET3sVdSM4LUTV/0D0IYLDk1CF0F6FT1HLN1n1GdIxmgEPyScbzpRlw2+ZPyBiCX3/6AkSBOB 10sVNSM2J5tzpfJ5M1xFpdlF8utQpiB+dzFP6+9kZyEIDj4dQycuHI1a3hsFQugQWDfaUg1ioQI xMQKaAO2c= X-Google-Smtp-Source: ABdhPJx4xTut+yHm4h8qMCmSFgLyw60mUtmmpsUZ0a6cjaIwlAv2M3yqw6LlQvVf/0OI6e8HEOsOXA== X-Received: by 2002:a17:90a:d313:: with SMTP id p19mr14232222pju.175.1622374917665; Sun, 30 May 2021 04:41:57 -0700 (PDT) Received: from localhost.localdomain ([192.19.250.250]) by smtp.gmail.com with ESMTPSA id o17sm8126093pjp.33.2021.05.30.04.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 May 2021 04:41:57 -0700 (PDT) From: Boris Sukholitko To: netdev@vger.kernel.org, Jamal Hadi Salim , Jiri Pirko , Cong Wang Cc: linux-kselftest@vger.kernel.org, shuah@kernel.org, Ilya Lifshits , Shmulik Ladkani , Jakub Kicinski , Davide Caratti , Boris Sukholitko Subject: [PATCH net-next v3 3/3] net/sched: act_vlan: Test priority 0 modification Date: Sun, 30 May 2021 14:40:52 +0300 Message-Id: <20210530114052.16483-4-boris.sukholitko@broadcom.com> X-Mailer: git-send-email 2.29.3 In-Reply-To: <20210530114052.16483-1-boris.sukholitko@broadcom.com> References: <20210530114052.16483-1-boris.sukholitko@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Because explicitly being set, the priority 0 should appear in the output. Signed-off-by: Boris Sukholitko --- .../tc-testing/tc-tests/actions/vlan.json | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json b/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json index 1d9d261aa0b3..7467021b31ca 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json @@ -445,6 +445,30 @@ "matchCount": "0", "teardown": [] }, + { + "id": "ba5b", + "name": "Add vlan modify action for protocol 802.1Q setting priority 0", + "category": [ + "actions", + "vlan" + ], + "setup": [ + [ + "$TC actions flush action vlan", + 0, + 1, + 255 + ] + ], + "cmdUnderTest": "$TC actions add action vlan modify protocol 802.1Q id 5 priority 0 index 100", + "expExitCode": "0", + "verifyCmd": "$TC actions get action vlan index 100", + "matchPattern": "action order [0-9]+: vlan.*modify id 100 priority 0 protocol 802.1Q pipe.*index 100 ref", + "matchCount": "0", + "teardown": [ + "$TC actions flush action vlan" + ] + }, { "id": "6812", "name": "Add vlan modify action for protocol 802.1Q",