From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 20899A0543 for ; Tue, 21 Jun 2022 10:08:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B4F242B6D; Tue, 21 Jun 2022 10:08:11 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2064.outbound.protection.outlook.com [40.107.92.64]) by mails.dpdk.org (Postfix) with ESMTP id 3C2654282D for ; Tue, 21 Jun 2022 10:08:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WSVepUcuEEwVU9TxNqy0pep0BEaTmgtoGeY3pD5K1VzFjeCxuESsjakcX3Miw2dK1KTyRO5JZADYRvrfWZDaFZ+cGjS3XYYxqE90A0R5Z6uQlMtB7v65xZ8LaPnxjd20pTsKLH86kkUPsrvlSZfJ2iKAauiZLMGBh6phbkEleN9ftTZUx59RJm1R7BdqEJaCwl0EGGTX6293g7gXuQUACO+RYQs1TeJr9dFxwIFYVQqH7PTtwKNGEHAF7RWoLClLbDoViXTFFsypd/5nidnfp2fIwgtpGS4e7iYnmD2ODzznOiEV/zneOELDrr0BAHVChNcY1yyQy7ypb26ahM2jXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RxpDXVD9OlFMZyjUfjvJSW2xDQCg6HQ1GOCQ8tbIeq4=; b=lIwKjqNE135rH4RR9zv433Fu5+Cd666A56IgGc9dHog6rlf+sW5+zA8OlvjD6+MOpctMQRm6MoRTL5njrsPQxfPFApP/deYyIR2YpbXTrz9zxU8u3KOpqlWAnrm052HyHHAhZKS298ATQ8b9El2yyPga2h0fGQzOmDDX5yZHbU0SlX6jPv7eYOkIC56YJ7Ery5uXn7weXiKfmP5N1bpa5uSgo4njonai8SX0hl8SxieiUR5cpQvb6iYIx1dFY6/Zu5TfNnrcRPB+VqVc15PKjidp9XrHsU9oyyO80OW6J009MotQ4+b6EFZJKj2oDcYrsiCQmGQR4ExS2ujYHamnvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RxpDXVD9OlFMZyjUfjvJSW2xDQCg6HQ1GOCQ8tbIeq4=; b=l3mazq958QyIBpKPfZ0gOvAxdK+UZJnOjJKesPAoq9xBVYxQqleWL0r4J7OYerhM+fHe4xIIFPtPpjtJdlWgmT1UjbPOZ98hd1E5IennjWeqQ13ZZn8D5VJ0CNuRIf8vybWHwjWdkFe/n8Ru33yUgj6U+BQUNW6wMlvAs4/3GFxeufL10oVtK+3rw7VwVMqBa6fvPWqVmvmG80wPWB42LEHbCZjqh4pgzpIH/BXTD5j7V2WPfvhQMj5qMtzS4SFl0FAtNvE7PEtEk8Pt6Y8HbF0KcDv6Sjv1UCAr1z0hQCGsSobdCnVEIRDF/Qzvc7lkbxczcdtYJMy6MSMdPwHaJw== Received: from DM6PR07CA0092.namprd07.prod.outlook.com (2603:10b6:5:337::25) by CH2PR12MB4647.namprd12.prod.outlook.com (2603:10b6:610:b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.16; Tue, 21 Jun 2022 08:08:08 +0000 Received: from DM6NAM11FT066.eop-nam11.prod.protection.outlook.com (2603:10b6:5:337:cafe::58) by DM6PR07CA0092.outlook.office365.com (2603:10b6:5:337::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.20 via Frontend Transport; Tue, 21 Jun 2022 08:08:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT066.mail.protection.outlook.com (10.13.173.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:08:07 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:08:07 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 01:08:05 -0700 From: Xueming Li To: Konstantin Ananyev CC: Ido Goshen , dpdk stable Subject: patch 'acl: fix rules with 8-byte field size' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:02:04 +0300 Message-ID: <20220621080301.2315720-59-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 04f580a0-cadb-4f35-75ef-08da535d2ce9 X-MS-TrafficTypeDiagnostic: CH2PR12MB4647:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c6aH7R5OGSnrzSowrpAXnTR2sGJT/Nm2UVIiIw/BmWipMQGcy0+Thm9tvK9IOoU4k65OmZwj0A99w7Dc56PIICrJFvnV6mPt6oiU+eTphrgrccFk5qKmdksu4cKIdVZiH8HlwNo6ZVePN5yBk4IkSWnGmGPG4u5fGqCDqQQtTVAAdB4yX49V1wgSjqoxEkMNZ18qBUg5jjJRILqdVdYL7x5MkNfsLgDljoKyUnfldjy7abdEb7EmXOofbmFvfVRGF/4QXdNjgm39Iaa/4slx+9XnwjGDhtWlbascIM1DJFjQbFekHleIpNUr5RFfUvyDUGAgosIsWcDtlOamcjPVOFEHx8AgibiO0Y0cjGxXQDMkzq66qrIh0IFYrdOpyzbmXyt8ZEUWFKLMJY5PBp6/T4oC7NZBZkiDxGkuBeF3ixApnOfz2ehvSP1sLzzk33FRScvVxyKEyl7YpTenYY6QDwEnMP0sums442vQU7AEbqDbckiHjh64f+bH0YyuJfkcvQKmdaYLM5yZ0riniCWJAbbq+I3lyfYy4rPGYroypp3W3/ygMrn+1GAwgnixs1THkg9e9Ya6G00YBY5JpCGVyq23hJGXCl2XnCe4WR/QupVgLuzR1R8EKCBeuw3fkSN160j3Kc97ZtQ1qaPAtEjXERKqyixUBUlEJqtWyQ3NeETXccxbsIk46RaNeWeug7ca7WDPLnSCCyktyim6rI2dBA99HUHqGmRo5K6/CihhkYpZ13d562cFvC1TMKaQGeg2xRzsw7ZM3jJ49GMv9yey2A1eIFwffLRtaijB4/BSCHwm2HNX3IokNk1LHDPHlFAnnfBmofUyo6Lkeb72A917uHHWOeQ4OaBsFNN8M2uK7EvdsF9tZxqWONa0wz3SDx8QHiHNbiGdAh6qtMoipzNXqw== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(396003)(136003)(346002)(376002)(40470700004)(46966006)(36840700001)(86362001)(478600001)(8936002)(966005)(6286002)(26005)(40460700003)(53546011)(5660300002)(7696005)(2906002)(36860700001)(356005)(55016003)(82740400003)(81166007)(82310400005)(316002)(70206006)(6916009)(16526019)(40480700001)(336012)(47076005)(41300700001)(1076003)(2616005)(426003)(186003)(83380400001)(4326008)(8676002)(54906003)(70586007)(36756003)(23180200003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:08:07.5658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04f580a0-cadb-4f35-75ef-08da535d2ce9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT066.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4647 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/22. 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. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/3267a37602b7566f266b5ce276d6cba1e78ce648 Thanks. Xueming Li --- >From 3267a37602b7566f266b5ce276d6cba1e78ce648 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Sun, 15 May 2022 21:03:18 +0100 Subject: [PATCH] acl: fix rules with 8-byte field size Cc: Xueming Li [ upstream commit 451098159c2209bc5c395a30d2dae325af93e8c2 ] In theory ACL library allows fields with 8B long. Though in practice they usually not used, not tested, and as was revealed by Ido, this functionality is not working properly. There are few places inside ACL build code-path that need to be addressed. Bugzilla ID: 673 Fixes: dc276b5780c2 ("acl: new library") Reported-by: Ido Goshen Signed-off-by: Konstantin Ananyev Tested-by: Ido Goshen --- lib/librte_acl/acl_bld.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c index 7ea30f4186..2816632803 100644 --- a/lib/librte_acl/acl_bld.c +++ b/lib/librte_acl/acl_bld.c @@ -12,6 +12,9 @@ /* number of pointers per alloc */ #define ACL_PTR_ALLOC 32 +/* account for situation when all fields are 8B long */ +#define ACL_MAX_INDEXES (2 * RTE_ACL_MAX_FIELDS) + /* macros for dividing rule sets heuristics */ #define NODE_MAX 0x4000 #define NODE_MIN 0x800 @@ -80,7 +83,7 @@ struct acl_build_context { struct tb_mem_pool pool; struct rte_acl_trie tries[RTE_ACL_MAX_TRIES]; struct rte_acl_bld_trie bld_tries[RTE_ACL_MAX_TRIES]; - uint32_t data_indexes[RTE_ACL_MAX_TRIES][RTE_ACL_MAX_FIELDS]; + uint32_t data_indexes[RTE_ACL_MAX_TRIES][ACL_MAX_INDEXES]; /* memory free lists for nodes and blocks used for node ptrs */ struct acl_mem_block blocks[MEM_BLOCK_NUM]; @@ -988,7 +991,7 @@ build_trie(struct acl_build_context *context, struct rte_acl_build_rule *head, */ uint64_t mask; mask = RTE_ACL_MASKLEN_TO_BITMASK( - fld->mask_range.u32, + fld->mask_range.u64, rule->config->defs[n].size); /* gen a mini-trie for this field */ @@ -1301,6 +1304,9 @@ acl_build_index(const struct rte_acl_config *config, uint32_t *data_index) if (last_header != config->defs[n].input_index) { last_header = config->defs[n].input_index; data_index[m++] = config->defs[n].offset; + if (config->defs[n].size > sizeof(uint32_t)) + data_index[m++] = config->defs[n].offset + + sizeof(uint32_t); } } @@ -1487,7 +1493,7 @@ acl_set_data_indexes(struct rte_acl_ctx *ctx) memcpy(ctx->data_indexes + ofs, ctx->trie[i].data_index, n * sizeof(ctx->data_indexes[0])); ctx->trie[i].data_index = ctx->data_indexes + ofs; - ofs += RTE_ACL_MAX_FIELDS; + ofs += ACL_MAX_INDEXES; } } @@ -1643,7 +1649,7 @@ rte_acl_build(struct rte_acl_ctx *ctx, const struct rte_acl_config *cfg) /* allocate and fill run-time structures. */ rc = rte_acl_gen(ctx, bcx.tries, bcx.bld_tries, bcx.num_tries, bcx.cfg.num_categories, - RTE_ACL_MAX_FIELDS * RTE_DIM(bcx.tries) * + ACL_MAX_INDEXES * RTE_DIM(bcx.tries) * sizeof(ctx->data_indexes[0]), max_size); if (rc == 0) { /* set data indexes. */ -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:51.950916667 +0800 +++ 0058-acl-fix-rules-with-8-byte-field-size.patch 2022-06-21 15:37:49.077784727 +0800 @@ -1 +1 @@ -From 451098159c2209bc5c395a30d2dae325af93e8c2 Mon Sep 17 00:00:00 2001 +From 3267a37602b7566f266b5ce276d6cba1e78ce648 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 451098159c2209bc5c395a30d2dae325af93e8c2 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -19 +21 @@ - lib/acl/acl_bld.c | 14 ++++++++++---- + lib/librte_acl/acl_bld.c | 14 ++++++++++---- @@ -22 +24 @@ -diff --git a/lib/acl/acl_bld.c b/lib/acl/acl_bld.c +diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c @@ -24,2 +26,2 @@ ---- a/lib/acl/acl_bld.c -+++ b/lib/acl/acl_bld.c +--- a/lib/librte_acl/acl_bld.c ++++ b/lib/librte_acl/acl_bld.c