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 8BC4445F20; Mon, 23 Dec 2024 11:11:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1521F40A81; Mon, 23 Dec 2024 11:11:49 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2068.outbound.protection.outlook.com [40.107.243.68]) by mails.dpdk.org (Postfix) with ESMTP id AD415402DC for ; Mon, 23 Dec 2024 11:11:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iPaCSnIkimzOfwdi6q4SUsAxT46SKC6xsVGqa74wGHuPiNLzZYZkzt6QC/JVwQ+0wzQtc1G2uJiKfN0qI1JgeaiXLcGevx+ClSzFKSQC55y26qa9mHe5HijxctZEd9AMFlX9te8HEgf5YiLsMspCV1RAV3mmwwl0JKYQQ0A30TcYRpX8lz9GPu7yY7v2/X2OOK0oQKe1KHUoX1VzKttAekxjU0hwtpDIHIg/4sKKJnsW5fSn8ZjWjkdMi6+9QmCVBxfbN+iC7AxxSb/j8Pd1As+FIaIfnT7k9Ad6N+oF2i8wqT5GgfKY0N9LsmenZdcQGeJHH2WFQCvDANx9gCYfww== 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=YU87ACJELCuFlQC19XN0XUBTWYERo8CN3Hn6hhnL3vBCSBrMCAKnnM52f6lhcqjjljU8pdWKwsFYYpZaRAUlsHmzX3xcEySa2vXXgVzTU01X/oNvYt8NMqwUwAXwV/AUtq5UOjA08zachv8sIkQOOnfEAPx+IGF/Rx2cPuGtvRaeD1GkQgBcpLDXi5OCpx9CVsU+mdAwODJ7+s9wkCqwPHfsPRIi6CgnOGVK3Gt/zFyOUDJwKub0qQjEV4wQFdc1LpnNvKcJ3y4d8lJeupz6gcnw9HxzORRVRS5oZg2lImiecHcXaq2V7T6EJIjqbA438YbOXGtpOGcZl3nTKyeyIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=SIiuxo+AbqF+lIcIJ0nLlPMupzPjqfAUi3RXdr/ijtHkjTkD7cCBduBmDI8L+jB+LJJVT+1/eH6JQeGxW3L50VS++MSfqr1lUoP+H2h2bWGZaYUMpMfYN8X1nzzD3f00+fkmLy1df/YXY6V9Wooyo8xmHPL+FtYyzZfvLXNqV5RJIhPb9WsbBHNM65zPbTCsAq2z0Dj4vxRl656pNf/nBiVdKJUVYADEjTll5sVOtQTIRJoPXqbbm1it5badwk3HSQAmYf/wQZt3FQgBSbNnyBWBi29tE+r5K0ZTgIr5XM9mocDw+ZesnnFOPQHXNkOXhfBIAceSSUvzbok6+kPNpw== Received: from SJ0PR13CA0157.namprd13.prod.outlook.com (2603:10b6:a03:2c7::12) by LV2PR12MB5894.namprd12.prod.outlook.com (2603:10b6:408:174::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.14; Mon, 23 Dec 2024 10:11:45 +0000 Received: from SJ1PEPF0000231F.namprd03.prod.outlook.com (2603:10b6:a03:2c7:cafe::f4) by SJ0PR13CA0157.outlook.office365.com (2603:10b6:a03:2c7::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8293.10 via Frontend Transport; Mon, 23 Dec 2024 10:11:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF0000231F.mail.protection.outlook.com (10.167.242.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.12 via Frontend Transport; Mon, 23 Dec 2024 10:11:44 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 23 Dec 2024 02:11:34 -0800 Received: from nvidia.com (10.126.230.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; Mon, 23 Dec 2024 02:11:31 -0800 From: "Minggang Li(Gavin)" To: , , , , Dariusz Sosnowski , Bing Zhao , Suanming Mou CC: , Subject: [PATCH 5/7] common/mlx5: add RDMA monitor event awareness Date: Mon, 23 Dec 2024 12:10:59 +0200 Message-ID: <20241223101101.677449-6-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241223101101.677449-1-gavinl@nvidia.com> References: <20241223101101.677449-1-gavinl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF0000231F:EE_|LV2PR12MB5894:EE_ X-MS-Office365-Filtering-Correlation-Id: edb3741d-e38e-421f-875c-08dd233a3416 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|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?nDnaXNT+2xOwAahmpGWMY8iMTz3G1fjvkClMgEg21/Xl4l2ntLHYIoHbI+7B?= =?us-ascii?Q?Uxfr9kfJLZyjL79t4bF3Ed7N4mhBNDr8ncibEQbJ0U63IaKxt//j+qfbry1Y?= =?us-ascii?Q?8NtTzKXDgwGZ0Je8woonTXn6ZWZK1veS3a6YfLAk8UJzsLwlzdQziS0CqjGj?= =?us-ascii?Q?tJL4wkcA1CIjechKce6u9Cckrsq9A1n/hqQSLy+0dOiRbaaSs3DX0IrDcLMb?= =?us-ascii?Q?QkdKTjgLyQO9Ef4bFTUFxTa76di6jMsEMBkGux+Hrg5J16Yn7NUco9dLbfIZ?= =?us-ascii?Q?DAuMPGxlXNPoWZFCyFB3OwaB+J9cJVYg4DvsaUyF8kAw0/LkkfLsNfhz9MsR?= =?us-ascii?Q?EUX6r4Gkmbx6nm783j5WeGZc+avSMlIZTBWAYs5NK5J7oshM0xdChSl3skn1?= =?us-ascii?Q?zyoBITkWUBPcsHcWbC+9FYVrSV98JQ+HzcA01IJc4zvAQzjHwe0Ge8jbW/Wo?= =?us-ascii?Q?xp9rrg1VXWmjte8pYSJmBOq+fKjivGcecjT6J9BFsHecIBQUCbOorEUTpKDh?= =?us-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OWBbEZ1pwZcKBNLMwMaKOUCLbV?= =?us-ascii?Q?o0tK2pj0b6czl5nBCKfvqRuPko4cOwhZnfFg8L+Tk3oFOfsPH2Hu7iT10SPu?= =?us-ascii?Q?Per0R3Wpyyw6F8I=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2024 10:11:44.5133 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: edb3741d-e38e-421f-875c-08dd233a3416 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF0000231F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5894 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