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 EECF645B50; Wed, 16 Oct 2024 10:39:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0AD340662; Wed, 16 Oct 2024 10:39:07 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2065.outbound.protection.outlook.com [40.107.93.65]) by mails.dpdk.org (Postfix) with ESMTP id 1D4DA4066C for ; Wed, 16 Oct 2024 10:39:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IlOvzmur862c06QsHuGJ2tv2gWMQCrtQWKmHZhzFZ2t08FUFSA2qc5QT8f9BL/1pLuz7O56EpdcH2/z5F0wSEj8U5mexW6zoagnp4hvWnQGbVtVM8HAHWU2Sk68UjgeaScnPnZouCv5A20lw3Z6Y2M5fw6RX+dCKsuM6tf1w7o2d7v1WfbnJfe4gA+7k1vNLLdDUtbjXZqIRQuInmeFhRfkU2deTBMlwN+Jz2gDWk1Rjc+mt/jOYgIbHVqgQRwRyva6+je1SeNr4YNncG8K9xpJy9AHs+13zvUP81AoJf+0002mQQ7ZYNFWR/WIFEg/AoQZ941ntYr9nx+WPAxkgYA== 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=GQe2Tc4VDOLQveDdnGSx+aIYEvYeN3XpnuY25labdRo=; b=eqMX7fcjFLSdFbUKBy1HFKM0dST3OEBDIHszE1fUOOxfdmd7MYnkA2kXM1xL2vRgzNCaAjURSmKZr/WiG+KHXYc0XKypbgY91w9nX6VlcsXk1y+9XJry/21rn35vr6FnyJBczubLHAQ87lUUx2WRanUxnHCEtw8jnZnh7+yVaDAnZv6lGip3wQo/gIGsDrNCDQw15bu/QtupTKTIT5xC4XREsDqjp3CS2bE6ctUgaD/L0L6vvwfnZxsQ6htmpMlQwFUWfrp18TG27gAyjlpNkSUZgLFyc1P/ESdvPVsHUfsDGr5XdxV9nGKohG1RpyG0g+N5iMW0w0hzGJkBvPgyng== 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=GQe2Tc4VDOLQveDdnGSx+aIYEvYeN3XpnuY25labdRo=; b=hOWGN91h/6dmE+HwZWzEfLt9TPhH4FEvtBrjfOnKKKAasf//yDPJBreVJe43Y0hsJ3pqvU04CTZulq+caGPfFzRVVMmrb+a7pPvUU314rpee9QDbkvwHwzPq54+uFJyXS7D24DDFVSI4NpafzN1G2tAR/Xz3vYWe805tZSzVUj1bf+Q3R5hZL1l6bxEHOgO4aCzdAI3xRnJlUKK9Jf2G7Cmy4BogJB7UNxUrrbTnhpN6o7a677ZhW61KUAv4FeJjOzLx8pEeSLeG3K8VLBxBEdTUMVvGuY3RGXQko3Hn78mCl8AYwyxai6IFgteN6QmZyvFuvPxOolekf/rTyISKHQ== Received: from MW3PR06CA0030.namprd06.prod.outlook.com (2603:10b6:303:2a::35) by SA1PR12MB9002.namprd12.prod.outlook.com (2603:10b6:806:38b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.19; Wed, 16 Oct 2024 08:39:02 +0000 Received: from MWH0EPF000989EB.namprd02.prod.outlook.com (2603:10b6:303:2a:cafe::99) by MW3PR06CA0030.outlook.office365.com (2603:10b6:303:2a::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18 via Frontend Transport; Wed, 16 Oct 2024 08:39:02 +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 MWH0EPF000989EB.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Wed, 16 Oct 2024 08:39:02 +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; Wed, 16 Oct 2024 01:38:52 -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; Wed, 16 Oct 2024 01:38:49 -0700 From: "Minggang Li(Gavin)" To: , , , , Dariusz Sosnowski , Bing Zhao , Suanming Mou CC: , , "Minggang(Gavin) Li" Subject: [PATCH V1 5/7] common/mlx5: add RDMA monitor event awareness Date: Wed, 16 Oct 2024 11:38:16 +0300 Message-ID: <20241016083818.662020-6-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241016083818.662020-1-gavinl@nvidia.com> References: <20241016083818.662020-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: 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: MWH0EPF000989EB:EE_|SA1PR12MB9002:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b654841-212f-4f82-6fc3-08dcedbdfcc4 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|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ZCW1+vEAhoGP6gUcYIDJI5pllEaYdwhHX2Lm2ufTG9l3XQWm41qVzhzwBDos?= =?us-ascii?Q?queFCDbYQ1r6+ftbftypCpvDfqLFXgO4ZwFRKB+/Q22cYUzSK08BAXnbR94V?= =?us-ascii?Q?6HCwZPOsiINU1qlbx2tOFiO3KUnfoe3MWqegw8kwc6MgrA3CeOHfymqTVZa9?= =?us-ascii?Q?w1tuvbyb8gb6qHLNxumOqbhqI9aslrnKkAyo9wv+MPZnZi05Awm85h/LlWnV?= =?us-ascii?Q?+tIlEPOSMarDlopPVb4k4JuVeLn+6qooJ90TFZ1mF6GAJQldZH6BWYu3XNqs?= =?us-ascii?Q?VwfxY/hpsaJ8eDW9lR6BfU5fLF7SKmjaOAyiIog5Q/5YnTqMs6kq1RJO9qsW?= =?us-ascii?Q?X25joDUsd0fQqjgUEnpHzorhaXjL3sni6X6A9ZDXr9VuGykmU9tGXFOuGprp?= =?us-ascii?Q?1n48FTFoSUzuDYR0B2PyJcvb1kBEtUxVlvkHXEK46vNtFTQMXmUjQ0l1kVZs?= =?us-ascii?Q?wCdeFvKGWyjeuU27epJBObn5uJhQEzEgR2ZXiAnzFoZttnpSqlJUjU4KMQyR?= =?us-ascii?Q?yWyEUgT+pWBr4wO1nwk1cUrvcGHBRiiwowCR/HLxj/9PRNtApEusUFY8BstZ?= =?us-ascii?Q?OLoi/1bEX2/lXm94877oPQrwyuPyhzZstb+Lx4T0+MCTfsHIkscsvU/ueu6Q?= =?us-ascii?Q?5Yzey+qETKUo32T5uKf93cED1YvrUSn0CWG8/IGazG2U+F9p45nXcENgcUPc?= =?us-ascii?Q?RMqHOsjkET3c6K6wNE0z7RzR93Ppg4fuDeNQgHCVKm/LhTutt05xRZulng8D?= =?us-ascii?Q?BbR6rl0wHRXWGNtSOn6q0Kts3cpH6Z6TuMMG6BtQMBG0yCd47XD9llk4b0iq?= =?us-ascii?Q?RzrXOMG9Ydky9R+FQs2V1IGxRm/k0D3t4ClG1i0/CadtD5mOyUp4vxjE0eKq?= =?us-ascii?Q?ugtjUExkKx9BeL/4q1qD4eMp2VTR0YsI9R8/gbS1ft785HAKzTq3DfNa7qmW?= =?us-ascii?Q?NOz4zTmpvC+1b4S8yabMrby/x0tW2TTsXa9LL7T0fZhfdiCZlrXwaN0zxL69?= =?us-ascii?Q?pVn3xt4ChrgnNA1g/Eq2skbMolZm9ow2rs8XzWa1aJaQVITiUC87Q+u9Qdr+?= =?us-ascii?Q?l4UJHAPJFh0YXfVMcnblus7smY9Tn8iCDuvDV2OVZxRqWS1tiQ3qHQG06PGw?= =?us-ascii?Q?URUv9wRMHE2kvGOXCPMJGg/gmILlo26XpOvu7rDvxyOkR2T8miDDs/6/tsjP?= =?us-ascii?Q?S90LRGE/JgrkDTV7Q8whCoaO2nAUqzL8dlU+pQXJdzMF07Soa2VImGXZkgtH?= =?us-ascii?Q?xSkvf59C25jphUooMZZewTRKw2TF1CtxjEdnxAMxfz4Y9zMlsISgNp8DuMeV?= =?us-ascii?Q?hLzKr9AjCTMRZjcH+unNdA/6MAMBML6sxMc39oq3dwalyUx0Pkvp4H4SYxNf?= =?us-ascii?Q?baZdJX0=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)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 08:39:02.4476 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b654841-212f-4f82-6fc3-08dcedbdfcc4 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: MWH0EPF000989EB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB9002 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: "Minggang(Gavin) Li" 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