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 BF07B455E3; Tue, 9 Jul 2024 14:32:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6C5F410FD; Tue, 9 Jul 2024 14:32:18 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2058.outbound.protection.outlook.com [40.107.223.58]) by mails.dpdk.org (Postfix) with ESMTP id 4ABD842D7B; Tue, 9 Jul 2024 14:32:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MuFlrJZ2NIjo+UTSGZTuZaByOwQLgu3F6deMiA2n9vW+43dllboqfZVOYTBSV9dLaggiZA+QG5Dh6adEyZFc2cCfZhoniOu5rEWa+oorgZgCEFrCIO5kwtlSp4nLq7M56WKRTq5tEPH7Em/rt1SEsGPnsn8/5Pv/6OWw2aQkPXzEPDnPU/JRJzfxIkfpK0arNrjDa/J7oXfTN/IoYiLFsCE8EOdvOfecT1Ev0qd9BS/cPV24lEBNOF5VJWaGti8FY7bdRufnm4EwrA8mbXZHPVU5MwMKsqrKyfXIcmXJpgdU/RCJzGdpzD1Wm51AP6NEUTOlUh4Ql2xq4FCAbMv9HA== 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=lh0JzjEswFsxkTTE/KqualtgXsT9NXs9lNmZKbgrwxs=; b=J7AzkxoAd2eGx0ET4QjHzErN9M8LoPJlwBxu/t11FcyECls4wHj4d3Y7eZbfWPdE2FtFiczXwA/fO9dapB2tkW0rqCU6KDPKGemw9QoqmkRN9gZWemZmaLiFWWPwD2feDu4zXCYd3y3Bley4R7V8EmeOyJ+SeEVFMyaFKgb0dW0dUBE/xsgeM5aUPrCd/nA0npO0l6DCLc1k7QgEPYX8pgsT5eK8sj/RwtV1YGESGLlthXok2AaUqsHITn69tU1lQhcqgBLNGBrSn4JMyfeu3Qpoc9HzeaPd6kYVxALQdfmRYYngRNWKOKdksvkCdzpJXvRDw04WE2HXYHlCJi6iOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net 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 (0) 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=lh0JzjEswFsxkTTE/KqualtgXsT9NXs9lNmZKbgrwxs=; b=RsSouAZMPN7LmHrrhxV7DR9hlIXtpTZ/tW/8oOecTjezn8qMc9284hbC1nVHX7YvEMLhFpy0qNVraoAuWj43bFvIKcOuG28FdMS0roxUj9Tfp83TAA0DjagprNHr+mgJjuJIoH8PuBVrBCwMimz2nEuZTDz/c4qucjGHiLVCVv9zlsMZ547OHwSxJHanvnuzPVZ0y1Hml2ozECNBSA3MYJS95lOHUtXa0d8J5EOCcaacY/gBFcc4MhPvvHk3W6GRV2cox/rExUfyDuzx1ulKeY2rIzodElSH03Yj12a6tQ+7+uXDHl1Ed9+ihlYOuBDZuFb1UXPNEMyo7hJhzLSGrQ== Received: from BL0PR01CA0005.prod.exchangelabs.com (2603:10b6:208:71::18) by DS7PR12MB5839.namprd12.prod.outlook.com (2603:10b6:8:7a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Tue, 9 Jul 2024 12:32:09 +0000 Received: from BL6PEPF0001AB59.namprd02.prod.outlook.com (2603:10b6:208:71:cafe::12) by BL0PR01CA0005.outlook.office365.com (2603:10b6:208:71::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36 via Frontend Transport; Tue, 9 Jul 2024 12:32:09 +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 BL6PEPF0001AB59.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Tue, 9 Jul 2024 12:32:09 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) 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.1544.4; Tue, 9 Jul 2024 05:31:35 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 9 Jul 2024 05:31:34 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Tue, 9 Jul 2024 05:31:30 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH 5/8] net/mlx5/hws: fix incorrect port ID on root item convert Date: Tue, 9 Jul 2024 15:31:00 +0300 Message-ID: <20240709123103.2101902-6-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240709123103.2101902-1-igozlan@nvidia.com> References: <20240707102532.2045942-10-igozlan@nvidia.com> <20240709123103.2101902-1-igozlan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB59:EE_|DS7PR12MB5839:EE_ X-MS-Office365-Filtering-Correlation-Id: 6aae3939-0e51-42d2-19ff-08dca01326a6 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?6k8fgjFt248OVNr15qbXNrEOQFk+ukroJnM6pbn5sTho/JFlnTCVtfuiY+iQ?= =?us-ascii?Q?kQ5vKrr0BMDYUFPOdjKujH8GApxEC4+WktxJ4XdhooGzrsz8K/7jW95uT2V8?= =?us-ascii?Q?Cy4jB5jQ3Sauh2fXc2ccGwE8MuB6C5g57W/go8tq4vjcnYnxBrfDcHQoWbkT?= =?us-ascii?Q?3A9cRcoW/8NMhGNl+tFKpRDE8rIls3m038p7HNEW8T53pdRSI1slOKVfxwkr?= =?us-ascii?Q?b2bYBTlZFQxl8c2gGd6wpVIfrR23/46LPnlpJ4TiCciZtQGGrJI220OvPR8p?= =?us-ascii?Q?U/kdqlraasKokS5VY0NiZJPKYuhTziFaxUuUhjcXKLV1Y76OKG7gx3hVXDL1?= =?us-ascii?Q?/oWvdB1gHuOntx4ak/5vHvS+052cJF/Z/ghhoxt8n11nrS7Y2TCVRgb+87zv?= =?us-ascii?Q?kGtu32UW2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p697j1+b/?= =?us-ascii?Q?SSloWo+YEUwE1H/rPglVE8hLWgUg15XomJjaaC37GcNA4/NURjA+LbzWcp5l?= =?us-ascii?Q?TIfJza3NzTMaYJVYklTn4+cpQtc87knAS25PzaBDzA06J0X41HEzbmL31fPJ?= =?us-ascii?Q?xfQiOrZqKkmxtba5BveRjDbC5CafGqVN?= 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:(13230040)(376014)(1800799024)(36860700013)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 12:32:09.0979 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6aae3939-0e51-42d2-19ff-08dca01326a6 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: BL6PEPF0001AB59.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5839 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Alex Vesker When calling item convert function we need to pass the port_id in the attributes. This value should be passed not only for cases that match on PORT related items, to resolve we will always pass it. Fixes: 572fe9ef2f46 ("net/mlx5/hws: fix port ID for root table") Cc: erezsh@nvidia.com Cc: stable@dpdk.org Signed-off-by: Alex Vesker Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_matcher.c | 20 +++++--------------- drivers/net/mlx5/hws/mlx5dr_rule.c | 22 ++++++---------------- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c index 6a939eb031..dfa2cd435c 100644 --- a/drivers/net/mlx5/hws/mlx5dr_matcher.c +++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c @@ -1231,7 +1231,6 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) struct mlx5dv_flow_match_parameters *mask; struct mlx5_flow_attr flow_attr = {0}; struct rte_flow_error rte_error; - struct rte_flow_item *item; uint8_t match_criteria; int ret; @@ -1260,20 +1259,11 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher) return rte_errno; } - /* We need the port id in case of matching representor */ - item = matcher->mt[0].items; - while (item->type != RTE_FLOW_ITEM_TYPE_END) { - if (item->type == RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR || - item->type == RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT) { - ret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id); - if (ret) { - DR_LOG(ERR, "Failed to get port id for dev %s", - ctx->ibv_ctx->device->name); - rte_errno = EINVAL; - return rte_errno; - } - } - ++item; + ret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id); + if (ret) { + DR_LOG(ERR, "Failed to get port id for dev %s", ctx->ibv_ctx->device->name); + rte_errno = EINVAL; + return rte_errno; } mask = simple_calloc(1, MLX5_ST_SZ_BYTES(fte_match_param) + diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c index 06d8e66f63..1edb7eac74 100644 --- a/drivers/net/mlx5/hws/mlx5dr_rule.c +++ b/drivers/net/mlx5/hws/mlx5dr_rule.c @@ -694,29 +694,19 @@ int mlx5dr_rule_create_root_no_comp(struct mlx5dr_rule *rule, struct mlx5dr_rule_action rule_actions[]) { struct mlx5dv_flow_matcher *dv_matcher = rule->matcher->dv_matcher; + struct mlx5dr_context *ctx = rule->matcher->tbl->ctx; struct mlx5dv_flow_match_parameters *value; struct mlx5_flow_attr flow_attr = {0}; struct mlx5dv_flow_action_attr *attr; - const struct rte_flow_item *cur_item; struct rte_flow_error error; uint8_t match_criteria; int ret; - /* We need the port id in case of matching representor */ - cur_item = items; - while (cur_item->type != RTE_FLOW_ITEM_TYPE_END) { - if (cur_item->type == RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR || - cur_item->type == RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT) { - ret = flow_hw_get_port_id_from_ctx(rule->matcher->tbl->ctx, - &flow_attr.port_id); - if (ret) { - DR_LOG(ERR, "Failed to get port id for dev %s", - rule->matcher->tbl->ctx->ibv_ctx->device->name); - rte_errno = EINVAL; - return rte_errno; - } - } - ++cur_item; + ret = flow_hw_get_port_id_from_ctx(ctx, &flow_attr.port_id); + if (ret) { + DR_LOG(ERR, "Failed to get port id for dev %s", ctx->ibv_ctx->device->name); + rte_errno = EINVAL; + return rte_errno; } attr = simple_calloc(num_actions, sizeof(*attr)); -- 2.39.3