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 0CFDC455B6; Sun, 7 Jul 2024 12:26:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2F994065D; Sun, 7 Jul 2024 12:25:58 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2049.outbound.protection.outlook.com [40.107.244.49]) by mails.dpdk.org (Postfix) with ESMTP id 4A8A04065D for ; Sun, 7 Jul 2024 12:25:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=koT0StlfP68kyuqGrfZNPWsRQ0Rg8069+YhCgsldUUvk1FO8cVz64i4Nh49Mq7FAgri8I54jRfe+ApjD/6BNFXkmbuT8OQ5D/PliTNtpxmH1zcqcP8swz6QDeUvmbLLqovd+RbL112LIZ8/jGQQJzeRLX1AS2hlN4zhi0ZsodunhI+ojWFzCfEM65dV0nxkuYXhImY9qScofybWx6DNFQg7nE4Sw5GjUBjikXpwkgHFuZDEvHKhxrr1nkbfmJ9kYQ9IUhB6aM0VZcc7JGZ7+KbZJZS3A4CWYm2x+Y4F5wgRnx4gN1U6wUV4Nu9sg5wbKIaMOa1zU+cjt36zCNBIShQ== 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=/lpLtmxvvL8kAbHpcg9z48/oN3VQyKW6PUHIIwQBpUY=; b=FSO8VUtArlDxqzcwiPGMvMR16WKuHVQEL8BoI3UR6JGyuAJaq3MMTUTV3kh7L/qCXxSpMlD+39Iy8045HciAcdo/VP8v3R47lJVJEfQ+JXv1JmraVT6jz/0q57Yl9M64Ph3vHvb09lHpJb4uNTkSEG1T/0W513u8PS/BeTsXQKrEkNMySdLTW+sH+scrxzjn/8LeeCNXO+8jgxS4vZiLmlabctk315LjGmU4wQlG6pmqEO0CgUqCkkoM07lIk1E4QDMEAc3MqpCj3qeOEbBEIgOJQcniAf3ybvj+b+87RDkhIe5uVjQJ7SNniOw4EaGPDqLKysXcbV9q6EeFAjm9xg== 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=/lpLtmxvvL8kAbHpcg9z48/oN3VQyKW6PUHIIwQBpUY=; b=B6/NcTtzSZmqNoBlR32x2w6WR/xlk1a3ojHhJe0kKgTIjg4v8hhbJA8kxcAgQzgZlQBP2urX/ku1fcKXNdEUYvkACXSXUvYiTtEZg/VQI+C3xiPKyvCnF+UKBB9nV8CtMqCORkY2bsQD9qOYN4ofKO+YaX0qTTd2HO2zceMRN5C1meRddkvsaq/ggSfzF7ROfNJgkhbXJhDFiKAh08UR/CqqU+HzbaNRvJeotd+5U1QmIwVc0CscPh3VP5rY5UJbD+uYqwT9MTdAMDnNcE6jkPDNRaRksIdyaSTGUDibxCREr5FIJxf2O75l1WIznVJQ56cEzYNXdggkmmQRqQCRrg== Received: from SN7PR04CA0225.namprd04.prod.outlook.com (2603:10b6:806:127::20) by DM4PR12MB8523.namprd12.prod.outlook.com (2603:10b6:8:18e::13) 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:25:52 +0000 Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:127:cafe::2c) by SN7PR04CA0225.outlook.office365.com (2603:10b6:806:127::20) 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:25:51 +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:25:51 +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:25:50 -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:25:50 -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:25:46 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: Subject: [PATCH 03/10] net/mlx5/hws: set eswitch owner vhc ID valid accordingly Date: Sun, 7 Jul 2024 13:25:24 +0300 Message-ID: <20240707102532.2045942-3-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_|DM4PR12MB8523:EE_ X-MS-Office365-Filtering-Correlation-Id: 1608531b-f1c4-4333-1bbc-08dc9e6f2d40 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|1800799024|36860700013|376014|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?R6ECfSkz84UIRExEwVyOH2cfGck7sBRPJGCeiqTGSk9PxrXTivboIWMTjGV1?= =?us-ascii?Q?C1xpOyOkzJQqPM45IWTXtEL3UsgdMGiEZBEp2ojZZEM+Vr6ADqAVfQ7zGgn/?= =?us-ascii?Q?I9NpokrNKUBldgY2sbl9+BIH9QFdc5ik8RchLWex/Dxap3pgWxlMfwUU0Fzf?= =?us-ascii?Q?r74MM9d40wY+fD3F2Oqg1KkgkHgrx9nRO+aT8gU0sSzM8KS55Me9LIQ98kEv?= =?us-ascii?Q?bUQ3b738Zri+q110ou2vl/FN4BU0g1DZGAXGE20co6etYsQ3hXtsLhSZeMxS?= =?us-ascii?Q?h2Dz8HcrI4DGsvRdLTDGfGB/WkU25V0iTiwoa9SMcr30J5+4oabPW2E5Cltm?= =?us-ascii?Q?Atcpr3E+UtNDZLbT5gF12+0CdtcKhr2C6+PmdwrbdiFEZ5pkJxv8ZH1onFKj?= =?us-ascii?Q?4lkgGgNgjvUtc9cM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=?us-ascii?Q?HWpvmcgsW/nQ33Qq9XgOaFlvhzXva0uJD2FbhdL/Rk233/iWOlwOgfN5JubJ?= =?us-ascii?Q?1jq5687SFC35p/KerNvQLT2L7fL6U5u4riC6YEJ8cj15hbnUfAiHW0IZ2hDS?= =?us-ascii?Q?/zBHpJaBQmVYhBwtiOLXnf+f4DI/2wgXIxUv9NNY1wY3s34y8/lrnA=3D=3D?= 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)(1800799024)(36860700013)(376014)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:25:51.5783 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1608531b-f1c4-4333-1bbc-08dc9e6f2d40 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: DM4PR12MB8523 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: Erez Shitrit eswitch_owner_vhca_id_valid value should be set to 1 only on merged-eswitch device. Signed-off-by: Erez Shitrit Acked-by: Matan Azrad --- drivers/net/mlx5/hws/mlx5dr_action.c | 12 ++++++++++++ drivers/net/mlx5/hws/mlx5dr_cmd.c | 3 ++- drivers/net/mlx5/hws/mlx5dr_cmd.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_action.c b/drivers/net/mlx5/hws/mlx5dr_action.c index 90f2f17bd0..03c3683f71 100644 --- a/drivers/net/mlx5/hws/mlx5dr_action.c +++ b/drivers/net/mlx5/hws/mlx5dr_action.c @@ -680,6 +680,8 @@ mlx5dr_action_fixup_stc_attr(struct mlx5dr_context *ctx, fixup_stc_attr->stc_offset = stc_attr->stc_offset; fixup_stc_attr->vport.esw_owner_vhca_id = ctx->caps->vhca_id; fixup_stc_attr->vport.vport_num = ctx->caps->eswitch_manager_vport_number; + fixup_stc_attr->vport.eswitch_owner_vhca_id_valid = + ctx->caps->merged_eswitch; use_fixup = true; } break; @@ -700,6 +702,8 @@ mlx5dr_action_fixup_stc_attr(struct mlx5dr_context *ctx, fixup_stc_attr->stc_offset = stc_attr->stc_offset; fixup_stc_attr->vport.vport_num = 0; fixup_stc_attr->vport.esw_owner_vhca_id = stc_attr->vport.esw_owner_vhca_id; + fixup_stc_attr->vport.eswitch_owner_vhca_id_valid = + ctx->caps->merged_eswitch; } use_fixup = true; break; @@ -1429,6 +1433,14 @@ static int mlx5dr_action_create_dest_vport_hws(struct mlx5dr_context *ctx, action->vport.vport_num = vport_caps.vport_num; action->vport.esw_owner_vhca_id = vport_caps.esw_owner_vhca_id; + if (!ctx->caps->merged_eswitch && + action->vport.esw_owner_vhca_id != ctx->caps->vhca_id) { + DR_LOG(ERR, "Not merged-eswitch (%d), not allowed to send to other vhca_id (%d)", + ctx->caps->vhca_id, action->vport.esw_owner_vhca_id); + rte_errno = ENOTSUP; + return rte_errno; + } + ret = mlx5dr_action_create_stcs(action, NULL); if (ret) { DR_LOG(ERR, "Failed creating stc for port %d", ib_port_num); diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c index 666d678b42..72fc9e3d91 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.c +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c @@ -515,7 +515,8 @@ mlx5dr_cmd_stc_modify_set_stc_param(struct mlx5dr_cmd_stc_modify_attr *stc_attr, stc_attr->vport.vport_num); MLX5_SET(stc_ste_param_vport, stc_param, eswitch_owner_vhca_id, stc_attr->vport.esw_owner_vhca_id); - MLX5_SET(stc_ste_param_vport, stc_param, eswitch_owner_vhca_id_valid, 1); + MLX5_SET(stc_ste_param_vport, stc_param, eswitch_owner_vhca_id_valid, + stc_attr->vport.eswitch_owner_vhca_id_valid); break; case MLX5_IFC_STC_ACTION_TYPE_DROP: case MLX5_IFC_STC_ACTION_TYPE_NOP: diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.h b/drivers/net/mlx5/hws/mlx5dr_cmd.h index ea5d346d8e..54840ec445 100644 --- a/drivers/net/mlx5/hws/mlx5dr_cmd.h +++ b/drivers/net/mlx5/hws/mlx5dr_cmd.h @@ -133,6 +133,7 @@ struct mlx5dr_cmd_stc_modify_attr { struct { uint16_t vport_num; uint16_t esw_owner_vhca_id; + uint8_t eswitch_owner_vhca_id_valid; } vport; struct { struct mlx5dr_pool_chunk ste; -- 2.39.3