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 662DB455E3; Tue, 9 Jul 2024 14:31:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28965402E8; Tue, 9 Jul 2024 14:31:51 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2048.outbound.protection.outlook.com [40.107.237.48]) by mails.dpdk.org (Postfix) with ESMTP id 3793D402E4 for ; Tue, 9 Jul 2024 14:31:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nUerrOaVrGrMrOda+HUJQ4EnmtYFZEf/+4+xL6dJH4znEJoofVjTp8jjY0usX5DZuFvHs3qaf75KHFZrXgJ58lA/po96rMIA9saoP3lr4PHg12xW7C9ZjGtjnBqZFZHwdIjJOLDSevUnAkLxSiUnnlqyttXSyI2gVC0H19rU4Ar95FwmEPXnjo67J8fsMfhGdilCkwi8cdW9j1eC6srnWUOgzJTOO2k2gfb8bR1KJTkvuwoY0orcEdpwTXQvDoBGM5Rjmi1/FwM3OfMlaDYdHXlsLNGpzzru+Q60JQRsDimygHWpvZQzTZcgHibpvUyhHXhmPkV2TW4MH9qkgb99Xg== 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=ijJevtN+ymr/u59M8EG+Uj4wkkBxyGUVJ/rSmfPNAywQnyTQEyTn0wLgowcBwxTVRYEM/wdKO8JIUfS81bdu4ba7aUzzoGfzxZF3iWLoYuDNkEgvvDJ0M+O14lKTCLF8StgmKnVe0WxUjaVZ5Fl4b/OfAHYurDNu7oNlTx3LaCb/2xnfLy4bkGbioANemUQnyDMhfAxglMKRqeuZMBjUfekS3oL9ht31T16XStu8JXDyV4/JflGR8EU0Hgm53ymIFXa2ubOFl0fcG+XHDRHVHCbO3V/wTOjuLYvBlZ7d14z9Hilcg31EKgBVYqDdw72atYlmQRL0rHlFfH26RPlo4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=egIneNNgzZV0uGJzy85toZvICCOxSA2XbPqCllbtWM0ZoJFVzN5/a0voLjxOvkgdOVh4/xp86teK+B1kyUaD3930lhHBju0EJ6xe8q0ez7QWPXSUvtl8CyvaM+lxylaqlPbzu5MeZzRJwuAG8R2Tva5xFwrxOKe2H6C4rJTNsZGDG9T4IFgYPgc7XaRJYayHrgvIP/LCgAxRK9UmLLvjQmeXayVgS78Lb7wYT76jGZYlmmbLaFGE8j/MUdtElk4sym+lpjFmPQfFMujq+z91O1T53oYfsRmOEj3We2OfNQq9Y2c6QLvjscSsTeRMgJPqfdJuWxjJY17g0dy2rqxZwQ== Received: from BLAPR05CA0006.namprd05.prod.outlook.com (2603:10b6:208:36e::9) by DM4PR12MB7623.namprd12.prod.outlook.com (2603:10b6:8:108::13) 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:31:44 +0000 Received: from BN2PEPF000055DC.namprd21.prod.outlook.com (2603:10b6:208:36e:cafe::d4) by BLAPR05CA0006.outlook.office365.com (2603:10b6:208:36e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.20 via Frontend Transport; Tue, 9 Jul 2024 12:31:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN2PEPF000055DC.mail.protection.outlook.com (10.167.245.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.1 via Frontend Transport; Tue, 9 Jul 2024 12:31:44 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.67) 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:16 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) 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:15 -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:11 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad CC: Subject: [PATCH 1/8] net/mlx5/hws: set eswitch owner vhc ID valid accordingly Date: Tue, 9 Jul 2024 15:30:56 +0300 Message-ID: <20240709123103.2101902-2-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: BN2PEPF000055DC:EE_|DM4PR12MB7623:EE_ X-MS-Office365-Filtering-Correlation-Id: e2481077-14f6-4100-fdfc-08dca01317d1 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|82310400026|36860700013|1800799024|376014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?6UmzGdpxZvKbudthM0iCxuWUS6o9bU8N73l3rB24oA4vZU/eoGiOdhbg+4yi?= =?us-ascii?Q?oJXrtyKWJCqPFGOW+BJGUIs8fPtR/qF2xdA5hLd1urm99BBN66XJREJkDGt7?= =?us-ascii?Q?o9Of/bgO0oJKQul3MTe/vgVmQO3GenkbX8lftPH15waCfesKH/I1kuLmjN3/?= =?us-ascii?Q?mrGcdJ4ON5NK7G19M01/6QeCIjDHD9t/fwHZD2TzmoU/nsoh6uDKSGEiFZif?= =?us-ascii?Q?Kpbm4HK+aub9nL61f0s8BYST/x0zInvY/VUJHQ/jOc3V9f25cP0dc9nZ3LJb?= =?us-ascii?Q?E5Clx+p47PCDHkRS5Qlo/aCudPP+Ec5p1JAYMT1ZBnNwLqOG6EXoWtA5rX6I?= =?us-ascii?Q?jfFZZU4MWDixEiXP+yJ4e0jChyQ+8WjS1+sHDDLTzZoFLHhevTEnyCdKmhpF?= =?us-ascii?Q?qXT9oK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6dTe?= =?us-ascii?Q?eURHxEvZHwwLo0DfMi38vjdiCKi+HLL5C007Ik4sRji2f5Qdy/hFgR9qiDgg?= =?us-ascii?Q?1m/2sa9m4rWfqskGny3WNBLb4n4SJZVzrejBYwPDy3dtccqz8kS7HVBb8eJB?= =?us-ascii?Q?nj0w4Mcq8GByTzsNcFR9uoO4VxC/4hUvA8hs4+rpH2E9Dgo30vawjA=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 12:31:44.2197 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2481077-14f6-4100-fdfc-08dca01317d1 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.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000055DC.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7623 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