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 3A5CD45C0B; Tue, 29 Oct 2024 14:44:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E43342E93; Tue, 29 Oct 2024 14:44:05 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2052.outbound.protection.outlook.com [40.107.92.52]) by mails.dpdk.org (Postfix) with ESMTP id 8BDC442E7D for ; Tue, 29 Oct 2024 14:44:00 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=g99VhGSACBmVkifarHvld4jaGkVWc1jGtwQjUzDlCF2fG6BTWng4SMkK4VcM80GZz1Db1mkIFny598b7NDjziDyedgIpgedZGTTcK0orQ2xrtTUhZzv5A7Xqo7s1SwLLM+YRmQcwN/6rluIGdhEBinjqQG5BuUgSrdvTv1Q97/QxyFM4Sqi+pIblj437FYvKHT6wSXGDykScoFuPJMWvsZhCCDlqJFV4qRVqy9P5t0tlcBlTcHt4QPbo83kiOJ/09v/fxoSiWBb2vEuEUaCMuq8V//3mciL2JNk1/k9mPFwpeJNziC4zufbsQVKKZRBj8f2xCW2VSaJAiUvTstmDmQ== 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=iuREGAjlxGNYaibUXgTj7vJO9fLQMi+Y7mQ4NYKJzqDH+g3bPfjyoNqsIagam5oTxBHdbmGd0Rk6Mu5qEbgIDqZVYevQ8D32PiB5v7R2tTxwBx76NdqGas9jMLudqFCHhmhkFSA6SaQsCfi4H3pedLYrmj1KcHcRh6EOvq5F4PIp+GjPsxv7mJpyZ2iu9WNQDPgIJry7keFcDP8GF1WwvqxngRC75d7W42M6uMYEM9WC8Qvu5Jg7iLsXT9m/Dytk06k52CFXzSipmXQVAG4LFMh6ZvSsii9uEGdf3Ml6yEEZ/gkex74EF6uyArQyZPa0MLTqIlrixA/9unQZBLRchw== 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=b7CnG5/KvQzFqXWOvbVWr6XDlK/M+WTkM46fNwzBtYaMEuFNNU+AAlMRRwl4Bjeuy0F99h3Gc2Ulwo1cdEmLIAIFzhgzbwB/nlQI0+qsbD+hQBY14a91dmGTFlHVUihmo+AB3GqGd1Qz1+S/xEX08CWWZWkJLWMD+Fe8rRIdY9Xfy6Y+ygrp0/Y21y0xtm9II5ISWKr+N2hTlMvLCDY5b9JXHZwSX8Uc20cfri5ai2q6juK0U8TsCuEKOM9dOeIAHx9kXOV56//sgxwarieapuv9krPPXSNiMJOSdbhnxPWF9fmqBQ7GGx9/SI1QTeColX983FTduSgqvOFt3iVg4g== Received: from BYAPR01CA0043.prod.exchangelabs.com (2603:10b6:a03:94::20) by IA1PR12MB8537.namprd12.prod.outlook.com (2603:10b6:208:453::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20; Tue, 29 Oct 2024 13:43:57 +0000 Received: from SJ1PEPF0000231D.namprd03.prod.outlook.com (2603:10b6:a03:94:cafe::e1) by BYAPR01CA0043.outlook.office365.com (2603:10b6:a03:94::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.34 via Frontend Transport; Tue, 29 Oct 2024 13:43:59 +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 SJ1PEPF0000231D.mail.protection.outlook.com (10.167.242.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 13:43:56 +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 06:43:30 -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 06:43:27 -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 15:42:54 +0200 Message-ID: <20241029134256.874767-6-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241029134256.874767-1-gavinl@nvidia.com> References: <20241028091822.860660-8-gavinl@nvidia.com> <20241029134256.874767-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: SJ1PEPF0000231D:EE_|IA1PR12MB8537:EE_ X-MS-Office365-Filtering-Correlation-Id: b444e678-4157-403f-4dca-08dcf81fbc26 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|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?GuaXgRTAlUQIM36JDDFiqHcaxe9zXTMRxLQ86F7LfV/p/CnECJBvoB4jyOSg?= =?us-ascii?Q?zu09sJfUHlQBZ9uhxNIv4y5mX02JOnWJXsi9DWlM68kyaFZtAml7qSVIWjYo?= =?us-ascii?Q?rKsHGtpaXjK7E5AQyHakTdZGj4DZLdQRWdNK5MPlwSdxFQvnGFC2938ODmpC?= =?us-ascii?Q?wK8/adlgj5JABCwcD00gPPvHviDZCDKzLDM96qKBy4r8MnoTB6fBRgoXz3GP?= =?us-ascii?Q?+jVdRRg1L4PLq7qBhwYfr9sdiRNhtDfHDU+Nx1HNO1314R9MiYVvdg1g6lDt?= =?us-ascii?Q?d3KociEYYFb6sxoFck9+CvIvb2YXzfaDk0rX74MOTOKxepqTnRQYmpEBqXNg?= =?us-ascii?Q?9pxnfW+3fEh8GJRgQerOj5ygxWEj3hSvN+6zbNtUsanojL4aBSVWGNCWDTn6?= =?us-ascii?Q?GIvol9Ym5bwz0IDjHWRHaXMzaPSFUbcGEnEeqAq8xKIhFUrOqzwEFwzuBwEy?= =?us-ascii?Q?KvRbSZqtx/UY4xrnexkkW86NUlZj8dWXLNOJC9d6umWKV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fgav1CUVwXJg+vx5Mkk0/uvhbMcI0h40nIQ=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)(82310400026)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 13:43:56.2819 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b444e678-4157-403f-4dca-08dcf81fbc26 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: SJ1PEPF0000231D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8537 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