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 65E2945B4C; Tue, 29 Oct 2024 15:32:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A00B542EA9; Tue, 29 Oct 2024 15:32:33 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2084.outbound.protection.outlook.com [40.107.94.84]) by mails.dpdk.org (Postfix) with ESMTP id 2CFA542E7D for ; Tue, 29 Oct 2024 15:32:27 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iQBKTtwcf24ufLqKkXjf2Lyac46bOM7R1E3FAJuBiAlUvTV742JBauLr15zY1KNpsvgyebcvObnxJXW2bdQyGnScw8eHhzc3SkMq2B33V+v321Og9LToRelP798YG5vlrvyr0q79g6OH9mE1tMBSpJ/Qs+x4uDvOAJ5HR8aVy+zh+pEwzm9dgPrMYoE8u72zOZVZkk0wTFS4nO3QYGYOO3ccspMVOFQOdcgNGgHhworR5KpBlh+KSEj1Podu6E5mT4hTDcPlrJk6DQLqu5ZJM9TK+1iM60Z90KSra8p90mzWIksiV+3N4Vvl1Z3OtXabDRM506UubffQqLjkE/oR9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nC9Q8PXdjszOJclvQaIxRRs5+pBVB5WkTiQPxk621Fs=; b=C388FUtGVwNAAt84O1p+EPGSHyD2RhgDXcZyQXtBNNczxK3DJlNiBY9LDVyvNqJgzd+Q37wYeTnS6MXX+8HCAehBwQ45EJPgkoBivDk6OC0S8pg7fA8JJHwH8pxQrtRAy4EiiYvIhZysz7/rayuHkLl2Erg0DeuAsjpVCMs7VxnclOnheUGDFmGMIBlcVX5ZUK3kYSenn3cDvLQqODTZh829DMYFZSx/YcfvHDzQaU2Gc+IAY1LeaqiwyZkG2/1hNnTrL3NBk+zjB360vnC9T9wZuoNoxb7indMRo5/SMH+rpFn3szFwkrJhKOiTCqhpfKzjbo8lztmBCCQDynkhUg== 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=nC9Q8PXdjszOJclvQaIxRRs5+pBVB5WkTiQPxk621Fs=; b=XP1IT/wZdUetIZaLzLilKv8VYgU5sTFRagzN9ZtBBfA4Ki+2QElwZ95JGoo5J85aQZfVkTnQFgxFsiOh7vFZhHWQTh3oCK+Z4iATP/sUsEAVNDYq8VS67NzcqD1g3c7QzETabnefV/yXiasxZLoLwj5sm4Sa2tYRvOQUl37x+gHQ88joVx9HqJ2UjeBJD9RnS/zBh8Avtm0E6Xxfg0LcDB73F30A916MsBaqKfcZ1yaq714K0fbi6ixJFEcGhaMgKUG3nhCDRK3Mo26adG+gW8oGN6RLqI14Jp5kb7Go5+JWZrktHHxKXuXPqGhbClGmENlNqjBRmglggbDJX3tV0g== Received: from BN9PR03CA0561.namprd03.prod.outlook.com (2603:10b6:408:138::26) by SA0PR12MB7092.namprd12.prod.outlook.com (2603:10b6:806:2d5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 14:32:22 +0000 Received: from BN3PEPF0000B06F.namprd21.prod.outlook.com (2603:10b6:408:138:cafe::5b) by BN9PR03CA0561.outlook.office365.com (2603:10b6:408:138::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.29 via Frontend Transport; Tue, 29 Oct 2024 14:32:21 +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 BN3PEPF0000B06F.mail.protection.outlook.com (10.167.243.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.0 via Frontend Transport; Tue, 29 Oct 2024 14:32:21 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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, 29 Oct 2024 07:31:49 -0700 Received: from nvidia.com (10.126.231.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.1544.4; Tue, 29 Oct 2024 07:31:46 -0700 From: "Minggang Li(Gavin)" To: , , , , Dariusz Sosnowski , Bing Zhao , Suanming Mou CC: , Subject: [PATCH V3 5/7] common/mlx5: add RDMA monitor event awareness Date: Tue, 29 Oct 2024 16:31:16 +0200 Message-ID: <20241029143118.875214-6-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029143118.875214-1-gavinl@nvidia.com> References: <20241029134256.874767-8-gavinl@nvidia.com> <20241029143118.875214-1-gavinl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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: BN3PEPF0000B06F:EE_|SA0PR12MB7092:EE_ X-MS-Office365-Filtering-Correlation-Id: 96a5cfd8-6f18-418a-bd7d-08dcf8267ff2 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; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?aVRgg9jksagOzUpsP62JRDh+Bx3EcoMTs+tDfyhAHtnmpG8yrg48G/1OnIIe?= =?us-ascii?Q?IN6uwJDONqLCUtHUi+YZMdRq9stJ5Cuh/1ZIDcum0CPTOcTkjfF/PJp1a4mK?= =?us-ascii?Q?1Tm2D3UQ1bNggFoR8fp2l+e8t6ep5BLyVYc57cNVGsNJaNSZ4RHnoZUw0hfO?= =?us-ascii?Q?pNJAnDGu7HqjxPgtQ4EgaFCa2RQVcJt5/eTSDHeEvfUEzdBOri2fyQCkOP2R?= =?us-ascii?Q?z8Criwkv+1ZGcoAA45qTae7a6IEWI6F3Jat11DduvDaAyznGNPm/EtGQo1m0?= =?us-ascii?Q?O5JlSePw+WwmV+4vujBruG+iZ989RswGipA/L/fENs3MCT9ytAWg8Fk8CgoG?= =?us-ascii?Q?UEmY2CFlsC9Z/U7a2M5wGJ+sBSsAHadf7t2PqY0rG0jIHF7OGXWaTiMYWKS6?= =?us-ascii?Q?Fv33ASZ4OQB57laA9UTg9vTbTHK1rqFdxuEisjpRxFgDb9vxurVF3DDYgtH7?= =?us-ascii?Q?MYyXJWxivOu3b34eIFkFdkCjMAAyjRWeXAdykHUSGwPWZ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jQw/bWgpODTvpL9c7dVqCHhFs5CKBvLclhrVM1YL6ggFZ66g=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)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 14:32:21.6796 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 96a5cfd8-6f18-418a-bd7d-08dcf8267ff2 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: BN3PEPF0000B06F.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7092 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 RDMA monitor is a new feature introduced by kernel driver. This commit adds backward compatibility for the kernels do not support it. Signed-off-by: Minggang Li(Gavin) Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/linux/meson.build | 10 ++++++++++ drivers/common/mlx5/linux/mlx5_nl.c | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build index 82e8046e0c..58d0328c6d 100644 --- a/drivers/common/mlx5/linux/meson.build +++ b/drivers/common/mlx5/linux/meson.build @@ -170,6 +170,16 @@ has_sym_args = [ 'RDMA_NLDEV_ATTR_PORT_STATE' ], [ 'HAVE_RDMA_NLDEV_ATTR_NDEV_INDEX', 'rdma/rdma_netlink.h', 'RDMA_NLDEV_ATTR_NDEV_INDEX' ], + [ 'HAVE_RDMA_NL_GROUP_NOTIFY', 'rdma/rdma_netlink.h', + 'RDMA_NL_GROUP_NOTIFY' ], + [ 'HAVE_RDMA_NLDEV_CMD_SYS_GET', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_CMD_SYS_GET' ], + [ 'HAVE_RDMA_NLDEV_SYS_ATTR_MONITOR_MODE', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_SYS_ATTR_MONITOR_MODE' ], + [ 'HAVE_RDMA_NLDEV_ATTR_EVENT_TYPE', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_ATTR_EVENT_TYPE' ], + [ 'HAVE_RDMA_NLDEV_CMD_MONITOR', 'rdma/rdma_netlink.h', + 'RDMA_NLDEV_CMD_MONITOR' ], [ 'HAVE_MLX5_DR_FLOW_DUMP', 'infiniband/mlx5dv.h', 'mlx5dv_dump_dr_domain'], [ 'HAVE_MLX5_DR_CREATE_ACTION_FLOW_SAMPLE', 'infiniband/mlx5dv.h', diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c index 745e443f8f..e03db4f918 100644 --- a/drivers/common/mlx5/linux/mlx5_nl.c +++ b/drivers/common/mlx5/linux/mlx5_nl.c @@ -84,6 +84,23 @@ #ifndef HAVE_RDMA_NLDEV_ATTR_NDEV_INDEX #define RDMA_NLDEV_ATTR_NDEV_INDEX 50 #endif +#ifndef HAVE_RDMA_NLDEV_ATTR_EVENT_TYPE +#define RDMA_NLDEV_ATTR_EVENT_TYPE 102 +#define RDMA_NETDEV_ATTACH_EVENT 2 +#define RDMA_NETDEV_DETACH_EVENT 3 +#endif +#ifndef HAVE_RDMA_NLDEV_SYS_ATTR_MONITOR_MODE +#define RDMA_NLDEV_SYS_ATTR_MONITOR_MODE 103 +#endif +#ifndef HAVE_RDMA_NLDEV_CMD_MONITOR +#define RDMA_NLDEV_CMD_MONITOR 28 +#endif +#ifndef HAVE_RDMA_NLDEV_CMD_SYS_GET +#define RDMA_NLDEV_CMD_SYS_GET 6 +#endif +#ifndef HAVE_RDMA_NL_GROUP_NOTIFY +#define RDMA_NL_GROUP_NOTIFY 4 +#endif /* These are normally found in linux/if_link.h. */ #ifndef HAVE_IFLA_NUM_VF -- 2.34.1