From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id D746E5681 for ; Tue, 20 Nov 2018 20:14:28 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46C33C059B9E; Tue, 20 Nov 2018 19:14:28 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B90E60141; Tue, 20 Nov 2018 19:14:27 +0000 (UTC) From: Kevin Traynor To: Konstantin Ananyev Cc: dpdk stable Date: Tue, 20 Nov 2018 19:11:56 +0000 Message-Id: <20181120191252.30277-6-ktraynor@redhat.com> In-Reply-To: <20181120191252.30277-1-ktraynor@redhat.com> References: <20181120191252.30277-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 20 Nov 2018 19:14:28 +0000 (UTC) Subject: [dpdk-stable] patch 'acl: forbid rule with priority zero' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:14:29 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/23/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 092b3294a61c625de69ecfad3e2e938111bfdd97 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Fri, 24 Aug 2018 17:47:06 +0100 Subject: [PATCH] acl: forbid rule with priority zero [ upstream commit 53945477981cf75cf8d66e67a098b486e37df167 ] If user specifies priority=0 for some of ACL rules that can cause rte_acl_classify to return wrong results. The reason is that priority zero is used internally for no-match nodes. See more details at: https://bugs.dpdk.org/show_bug.cgi?id=79. The simplest way to overcome the issue is just not allow zero to be a valid priority for the rule. Fixes: dc276b5780c2 ("acl: new library") Signed-off-by: Konstantin Ananyev --- lib/librte_acl/rte_acl.h | 2 +- test/test/test_acl.h | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h index 34c3b9c6a..aa22e70c6 100644 --- a/lib/librte_acl/rte_acl.h +++ b/lib/librte_acl/rte_acl.h @@ -89,5 +89,5 @@ enum { RTE_ACL_MAX_INDEX = RTE_LEN2MASK(RTE_ACL_TYPE_SHIFT, uint32_t), RTE_ACL_MAX_PRIORITY = RTE_ACL_MAX_INDEX, - RTE_ACL_MIN_PRIORITY = 0, + RTE_ACL_MIN_PRIORITY = 1, }; diff --git a/test/test/test_acl.h b/test/test/test_acl.h index c4811c8f5..bbb0447a8 100644 --- a/test/test/test_acl.h +++ b/test/test/test_acl.h @@ -81,10 +81,12 @@ struct rte_acl_ipv4vlan_rule invalid_layout_rules[] = { /* test src and dst address */ { - .data = {.userdata = 1, .category_mask = 1}, + .data = {.userdata = 1, .category_mask = 1, + .priority = 1}, .src_addr = IPv4(10,0,0,0), .src_mask_len = 24, }, { - .data = {.userdata = 2, .category_mask = 1}, + .data = {.userdata = 2, .category_mask = 1, + .priority = 1}, .dst_addr = IPv4(10,0,0,0), .dst_mask_len = 24, @@ -92,10 +94,12 @@ struct rte_acl_ipv4vlan_rule invalid_layout_rules[] = { /* test src and dst ports */ { - .data = {.userdata = 3, .category_mask = 1}, + .data = {.userdata = 3, .category_mask = 1, + .priority = 1}, .dst_port_low = 100, .dst_port_high = 100, }, { - .data = {.userdata = 4, .category_mask = 1}, + .data = {.userdata = 4, .category_mask = 1, + .priority = 1}, .src_port_low = 100, .src_port_high = 100, @@ -103,10 +107,12 @@ struct rte_acl_ipv4vlan_rule invalid_layout_rules[] = { /* test proto */ { - .data = {.userdata = 5, .category_mask = 1}, + .data = {.userdata = 5, .category_mask = 1, + .priority = 1}, .proto = 0xf, .proto_mask = 0xf }, { - .data = {.userdata = 6, .category_mask = 1}, + .data = {.userdata = 6, .category_mask = 1, + .priority = 1}, .dst_port_low = 0xf, .dst_port_high = 0xf, -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-20 17:53:07.618425495 +0000 +++ 0006-acl-forbid-rule-with-priority-zero.patch 2018-11-20 17:53:07.000000000 +0000 @@ -1,8 +1,10 @@ -From 53945477981cf75cf8d66e67a098b486e37df167 Mon Sep 17 00:00:00 2001 +From 092b3294a61c625de69ecfad3e2e938111bfdd97 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Fri, 24 Aug 2018 17:47:06 +0100 Subject: [PATCH] acl: forbid rule with priority zero +[ upstream commit 53945477981cf75cf8d66e67a098b486e37df167 ] + If user specifies priority=0 for some of ACL rules that can cause rte_acl_classify to return wrong results. The reason is that priority zero is used internally for no-match nodes. @@ -11,7 +13,6 @@ to be a valid priority for the rule. Fixes: dc276b5780c2 ("acl: new library") -Cc: stable@dpdk.org Signed-off-by: Konstantin Ananyev ---