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 7560A455B6; Sun, 7 Jul 2024 12:26:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA5D240ECF; Sun, 7 Jul 2024 12:26:17 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2052.outbound.protection.outlook.com [40.107.220.52]) by mails.dpdk.org (Postfix) with ESMTP id 5FA3940BA2; Sun, 7 Jul 2024 12:26:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pt0MCOWer/Ikg8M23wNe5W6yPJJP7hR+h7Kr3d81fRN0zW8xp2H9iKnpNpe/h4ISWTYYmf7nWheH732tkMINpvBJv3HipH0t8s6SBAxb1njUWNbr8nSsFz8rd/1fz1b7mGRNIJkt9ikl4leEWqeSpWA9EAKtOIdza27dlVK1mdolaV/VyDD+fleWP+TeYzaI666b0bQ3wrur6TsQ3fn0sufx/+T1DnppegW0aF29A9Kcx9OYcnvsn+ewDqWtD02Q/TRI5/A7HWtUxtjiKQJMkUbZZ3TcZYwLkm6r12lOd917NcIDGbE22rIGpNpW8cMUSbECvHbKWVpHX1TXVzXYVg== 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=EK4uFjb3xFH/Sf38+lG21KUnePicx8O4mj7v04Q8/LQhcmd7tSCFkTdFXiKKCiYdZCrnuEQhk7tIOdT8lgPKTzQsdqcMd8CuunDlk+/DvmtAF2CJUNseyMM7XnBRxRhMF2ke41ahoUNQrAGaus/MGxnzXRr1valI57sT64v5ys8FPtKvjWs1EE1OcFHjCmYuakifu6Ps9yzPUEibWq1KY673jPq5bd8lnW+EZf1uCUO1cY1F0TTj+LGMYZSm5/MOsXRmsxWErArXZDawwj292gyiLE8KoK5OKzgbYr+mHDW9ok676LRTv6JmjFpcwOJ4zDPDI47dSgRYvYI/vj3BtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=mVVC7f/sDW9KB2ejt0Cem7+IhDsiUf3KmydjZ8BGbZxywYwz7HvaCy3/ow2rYSCuu9a+k6l+3JJa7falawh6k4smJMcdbkbd8NM4RgItChdAnThNKEZXZWezVNvDVVyq4VE+YIow7OV3o354Wpf4o5VeNXM8eyHNQ8KXWAyKMwkOIZqgmqbUKFmEsM1kHKzYBhXmUXZz+BHc8hcDcv4IdnUjbDpjthFKhEPiIxHx0AJhWG9k20hRETNpDwHgtUAoObEV10cXFFmQGZzJobsJBnKD51UmD1GyGt3g31LJNHnPNNLkT7a2QgSGYbUOEh8VPrsDKoqS2E5huDfO8lSCDA== Received: from SN7PR04CA0237.namprd04.prod.outlook.com (2603:10b6:806:127::32) by DS0PR12MB7632.namprd12.prod.outlook.com (2603:10b6:8:11f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:26:13 +0000 Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:127:cafe::17) by SN7PR04CA0237.outlook.office365.com (2603:10b6:806:127::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34 via Frontend Transport; Sun, 7 Jul 2024 10:26:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:26:13 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:08 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:26:07 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:26:03 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: , Subject: [PATCH 07/10] net/mlx5/hws: fix incorrect port ID on root item convert Date: Sun, 7 Jul 2024 13:25:28 +0300 Message-ID: <20240707102532.2045942-7-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-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: SN1PEPF0002BA51:EE_|DS0PR12MB7632:EE_ X-MS-Office365-Filtering-Correlation-Id: a0103388-0fe9-40db-3299-08dc9e6f3a45 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|82310400026|1800799024|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?++uz/Z2g+YJLdB8Rmc5FNy7yzox8AZyFArU2Epnx7OcTsY0tDvOCxLOp8Gkd?= =?us-ascii?Q?ozF4tOKtcGmcQETJCyUFme7JrrzuQfMELW229to3GYhJRRyJHVrhHJc1e/XO?= =?us-ascii?Q?ESJzkgmbqUO3hgHA+205C8Mkjp4FWgNqg7o4tVlDeLLcAbPD9o6mAZIe6D04?= =?us-ascii?Q?BKWvEVKxM1g3O3/am54jmccUOE5HW3XHwcJlEZXOnTlBbocYd2K5dTxs0m72?= =?us-ascii?Q?hsgnxYyjZmdNZ2Zi57VQn5WiPyjHavDopwDgOSDNSoKuDPa9sbWh2m2Ryyo3?= =?us-ascii?Q?wY+0uyF30OP8AY+1tbatpY69sDbl4gLrA9XOFCr7fza/DjnB/ZJb2xP5Q639?= =?us-ascii?Q?bOmdJq4IJYDMRPFImA2AJrL7G32r0vm+x+0Dl/RnsJnX6/hEVxcaSYyeLZMa?= =?us-ascii?Q?4nDpuw9tgPD8JJk8hk4TxyWSE3EpE/ZTL1RgQLjhPwP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bst0SZ7uHjGcZdVN2ird2I8R5kaczwieE3rN90fPpuK5SQDNVDhk5MFF?= =?us-ascii?Q?godBEvVbwnoinwbaA3cISvmL341i8l85JoVARvRar1sYa9vyKS1DDbvj6ddc?= =?us-ascii?Q?D5kdKiPIKVtYsMpu1OrJfNrRo9eskdWq?= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:26:13.4689 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0103388-0fe9-40db-3299-08dc9e6f3a45 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7632 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