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 511B242D46 for ; Sun, 25 Jun 2023 08:43:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B78D40ED8; Sun, 25 Jun 2023 08:43:37 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2061.outbound.protection.outlook.com [40.107.237.61]) by mails.dpdk.org (Postfix) with ESMTP id E0F0E40A7F for ; Sun, 25 Jun 2023 08:43:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lkgOn0Owpwj3fLWdUxLxiw4iV9J1au+Bbxq/0t53vo1nIjLQrXPVNs9GNO+7gZv0KGAjxs/ptgaJ6KlpNMERYmhK+FFbotQ1OlyXnuKjKf9HRTgA1hmVeOL//KIhPsS5Pz7rKMtOOaP6xUQ16HVb+ZF1WtPc9vc0G3jjh48kS4hrp12nq0cbSZOJlTFEmpOGUcgGHuVlANoO0TmWAmk4B+QYAPFLPA+S+nDl4KQD5zO2SKdkKJZyNp9XyGzJiUjX2p0IOS7zuiXk4yOMAlRKCEa6a6pwJoIYFICRCKNbxTOOi6hXdkdCb83mPUZHLv040jETMz3OXnFVtISO1NDVAw== 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=Tj8Go3hxdavKKKkiJmmbwD6IhPmoVPGrTVg3SLNtnqg=; b=aQFaWSwPInZonwmVKAn42ONhR6uWYsIKikhCGAzjrgvLotXURnowdedW01gTWqb/TDhfRzJ7xpCcsfGXRInfhw8IIFnurinUb5wHlcPPJmSkze1ShtLPElHS0Sd78NErl1ZYitPZFSe9ZgC3Zz7TqTiHt8SPQ5YaKttN/+lxPMZPY1oCg62ftUrwuhNv6tDfhr0kdpEylY7xA0wT/EUtyqgDGabRI++nYQ0UKnKFDxQfG6gRg7mDzdGKHTLHke78NA9TzV7D7dLVg67vkPU/ACfsUl4TT1Gz9vHqBEYHgJL1u4YrXkbc/8gbm/TuXU7NJzOMBCXD7wGADYG7a/Lw7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=Tj8Go3hxdavKKKkiJmmbwD6IhPmoVPGrTVg3SLNtnqg=; b=SZlM0uqDD+ixtjP1lh1EKwnudvccjlUp/mMuwKAM6vA2/oeA6IDf51E+or6NV3ZS9y+cim6lXsoik0LrZCCBfYekpyjCw5i9GRev8IerZqQMKAQ/3fZ6dQHDc6xWQoAVwGJp1z1T9B7qLkxCU1lreOxqmLNq4DucEaIviXgenxzuXONF1nvYxQY4v3w+WnZVrodgk0PFREdIyRAGKZDLrcUnl1cByx2Z9hoXMTvx657G/i2AfE9kSxp1ychxZx6LED/lngaaq1WguQeeOwwEsgS4irlbm/w2+tU4L/2M4S3TRcPNWKN7QCxyyEKFIj66wcpa1sojY4z5QiGboQIheA== Received: from MW4P223CA0012.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::17) by DS7PR12MB6189.namprd12.prod.outlook.com (2603:10b6:8:9a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Sun, 25 Jun 2023 06:43:33 +0000 Received: from CO1NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::8c) by MW4P223CA0012.outlook.office365.com (2603:10b6:303:80::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.32 via Frontend Transport; Sun, 25 Jun 2023 06:43:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT009.mail.protection.outlook.com (10.13.175.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.47 via Frontend Transport; Sun, 25 Jun 2023 06:43:33 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sat, 24 Jun 2023 23:43:27 -0700 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.37; Sat, 24 Jun 2023 23:43:26 -0700 From: Xueming Li To: Rongwei Liu CC: Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix matcher layout size calculation' has been queued to stable release 22.11.3 Date: Sun, 25 Jun 2023 14:35:06 +0800 Message-ID: <20230625063544.11183-89-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230625063544.11183-1-xuemingl@nvidia.com> References: <20230625063544.11183-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-TrafficTypeDiagnostic: CO1NAM11FT009:EE_|DS7PR12MB6189:EE_ X-MS-Office365-Filtering-Correlation-Id: 6aedb086-6256-4dd5-f064-08db75477eba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ne0Ct8v4fRBPHQku0eDBFct1QoJyvEuTQcISa4KZw3cdX0gGgBRJJpQ96o4ADdFoBvxO+yO+KkkDrcC7s+kuMD5/X3QYz8RcCEwePR8GR7IRC4fCYmAdj2yy43h01t3YDCwP6TlOav8arRDonxMQiuqZiR7DVl+nIAKY50JjFA2pUsptNYc1LLrLb+Z6cEIA1gv/d2GYgggf+4vL8qJORHdMHIOFRQKcBnOZXOjy+CFRCFPjKQ0IzgZ1in1oMPYI68BDjMHJuqFkrTjgsN0+4+FrPHKBepbp+goKi1SnUgTYkxRLb7XJ4k6u0jcqwMR87YjLrVR83A3+IIa+amrTY6QkxGHvy17bQ4WpawQRuGyiZlY09/vyqmagmBPL12waMoX5C/M0W+fJdT6N3EUc3Yz+EH40KeELGCZJv61oLmPjJ84TM+GH9NqTJDZhMdvprOTAvSpFE/g+5abTTrBTZWhzMh8gjS0CXzHf5rsNQmI26jFpJ/8pNc/f3UOSdOEC3MGzgUarqkzVyZbtXuH0fFkS/AVyRsk4WWyz6Dmr5Pwo/iPg7djDxeVL4l42kN79UFV0jOKM/UODwadG80jEuRbJbke2Y5KlMgcdwEVDaChrj+XFYFZxJ1w3vLEchUUJcokAqlBTh8XlGTBrUAf8MwTvKGJ2oIcYEdcf17B2UGYkzWHgaOmuHnQkJr583C1D/bLWU+djBwjxM7cnj75LVInMgdYkVkkDRRH7n9b4A8JLZ//2+hpHyrFXvNZnkE1ARh7mMB1oJA1EetqhJoC1Uw== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(136003)(346002)(396003)(39860400002)(376002)(451199021)(40470700004)(36840700001)(46966006)(36860700001)(82310400005)(47076005)(966005)(478600001)(7696005)(6666004)(2616005)(54906003)(37006003)(426003)(83380400001)(336012)(26005)(53546011)(1076003)(186003)(16526019)(6286002)(2906002)(5660300002)(6862004)(40460700003)(36756003)(70206006)(356005)(4326008)(6636002)(7636003)(70586007)(82740400003)(55016003)(40480700001)(316002)(86362001)(8936002)(8676002)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2023 06:43:33.1115 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6aedb086-6256-4dd5-f064-08db75477eba X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT009.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6189 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 22.11.3 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/27/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=2e6f71cb519bae6da63cbb0d48070b4ab14e26a2 Thanks. Xueming Li --- >From 2e6f71cb519bae6da63cbb0d48070b4ab14e26a2 Mon Sep 17 00:00:00 2001 From: Rongwei Liu Date: Tue, 16 May 2023 08:40:52 +0300 Subject: [PATCH] net/mlx5: fix matcher layout size calculation Cc: Xueming Li [ upstream commit ebc352c77fd1bc6c2fbfa668bb92fa4b06e63146 ] Initially, the rdma-core library only supported misc0 to misc3 fields in matching resources, misc4 and misc5 fields were added to handle new features. The matcher layout, passing from DPDK to rdma-core, shouldn't exceed the size of the engaged library version capabilities. For now, there is no way to know what is the maximum capability of rdma-core, and DPDK should limit the matcher layout to misc3 if possible (no matching on fields misc4 and misc5 are requested by the application). The check if misc4 and misc5 features were requested was based on checking the values against zeroes. The matching mask should be checked instead. Fixes: 630a587bfb37 ("net/mlx5: support matching on VXLAN reserved field") Signed-off-by: Rongwei Liu Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 7ca909999b..12db56f173 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -14825,7 +14825,7 @@ flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, } dv->actions[n++] = priv->sh->default_miss_action; } - misc_mask = flow_dv_matcher_enable(dv->value.buf); + misc_mask = flow_dv_matcher_enable(dv_h->matcher->mask.buf); __flow_dv_adjust_buf_size(&dv->value.size, misc_mask); err = mlx5_flow_os_create_flow(dv_h->matcher->matcher_object, (void *)&dv->value, n, @@ -17025,7 +17025,7 @@ flow_dv_destroy_def_policy(struct rte_eth_dev *dev) static int __flow_dv_create_policy_flow(struct rte_eth_dev *dev, uint32_t color_reg_c_idx, - enum rte_color color, void *matcher_object, + enum rte_color color, struct mlx5_flow_dv_matcher *matcher, int actions_n, void *actions, bool match_src_port, const struct rte_flow_item *item, void **rule, const struct rte_flow_attr *attr) @@ -17055,9 +17055,9 @@ __flow_dv_create_policy_flow(struct rte_eth_dev *dev, } flow_dv_match_meta_reg(value.buf, (enum modify_reg)color_reg_c_idx, rte_col_2_mlx5_col(color), UINT32_MAX); - misc_mask = flow_dv_matcher_enable(value.buf); + misc_mask = flow_dv_matcher_enable(matcher->mask.buf); __flow_dv_adjust_buf_size(&value.size, misc_mask); - ret = mlx5_flow_os_create_flow(matcher_object, (void *)&value, + ret = mlx5_flow_os_create_flow(matcher->matcher_object, (void *)&value, actions_n, actions, rule); if (ret) { DRV_LOG(ERR, "Failed to create meter policy%d flow.", color); @@ -17211,7 +17211,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, /* Create flow, matching color. */ if (__flow_dv_create_policy_flow(dev, color_reg_c_idx, (enum rte_color)i, - color_rule->matcher->matcher_object, + color_rule->matcher, acts[i].actions_n, acts[i].dv_actions, svport_match, NULL, &color_rule->rule, &attr)) { @@ -17679,7 +17679,7 @@ flow_dv_create_mtr_tbls(struct rte_eth_dev *dev, actions[i++] = priv->sh->dr_drop_action; flow_dv_match_meta_reg_all(matcher_para.buf, value.buf, (enum modify_reg)mtr_id_reg_c, 0, 0); - misc_mask = flow_dv_matcher_enable(value.buf); + misc_mask = flow_dv_matcher_enable(mtrmng->def_matcher[domain]->mask.buf); __flow_dv_adjust_buf_size(&value.size, misc_mask); ret = mlx5_flow_os_create_flow (mtrmng->def_matcher[domain]->matcher_object, @@ -17724,7 +17724,7 @@ flow_dv_create_mtr_tbls(struct rte_eth_dev *dev, fm->drop_cnt, NULL); actions[i++] = cnt->action; actions[i++] = priv->sh->dr_drop_action; - misc_mask = flow_dv_matcher_enable(value.buf); + misc_mask = flow_dv_matcher_enable(drop_matcher->mask.buf); __flow_dv_adjust_buf_size(&value.size, misc_mask); ret = mlx5_flow_os_create_flow(drop_matcher->matcher_object, (void *)&value, i, actions, @@ -18204,7 +18204,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev, goto err_exit; } if (__flow_dv_create_policy_flow(dev, color_reg_c_idx, (enum rte_color)j, - color_rule->matcher->matcher_object, + color_rule->matcher, acts.actions_n, acts.dv_actions, true, item, &color_rule->rule, &attr)) { rte_spinlock_unlock(&mtr_policy->sl); @@ -19248,7 +19248,7 @@ flow_dv_discover_priorities(struct rte_eth_dev *dev, break; } /* Try to apply the flow to HW. */ - misc_mask = flow_dv_matcher_enable(flow.dv.value.buf); + misc_mask = flow_dv_matcher_enable(flow.handle->dvh.matcher->mask.buf); __flow_dv_adjust_buf_size(&flow.dv.value.size, misc_mask); err = mlx5_flow_os_create_flow (flow.handle->dvh.matcher->matcher_object, -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-25 14:32:00.852383700 +0800 +++ 0088-net-mlx5-fix-matcher-layout-size-calculation.patch 2023-06-25 14:31:58.475773900 +0800 @@ -1 +1 @@ -From ebc352c77fd1bc6c2fbfa668bb92fa4b06e63146 Mon Sep 17 00:00:00 2001 +From 2e6f71cb519bae6da63cbb0d48070b4ab14e26a2 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit ebc352c77fd1bc6c2fbfa668bb92fa4b06e63146 ] @@ -20 +22,0 @@ -Cc: stable@dpdk.org @@ -29 +31 @@ -index 70a5f4858c..e7a2ae933c 100644 +index 7ca909999b..12db56f173 100644 @@ -32 +34 @@ -@@ -15157,7 +15157,7 @@ flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, +@@ -14825,7 +14825,7 @@ flow_dv_apply(struct rte_eth_dev *dev, struct rte_flow *flow, @@ -41 +43 @@ -@@ -17357,7 +17357,7 @@ flow_dv_destroy_def_policy(struct rte_eth_dev *dev) +@@ -17025,7 +17025,7 @@ flow_dv_destroy_def_policy(struct rte_eth_dev *dev) @@ -50 +52 @@ -@@ -17387,9 +17387,9 @@ __flow_dv_create_policy_flow(struct rte_eth_dev *dev, +@@ -17055,9 +17055,9 @@ __flow_dv_create_policy_flow(struct rte_eth_dev *dev, @@ -62 +64 @@ -@@ -17543,7 +17543,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, +@@ -17211,7 +17211,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, @@ -71 +73 @@ -@@ -18011,7 +18011,7 @@ flow_dv_create_mtr_tbls(struct rte_eth_dev *dev, +@@ -17679,7 +17679,7 @@ flow_dv_create_mtr_tbls(struct rte_eth_dev *dev, @@ -80 +82 @@ -@@ -18056,7 +18056,7 @@ flow_dv_create_mtr_tbls(struct rte_eth_dev *dev, +@@ -17724,7 +17724,7 @@ flow_dv_create_mtr_tbls(struct rte_eth_dev *dev, @@ -89 +91 @@ -@@ -18536,7 +18536,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev, +@@ -18204,7 +18204,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev, @@ -98 +100 @@ -@@ -19580,7 +19580,7 @@ flow_dv_discover_priorities(struct rte_eth_dev *dev, +@@ -19248,7 +19248,7 @@ flow_dv_discover_priorities(struct rte_eth_dev *dev,