From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 2B7504C8D for ; Wed, 3 Oct 2018 18:21:27 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id e4-v6so6851064wrs.0 for ; Wed, 03 Oct 2018 09:21:27 -0700 (PDT) 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:content-transfer-encoding; bh=2it7rbB6Uq4MIpS1KQnLgNUZCZ2x0CNen6kLg5Fl2lo=; b=cajl9bTVNUYxi/Vs3e2NjLgFOSgpLjCiol9oO8hAkJXdOt/ThAodY3fZtNbj8xBckF B5ptSyMPw5RTD7YGhiCjuXQ1eWESQhP78agO/EClbraMr16jZoe9caBAbM36fRqpKfVu Iw3coi+Y2MlCc0c2vaLpVs0tPDEViYIkfD54SfEMXUKFXlfMkAS3Mg2zlIstNa1xYZLo AlQLXmY8GnIuFy0sGykMRLn5Ctew1mkv6FEFR34/cK4uKyPSBfUhRcyRy+N/GTy/xGD7 yQMjoFo8WW+1RcEDiM/jU8dnc7AZ6a0RRydSPCEo/uSUxEHu6TwPrmSEd06M0JXxrE6W 7aeg== X-Gm-Message-State: ABuFfog3V+4g0M/Id1zY2fjAxEMn1erKTjGrgJBNJAbTVSCLWgkDSKgI VljciSCIRI/pG5P4dhNI2+I= X-Google-Smtp-Source: ACcGV63h1Dn/bO2+tATKQxjTvGFvSs8WqxT3wfE0C6IXdEqS8D1kH5SewMMjtCokmcMsCmTGX6R+VA== X-Received: by 2002:adf:e212:: with SMTP id j18-v6mr1880997wri.205.1538583686725; Wed, 03 Oct 2018 09:21:26 -0700 (PDT) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id i15-v6sm1028468wro.58.2018.10.03.09.21.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Oct 2018 09:21:25 -0700 (PDT) From: Luca Boccassi To: Konstantin Ananyev Cc: dpdk stable Date: Wed, 3 Oct 2018 17:21:21 +0100 Message-Id: <20181003162121.16364-1-bluca@debian.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927084403.19646-1-bluca@debian.org> References: <20180927084403.19646-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'acl: forbid rule with priority zero' has been queued to LTS release 16.11.9 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: Wed, 03 Oct 2018 16:21:27 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/05/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. Luca Boccassi --- >>From 255cbcecfa25b39efb7982e28642ec5c51278f6c 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 --- app/test/test_acl.h | 18 ++++++++++++------ lib/librte_acl/rte_acl.h | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/test/test_acl.h b/app/test/test_acl.h index 421f3109b3..6f5c485ad9 100644 --- a/app/test/test_acl.h +++ b/app/test/test_acl.h @@ -109,34 +109,40 @@ enum { 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, }, /* 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, }, /* 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, } diff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h index caa91f7eab..39686d51f3 100644 --- a/lib/librte_acl/rte_acl.h +++ b/lib/librte_acl/rte_acl.h @@ -117,7 +117,7 @@ enum { RTE_ACL_TYPE_SHIFT = 29, 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, }; #define RTE_ACL_INVALID_USERDATA 0 -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-10-03 17:20:56.869131226 +0100 +++ 0001-acl-forbid-rule-with-priority-zero.patch 2018-10-03 17:20:56.850109710 +0100 @@ -1,8 +1,10 @@ -From 53945477981cf75cf8d66e67a098b486e37df167 Mon Sep 17 00:00:00 2001 +From 255cbcecfa25b39efb7982e28642ec5c51278f6c 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,32 +13,18 @@ to be a valid priority for the rule. Fixes: dc276b5780c2 ("acl: new library") -Cc: stable@dpdk.org Signed-off-by: Konstantin Ananyev --- + app/test/test_acl.h | 18 ++++++++++++------ 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 34c3b9c6a3..aa22e70c6e 100644 ---- a/lib/librte_acl/rte_acl.h -+++ b/lib/librte_acl/rte_acl.h -@@ -88,7 +88,7 @@ enum { - RTE_ACL_TYPE_SHIFT = 29, - 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, - }; - - #define RTE_ACL_MASKLEN_TO_BITMASK(v, s) \ -diff --git a/test/test/test_acl.h b/test/test/test_acl.h -index c4811c8f5f..bbb0447a89 100644 ---- a/test/test/test_acl.h -+++ b/test/test/test_acl.h -@@ -80,34 +80,40 @@ enum { +diff --git a/app/test/test_acl.h b/app/test/test_acl.h +index 421f3109b3..6f5c485ad9 100644 +--- a/app/test/test_acl.h ++++ b/app/test/test_acl.h +@@ -109,34 +109,40 @@ enum { struct rte_acl_ipv4vlan_rule invalid_layout_rules[] = { /* test src and dst address */ { @@ -83,6 +71,19 @@ .dst_port_low = 0xf, .dst_port_high = 0xf, } +diff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h +index caa91f7eab..39686d51f3 100644 +--- a/lib/librte_acl/rte_acl.h ++++ b/lib/librte_acl/rte_acl.h +@@ -117,7 +117,7 @@ enum { + RTE_ACL_TYPE_SHIFT = 29, + 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, + }; + + #define RTE_ACL_INVALID_USERDATA 0 -- 2.19.0