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 85CFE45BFD; Mon, 28 Oct 2024 10:19:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05EB340E2A; Mon, 28 Oct 2024 10:19:23 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2062.outbound.protection.outlook.com [40.107.237.62]) by mails.dpdk.org (Postfix) with ESMTP id 49F1940DDE for ; Mon, 28 Oct 2024 10:19:18 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i6+/RuEMdY0HmFgxC/+jalh+5LhQn6ILYAnRkjjWK4IBF72AXZ9Nv3uTzzpZVWhGDQ8dXWhV8ZKgkGX5qgziuYRuE0gy5Jxf6aaxcUC0Ws/cHBpo6oo2jaDlt2c4ga9T7gasZAe/7Ft6/6ZkXccmb8tc8P0eaHrXxVca9prty/enkorV8xfKUlp27ndY1AhB6V5cO0jm2M1U/zumxq8wzL/t1Re19OKjW/AAe6hEFMI/+e+JcRg8uEGhEBtPo9dtq4iQ5sAbwhb/Rc+D7u4hno862pUAqBH4sqd4tymYj7pOd/Vb3pH6k7TxsLQR94YeU4v3vH0cpqUe3zbYVeEgxQ== 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=cE4vx5SUS0tG6ZjzKeyGRg6t2bzbiogEci39kndNRgQ4lkOW/8jWv/WAGUpHo0ffevw4oSJms5qbeYMJm+OowVDJ5/a7UysBEisJroL241/4fOSSTEXMs+2wwDpeSqDH/5BI2Jo8atR4uqy0ggZ9NPPX0bp/U7DLbxO4/n5nBCj8SETCiAK5VOAqphEMEs5fH393oKt0znfPFKnL8vfs97Z2DHef0a/g42JCxKe509juoRBRkUwo//67cUd40vB8w0Zs8ZAbqfurnGjJgSePVFTc2k5NPWhYBfsP+rwSNCQT0nVko/IhdXU+rVsC/8n0UnogFwBTfwsRVlO32ztevg== 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=NyHtdJxGrb2AB2tpvJ971qGWTk+sW+7u/fLiV+7shT9oUGgl+WfCC6kbUjHtzVpMpXm64sFf0061C1N4yCjPzbg+hZOLxzennMK+8WbYA98u6dddVl8DXAPEsjbvEDrD4YaSdnNS6mabh2qyhRRWEXsU+jaB+30q/L5W0tqVc464s4aKe94+XRnfjZxOeO+9VK37cSBlnLra3kPYCgiwbtBxWEdqeiO8GVWDJCwbkT/2lTD3MGJVOVi/l9MYvO8zhQ0C+qQs7+ly/u2jmtL00sfF5cqEOsbQ8x1KA4weVml+1IX0wYRMSbU/zCfsJN5DBmm21uGX8lsS6SJfFZfizg== Received: from BYAPR02CA0040.namprd02.prod.outlook.com (2603:10b6:a03:54::17) by SJ0PR12MB6757.namprd12.prod.outlook.com (2603:10b6:a03:449::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Mon, 28 Oct 2024 09:19:15 +0000 Received: from MWH0EPF000971E7.namprd02.prod.outlook.com (2603:10b6:a03:54:cafe::88) by BYAPR02CA0040.outlook.office365.com (2603:10b6:a03:54::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.26 via Frontend Transport; Mon, 28 Oct 2024 09:19:15 +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 MWH0EPF000971E7.mail.protection.outlook.com (10.167.243.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.16 via Frontend Transport; Mon, 28 Oct 2024 09:19:14 +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, 28 Oct 2024 02:18:57 -0700 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, 28 Oct 2024 02:18:54 -0700 From: "Minggang Li(Gavin)" To: , , , , Dariusz Sosnowski , Bing Zhao , Suanming Mou CC: , Subject: [PATCH V2 5/7] common/mlx5: add RDMA monitor event awareness Date: Mon, 28 Oct 2024 11:18:20 +0200 Message-ID: <20241028091822.860660-6-gavinl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241028091822.860660-1-gavinl@nvidia.com> References: <20241016083818.662020-8-gavinl@nvidia.com> <20241028091822.860660-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: MWH0EPF000971E7:EE_|SJ0PR12MB6757:EE_ X-MS-Office365-Filtering-Correlation-Id: d17eb549-07c4-4b4c-e628-08dcf731979f 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?2ek+NkjqmJslpgu0nBm03u4rukWABOZWLJJXdymOmWEOsadAGmQW9wCsUxBq?= =?us-ascii?Q?mg6qSuXW2c6hfHFPdVabyq+Tfw/6n828C0aTInd6Tie304SaPzeovOQw0R82?= =?us-ascii?Q?XftwyZvqeXvx2xm99vFTfLXr/y0QuvLrSnq0+AqscZj1Do7ohETgJTcE00kc?= =?us-ascii?Q?gVHMD2BHaPtvUpNGvKRo+fdMwxnYnmFGVlaowRAnRcWd2LKzUoczzzb14+g0?= =?us-ascii?Q?GWEVUUCx9XWXqUFbof8fSAB3e9SwAqkZx3YadzJmcgvAjFSwwjrmjcuhTDPt?= =?us-ascii?Q?OQqyMh212CAUeQDNYr8U53Ly8ldUiSehXOuRuNUmM+CDlYOiWqUs8dHECq/f?= =?us-ascii?Q?JBMXom+piujxtE+RzuHUZuageHNWrM9RiwdyMKQVqRFBnsCHSol2T94MaEI1?= =?us-ascii?Q?8R00x9Fx/WvJ3TXu2moavEypVdbwg0o7r4/5i8/BmXg2H4khf6zecoVl9cDC?= =?us-ascii?Q?txTPEG1slfrLh6Z11lgJksZgv4dTT85YS/m6uObfhXMgcxx+TbKKfYW5iIPz?= =?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rZqcKqQSeD5X3ULPOHddFpxyrQBQ=3D=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: 28 Oct 2024 09:19:14.8127 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d17eb549-07c4-4b4c-e628-08dcf731979f 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: MWH0EPF000971E7.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6757 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