From patchwork Tue Nov 12 09:57:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chiara Meiohas X-Patchwork-Id: 13872004 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2066.outbound.protection.outlook.com [40.107.220.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A554420E325; Tue, 12 Nov 2024 09:58:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405539; cv=fail; b=KIVimMV/yipbVK1xamj8oJe3h846iyJkyEHbFfpOiKIK+VdJyKcOsG9pPu0movb4ut6AEFxXUpwqIUOAzgmxbbGwSzGZHZgHOE5fx0I4WjAv8WLnUJX8m1I8WvQtl1t5gzTrqxKjbQWeiEutsSrVzaqSkpgqZhXpOj0xf1tXUjY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405539; c=relaxed/simple; bh=iPW7bQX5l7u+lwKNP0atLgDL1J7fbS5dRq0uzIeg/wU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iR5uoU1bkjQ4OUYHbJw7bh288hufbjrqS4MBCpjZ+9CGcHchTUMpDkk6qdQD2Lq16LQY2bpcFhaNlo2uD2834FihLRMWQMogid4L4fGNu+mYkIIr3/EZeij4QCXp8ttRFxc11wi4ZuOFDfOo7IqIuUA5PTOYkJrYucyaAwe8uJQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=oKDybohd; arc=fail smtp.client-ip=40.107.220.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="oKDybohd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bAVAkZFoMNszkvTy9LcomIYxtrzkivh/mtQFfK2myDbxIaRAxwa0LzK78U02fLCz5dKtyn4MS/8PgmEMfmd0A176wbc99ie1YGFv+tPg0be8uIajm/hBkmmn72BWo86lsZHrBiNsFgyJ3f0b9JHDE1uhCFt5SYJSJUbDtAaEMfu5TzUGALZwby7/4adgf1W0801IcZ8ij4MEoQLLQgZSTpCYoUqkPf/tliub/GPLC1a82Xl6mcCtVKyh3dR1m5YI010sO0YS9aPct/IryjzQr37fK6nTiHB7C8NWXj1zZs1+JYDjlIQ9estmkxAbGlJFwEk3DnTF9nJ9qxe4ZeNV4g== 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=kEDL3LDQGJnT1jEhNaSq3U8O2GbQfuwLuV3kptKChe0=; b=kkgxtnc3ADfeMS/vSxjsAtmwHrH+ETrUTSOTdptPSAvJuv951hktOK41xKNtM1eSXjYyVfxbr8v4dOj78AS77/4WhuKZOnXgGduTfBrXQ1Q4aRcyuuyln6BYHQWOH22PtUoqRY8EBKtQvYYJLCImQaQoxYiT4bfY8sSb9VOc8Ofsrd5FYknGzs8pVbFIDJeQJNUlbT6AWIFzImDUfxY1pUhuR1GM0A5dyosvEOlkCLMLr9PqGCw1sGhz7d/BjOSsgWJiJ29myk1osyjlc1gD9Bp6OhpC4PShB/NhwwXYfKg9mYotfnigeWvfhyK/9BYMm9F0lms4hsTRoTycu40JFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=gmail.com 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=kEDL3LDQGJnT1jEhNaSq3U8O2GbQfuwLuV3kptKChe0=; b=oKDybohdBX1jI6MZafvNDDzGC/FXugGl78/LxEPoE2XGpj8Q6bzfuyL+SlX7nn56XdesZNEZnyVjMMX1Q18UVu76yXaq5cwJoh9GlXfHRvjejpDVK7pepemiElhZ/NKPwtbXmQv/ypNAmTWMbgp+LPXqLIsKUSIQPhZiCZI5fngGmGilIRBgoZWfavyVdUCoPHP8XrDPnFMjuiqvRdJunCPt/FAqrnjEEISQYiq7FmMq3/CjER3M7xsWD9HwR0y02/gHJw7yLEKzfZGdVtNM99iAh/AzowQTmiEBAX2bX+JseqwMwsnx2FRaA5TMHXRnVE1eK4BOvCJB01xFdgwSVA== Received: from CH0P221CA0011.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11c::28) by SJ1PR12MB6340.namprd12.prod.outlook.com (2603:10b6:a03:453::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Tue, 12 Nov 2024 09:58:42 +0000 Received: from DS2PEPF00003439.namprd02.prod.outlook.com (2603:10b6:610:11c:cafe::bf) by CH0P221CA0011.outlook.office365.com (2603:10b6:610:11c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29 via Frontend Transport; Tue, 12 Nov 2024 09:58:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS2PEPF00003439.mail.protection.outlook.com (10.167.18.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Tue, 12 Nov 2024 09:58:41 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:30 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:30 -0800 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 12 Nov 2024 01:58:28 -0800 From: Chiara Meiohas To: , CC: , , , , Chiara Meiohas , "Mark Bloch" Subject: [PATCH v3 iproute2-next 1/5] rdma: Add support for rdma monitor Date: Tue, 12 Nov 2024 11:57:58 +0200 Message-ID: <20241112095802.2355220-2-cmeioahs@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241112095802.2355220-1-cmeioahs@nvidia.com> References: <20241112095802.2355220-1-cmeioahs@nvidia.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003439:EE_|SJ1PR12MB6340:EE_ X-MS-Office365-Filtering-Correlation-Id: a8157a4e-4809-41ea-2cdd-08dd0300968d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|61400799027|82310400026; X-Microsoft-Antispam-Message-Info: hSFg1OSO96VSODEyiAxMTlDqaPmkzF96g7QG7Xf17Cm3U756AFoMH1g2Qb1O9tQ1pU3N9JX2n4oC+lg5OrkG78QQ1LDeXqTKWdp9ZrpeaVdZOQjUnk1mycdP9wzsYx5r67GSW5/Ke0av0z0zPApG3tmvBRlQUCkdxi8cpv8BVXR8q4iagU5svZQkhZoOOqXSGI4B5c8saJu2DNPuNqdtb/J8dXdA12t1HaAyCid/1eM+Q2YjCf+etgXUyaLVhTS6Sro8FzsQwrNCFMCWbCVa0nKN15kYZB7MeXiXmnu1Zie1VySXltWGc0P9ic6ixOdi/3q3+DiXr0L3NAgm73Ci7NGjX3rRZK8NCroy7sh5yEUc1WKpkEMpG/rBSaa7eepEMFEjRIipyNv5ANt2px0eF2uX3/6Ic6nPPEv350mhN+kuBg79jjwWcpm6fw+GAg2tewCs7WiobGVEU+98pFREGfHFBT6o0zYG2PyzR52HMFq1A3CA/O9nHhXslIw+9AjVj71QxSKxduPHE9eXysz9EacqOHf9SSMJvdr4BQxegKmf40GD3cY7UOfnL0LBq0BH0HahvVaBJj17AHsq+job1jnAaLNDt+GNFgwWog1/wwWWGAm4DLtAadIbsMSGwQipdDzR6kbW0yd0J48X5t5Yt5/5QDEGYaRO4NIab/4DiHnxoGpMmMgqlETq/2XAaXa5jb1j1yqS5OM3d+tYzvt6l7V5sEnIdwLCCZb6M0B2/ETDDCuDEEXCJ7WnXEQtFVMbt66e76cmr6sU0iDBpZ83VeLVA8g+6zGhGF7gVq4f37NAwUVdpCyFuZ/j1xHOUpaAlnLAdz79qbP0bZaeH1V7sZ6zs5DkPuUW4Vsdbt4omwbh0gALVHgLnREJU7kDO0XGsMltK4swZrt9zIcB7S9Y9+znVzBJ7QwnwAV6Nc2//T33VFxVIPM3wpfqwZghwq99R3BEk0VgwPySjRq0wqoB9Kivjvev8VRUu7r81gNKmeaLMBTgnHUa9Sb69S34LjhO32cJtzGJB8rF6vZbsmdfagpDIASX7EH9FCZNyUAfzwovIk9nw+6FPlp7bZa/eEO3p+ya95YaM/uuUiloOTb+Oewcy3dg1MdgB92Ky8x90saasJqeBB4frNKXZXQstfTqOIg9gKuIh1245ir5+GJ+z55qWCu7Wg6ix1029qQ799y4eNS1NAcnRcwwEajSPkfNw0WbOQTD/53zPBx3kavTai0ycMREoQ5T1FuzZFG63hmBGkKbHZfStJeLtJjzpjvtx9segGrxM+a/XPpMbnccC1ealQHFPT6nmwg3u5kYcGkIzc/Ppi/GAJLG4M5eoLVepJeZAotpJbJmg5MGWdDyhn9uuI998Lul88Ml/H899WOmvwfZecU5Klclh68zEvEzrA1JZSVUAS4eyjZ+8mYQoA== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(61400799027)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2024 09:58:41.5790 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8157a4e-4809-41ea-2cdd-08dd0300968d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003439.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6340 From: Chiara Meiohas Introduce a new command for RDMA event monitoring. This patch adds a new attribute "event_type" which describes the event recieved. Add a new NETLINK_RDMA multicast group and processes listening to this multicast group receive RDMA events. The event types supported are IB device registration/unregistration and net device attachment/detachment. Example output of rdma monitor and the commands which trigger the events: $ rdma monitor $ rmmod mlx5_ib [UNREGISTER] dev 3 rocep8s0f1 [UNREGISTER] dev 2 rocep8s0f0 $modprobe mlx5_ib [REGISTER] dev 4 mlx5_0 [NETDEV_ATTACH] dev 4 mlx5_0 port 1 netdev 4 eth2 [REGISTER] dev 5 mlx5_1 [NETDEV_ATTACH] dev 5 mlx5_1 port 1 netdev 5 eth3 $ devlink dev eswitch set pci/0000:08:00.0 mode switchdev [UNREGISTER] dev 4 rocep8s0f0 [REGISTER] dev 6 mlx5_0 [NETDEV_ATTACH] dev 6 mlx5_0 port 30 netdev 4 eth2 $ echo 4 > /sys/class/net/eth2/device/sriov_numvfs [NETDEV_ATTACH] dev 6 rdmap8s0f0 port 2 netdev 7 eth4 [NETDEV_ATTACH] dev 6 rdmap8s0f0 port 3 netdev 8 eth5 [NETDEV_ATTACH] dev 6 rdmap8s0f0 port 4 netdev 9 eth6 [NETDEV_ATTACH] dev 6 rdmap8s0f0 port 5 netdev 10 eth7 [REGISTER] dev 7 mlx5_0 [NETDEV_ATTACH] dev 7 mlx5_0 port 1 netdev 11 eth8 [REGISTER] dev 8 mlx5_0 [NETDEV_ATTACH] dev 8 mlx5_0 port 1 netdev 12 eth9 [REGISTER] dev 9 mlx5_0 [NETDEV_ATTACH] dev 9 mlx5_0 port 1 netdev 13 eth10 [REGISTER] dev 10 mlx5_0 [NETDEV_ATTACH] dev 10 mlx5_0 port 1 netdev 14 eth11 $ echo 0 > /sys/class/net/eth2/device/sriov_numvfs [UNREGISTER] dev 7 rocep8s0f0v0 [UNREGISTER] dev 8 rocep8s0f0v1 [UNREGISTER] dev 9 rocep8s0f0v2 [UNREGISTER] dev 10 rocep8s0f0v3 [NETDEV_DETACH] dev 6 rdmap8s0f0 port 2 [NETDEV_DETACH] dev 6 rdmap8s0f0 port 3 [NETDEV_DETACH] dev 6 rdmap8s0f0 port 4 [NETDEV_DETACH] dev 6 rdmap8s0f0 port 5 Signed-off-by: Chiara Meiohas Reviewed-by: Mark Bloch --- include/mnl_utils.h | 1 + lib/mnl_utils.c | 5 + man/man8/rdma-monitor.8 | 51 ++++++++++ man/man8/rdma.8 | 7 +- rdma/Makefile | 3 +- rdma/monitor.c | 207 ++++++++++++++++++++++++++++++++++++++++ rdma/rdma.c | 3 +- rdma/rdma.h | 1 + rdma/utils.c | 1 + 9 files changed, 276 insertions(+), 3 deletions(-) create mode 100644 man/man8/rdma-monitor.8 create mode 100644 rdma/monitor.c diff --git a/include/mnl_utils.h b/include/mnl_utils.h index 76fe1dfe..0ddf2932 100644 --- a/include/mnl_utils.h +++ b/include/mnl_utils.h @@ -24,6 +24,7 @@ int mnlu_gen_socket_sndrcv(struct mnlu_gen_socket *nlg, const struct nlmsghdr *n mnl_cb_t data_cb, void *data); struct mnl_socket *mnlu_socket_open(int bus); +int mnl_add_nl_group(struct mnl_socket *nl, unsigned int group); struct nlmsghdr *mnlu_msg_prepare(void *buf, uint32_t nlmsg_type, uint16_t flags, void *extra_header, size_t extra_header_size); int mnlu_socket_recv_run(struct mnl_socket *nl, unsigned int seq, void *buf, size_t buf_size, diff --git a/lib/mnl_utils.c b/lib/mnl_utils.c index 6c8f527e..5f6671bf 100644 --- a/lib/mnl_utils.c +++ b/lib/mnl_utils.c @@ -35,6 +35,11 @@ err_bind: return NULL; } +int mnl_add_nl_group(struct mnl_socket *nl, unsigned int group) +{ + return mnl_socket_bind(nl, group, MNL_SOCKET_AUTOPID); +} + struct nlmsghdr *mnlu_msg_prepare(void *buf, uint32_t nlmsg_type, uint16_t flags, void *extra_header, size_t extra_header_size) { diff --git a/man/man8/rdma-monitor.8 b/man/man8/rdma-monitor.8 new file mode 100644 index 00000000..d445cba0 --- /dev/null +++ b/man/man8/rdma-monitor.8 @@ -0,0 +1,51 @@ +.TH RDMA\-MONITOR 8 "22 Jul 2024" "iproute2" "Linux" +.SH NAME +rdma-monitor \- RDMA events monitoring +.SH SYNOPSIS +.sp +.ad l +.in +8 +.ti -8 +.B rdma +.RI "[ " OPTIONS " ]" +.B monitor +.RI " { " help " }" +.sp + +.ti -8 +.IR OPTIONS " := { " +\fB\-V\fR[\fIersion\fR] } + +.ti -8 +.B rdma monitor + +.ti -8 +.B rdma monitor help + +.SH "DESCRIPTION" +.SS rdma monitor - utility can monitor RDMA device events on all RDMA devices. +.PP +.B rdma +opens an RDMA Netlink socket, listens on it and dumps the event info. + +The event types supported are RDMA device registration/unregistration +and net device attachment/detachment. + +.SH "EXAMPLES" +.PP +rdma monitor +.RS 4 +Listen for events of all RDMA devices +.RE +.PP + +.SH SEE ALSO +.BR rdma (8), +.BR rdma-link (8), +.BR rdma-resource (8), +.BR rdma-system (8), +.BR rdma-statistic (8), +.br + +.SH AUTHOR +Chiara Meiohas diff --git a/man/man8/rdma.8 b/man/man8/rdma.8 index 5088b9ec..df86284d 100644 --- a/man/man8/rdma.8 +++ b/man/man8/rdma.8 @@ -19,7 +19,7 @@ rdma \- RDMA tool .ti -8 .IR OBJECT " := { " -.BR dev " | " link " | " resource " | " system " | " statistic " }" +.BR dev " | " link " | " resource " | " system " | " statistic " | " monitor " }" .sp .ti -8 @@ -94,6 +94,10 @@ character. .B statistic - RDMA counter statistic related. +.TP +.B monitor +- RDMA events monitor + .PP The names of all objects may be written in full or abbreviated form, for example @@ -133,6 +137,7 @@ Exit status is 0 if command was successful or a positive integer upon failure. .BR rdma-resource (8), .BR rdma-system (8), .BR rdma-statistic (8), +.BR rdma-monitor (8), .br .SH REPORTING BUGS diff --git a/rdma/Makefile b/rdma/Makefile index 37d904a7..ed3c1c1c 100644 --- a/rdma/Makefile +++ b/rdma/Makefile @@ -4,7 +4,8 @@ include ../config.mk CFLAGS += -I./include/uapi/ RDMA_OBJ = rdma.o utils.o dev.o link.o res.o res-pd.o res-mr.o res-cq.o \ - res-cmid.o res-qp.o sys.o stat.o stat-mr.o res-ctx.o res-srq.o + res-cmid.o res-qp.o sys.o stat.o stat-mr.o res-ctx.o res-srq.o \ + monitor.o TARGETS += rdma diff --git a/rdma/monitor.c b/rdma/monitor.c new file mode 100644 index 00000000..8c14d575 --- /dev/null +++ b/rdma/monitor.c @@ -0,0 +1,207 @@ +// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB +/* + * monitor.c RDMA tool + * Authors: Chiara Meiohas + */ + +#include "rdma.h" +#include "utils.h" + +static int mon_is_supported_cb(const struct nlmsghdr *nlh, void *data) +{ + struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {}; + uint8_t *is_sup = data; + + mnl_attr_parse(nlh, 0, rd_attr_cb, tb); + if (tb[RDMA_NLDEV_SYS_ATTR_MONITOR_MODE]) + *is_sup = mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_MONITOR_MODE]); + + return MNL_CB_OK; +} + +static int mon_is_supported(struct rd *rd, uint8_t *is_sup) +{ + uint32_t seq; + int ret; + + *is_sup = 0; + rd_prepare_msg(rd, RDMA_NLDEV_CMD_SYS_GET, + &seq, (NLM_F_REQUEST | NLM_F_ACK)); + ret = rd_send_msg(rd); + if (ret) + return ret; + + return rd_recv_msg(rd, mon_is_supported_cb, is_sup, seq); +} + +static void mon_print_event_type(struct nlattr **tb) +{ + const char *const event_types_str[] = { + [RDMA_REGISTER_EVENT] = "[REGISTER]", + [RDMA_UNREGISTER_EVENT] = "[UNREGISTER]", + [RDMA_NETDEV_ATTACH_EVENT] = "[NETDEV_ATTACH]", + [RDMA_NETDEV_DETACH_EVENT] = "[NETDEV_DETACH]", + }; + enum rdma_nl_notify_event_type etype; + char unknown_type[32]; + + if (!tb[RDMA_NLDEV_ATTR_EVENT_TYPE]) + return; + + etype = mnl_attr_get_u8(tb[RDMA_NLDEV_ATTR_EVENT_TYPE]); + if (etype < ARRAY_SIZE(event_types_str) && event_types_str[etype]) { + print_string(PRINT_ANY, "event_type", "%s\t", + event_types_str[etype]); + } else { + snprintf(unknown_type, sizeof(unknown_type), "[UNKNOWN 0x%02x]", + etype); + print_string(PRINT_ANY, "event_type", "%s\t", unknown_type); + } +} + +static int mon_print_dev(struct nlattr **tb) +{ + const char *name; + uint32_t idx; + + if (tb[RDMA_NLDEV_ATTR_DEV_INDEX]) { + idx = mnl_attr_get_u32(tb[RDMA_NLDEV_ATTR_DEV_INDEX]); + print_uint(PRINT_ANY, "rdma_index", "dev %u", idx); + } + + if(tb[RDMA_NLDEV_ATTR_DEV_NAME]) { + name = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_DEV_NAME]); + print_string(PRINT_ANY, "rdma_dev", " %s", name); + } + + return 0; +} + +static void mon_print_port_idx(struct nlattr **tb) +{ + uint32_t port; + + if (tb[RDMA_NLDEV_ATTR_PORT_INDEX]) { + port = mnl_attr_get_u32(tb[RDMA_NLDEV_ATTR_PORT_INDEX]); + print_uint(PRINT_ANY, "port", " port %u", port); + } +} + +static void mon_print_netdev(struct nlattr **tb) +{ + uint32_t netdev_idx; + const char *name; + + if (tb[RDMA_NLDEV_ATTR_NDEV_INDEX]) { + netdev_idx = mnl_attr_get_u32(tb[RDMA_NLDEV_ATTR_NDEV_INDEX]); + print_uint(PRINT_ANY, "netdev_idx", " netdev %u", netdev_idx); + } + + if(tb[RDMA_NLDEV_ATTR_NDEV_NAME]) { + name = mnl_attr_get_str(tb[RDMA_NLDEV_ATTR_NDEV_NAME]); + print_string(PRINT_ANY, "netdev_name", " %s", name); + } +} + +static int mon_show_cb(const struct nlmsghdr *nlh, void *data) +{ + struct nlattr *tb[RDMA_NLDEV_ATTR_MAX + 1] = {}; + + mnl_attr_parse(nlh, 0, rd_attr_cb, tb); + if (!tb[RDMA_NLDEV_ATTR_EVENT_TYPE]) + return MNL_CB_ERROR; + + open_json_object(NULL); + + mon_print_event_type(tb); + mon_print_dev(tb); + mon_print_port_idx(tb); + mon_print_netdev(tb); + + close_json_object(); + newline(); + fflush(stdout); + + return MNL_CB_OK; +} + +static int mon_show(struct rd* rd) +{ + unsigned int groups = 0; + uint8_t is_sup = 0; + int one = 1; + char *buf; + int err; + + err = mon_is_supported(rd, &is_sup); + if (err) { + pr_err("Failed to check if RDMA monitoring is supported\n"); + return err; + } + + if (!is_sup) { + pr_err("RDMA monitoring is not supported by the kernel\n"); + return -ENOENT; + } + + buf = malloc(MNL_SOCKET_BUFFER_SIZE); + if (!buf) { + pr_err("Buffer allocation failed\n"); + return -ENOMEM; + } + + rd->nl = mnl_socket_open(NETLINK_RDMA); + if (!rd->nl) { + pr_err("Failed to open NETLINK_RDMA socket. Error: %s\n", + strerror(errno)); + err = -ENODEV; + goto err_free; + } + mnl_socket_setsockopt(rd->nl, NETLINK_CAP_ACK, &one, sizeof(one)); + mnl_socket_setsockopt(rd->nl, NETLINK_EXT_ACK, &one, sizeof(one)); + + groups |= nl_mgrp(RDMA_NL_GROUP_NOTIFY); + + err = mnl_add_nl_group(rd->nl, groups); + if (err < 0) { + pr_err("Failed to add NETLINK_RDMA multicast group. Error: %s\n", + strerror(errno)); + goto err_close; + } + new_json_obj(json); + + err = mnlu_socket_recv_run(rd->nl, 0, buf, MNL_SOCKET_BUFFER_SIZE, + mon_show_cb, rd); + if (err) { + pr_err("Failed to listen to rdma socket\n"); + goto err_free_json; + } + + return 0; + +err_free_json: + delete_json_obj(); +err_close: + mnl_socket_close(rd->nl); +err_free: + free(buf); + return err; +} + +static int mon_help(struct rd *rd) +{ + pr_out("Usage: rdma monitor [ -j ]\n"); + return 0; +} + +int cmd_mon(struct rd *rd) +{ + const struct rd_cmd cmds[] = { + { NULL, mon_show }, + { "help", mon_help }, + { 0 } + }; + + return rd_exec_cmd(rd, cmds, "mon command"); +} + diff --git a/rdma/rdma.c b/rdma/rdma.c index 131c6b2a..253ac58b 100644 --- a/rdma/rdma.c +++ b/rdma/rdma.c @@ -15,7 +15,7 @@ static void help(char *name) { pr_out("Usage: %s [ OPTIONS ] OBJECT { COMMAND | help }\n" " %s [ -f[orce] ] -b[atch] filename\n" - "where OBJECT := { dev | link | resource | system | statistic | help }\n" + "where OBJECT := { dev | link | resource | monitor | system | statistic | help }\n" " OPTIONS := { -V[ersion] | -d[etails] | -j[son] | -p[retty] | -r[aw]}\n", name, name); } @@ -35,6 +35,7 @@ static int rd_cmd(struct rd *rd, int argc, char **argv) { "resource", cmd_res }, { "system", cmd_sys }, { "statistic", cmd_stat }, + { "monitor", cmd_mon }, { 0 } }; diff --git a/rdma/rdma.h b/rdma/rdma.h index d224ec57..fb037bcf 100644 --- a/rdma/rdma.h +++ b/rdma/rdma.h @@ -98,6 +98,7 @@ int cmd_link(struct rd *rd); int cmd_res(struct rd *rd); int cmd_sys(struct rd *rd); int cmd_stat(struct rd *rd); +int cmd_mon(struct rd* rd); int rd_exec_cmd(struct rd *rd, const struct rd_cmd *c, const char *str); int rd_exec_dev(struct rd *rd, int (*cb)(struct rd *rd)); int rd_exec_require_dev(struct rd *rd, int (*cb)(struct rd *rd)); diff --git a/rdma/utils.c b/rdma/utils.c index 4d3803b5..bc104e0f 100644 --- a/rdma/utils.c +++ b/rdma/utils.c @@ -477,6 +477,7 @@ static const enum mnl_attr_data_type nldev_policy[RDMA_NLDEV_ATTR_MAX] = { [RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE] = MNL_TYPE_U8, [RDMA_NLDEV_ATTR_DEV_TYPE] = MNL_TYPE_U8, [RDMA_NLDEV_ATTR_PARENT_NAME] = MNL_TYPE_STRING, + [RDMA_NLDEV_ATTR_EVENT_TYPE] = MNL_TYPE_U8, }; static int rd_attr_check(const struct nlattr *attr, int *typep) From patchwork Tue Nov 12 09:57:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chiara Meiohas X-Patchwork-Id: 13872002 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2075.outbound.protection.outlook.com [40.107.220.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72B6C20EA2C; Tue, 12 Nov 2024 09:58:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405535; cv=fail; b=pf/j8MFdjXb2oZJWR5iHQq93XuNaqYJT8GNaE6dptayhzrflEIcQOMH1KxureylNN8KMUnwfrUl+abiitHy8Qc14A87PiWFIXeRDy1oHqF/YMMhbJw1epA25t75uzXlbiWGkD/GxFBRFZ+6ssXvB7zPfJm8V4CZqC7OsCf48Dpc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405535; c=relaxed/simple; bh=7AzVwdMpEGTPQmg/RIQ6+6NukoZvk/ZP6u/nk8X2IMc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UXpNIXisYbcI5mbF02TQUC/NiKbXt3tBTCH2OdpcQ1/1ZH5qYyRuGLg0NAj5+whIaIAePyXdsyBj+NBjJHvaAq2dpI4G4+97+cPQBFG3dHbO8E8U69xaHxeBXqI6AppBbGC7HJmIZzSuf1Nhe96IoeUT1vpAx5eWVintNVQJlSo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Phi0qP0D; arc=fail smtp.client-ip=40.107.220.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Phi0qP0D" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MrYSTLsJFbphTRda7EDgKbaiNo4EFUBsZmVK4q0Z85sjEraVoZgqXV6VLZUE2K++NQU/jKSGNyHJkPQmPzeotocGqK8G+lsZmaKbCiAbuLY8iOJfEfeL03oqFLGVVu4ZhaY1m+OGXcQ3gBPKfgV0iK8eU5bIXZdSjSVuhVO/ZGszZ9Kb1vN7VBH+S3LkyiNS74aQDpKWelyNJTMI6d1GXj3NHOsN6SSzvRqtFNjb9Jmpwn9D2HiEYD6X3g6CPzUZOyH91kQsDIIvolH2uYx/z+jrd3uXICkESVXuIxk/BihE3cbPFtZl49LUnWVboAL4fPuSbsPrijZti6Iv8heTeQ== 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=cUfGHicv0ZzVSkWw+3sDCCDZKRMBeib2hhPUSeg8NaI=; b=o2JXLdudsbCz7/FiOcqV3dhti+0VmeZuwmRKpHROCHJxBrtDeamggPeALUvkERyROkk6o5BGQIlJJ7Qviyn0so5uYZ9XqvnlBBunUjdFyKSeaSMi7lWMBp8NXip6z/9+AV2lEVdYIm8vilpTLDuxiFnMl7dhtaKToalyAoqh9hTmNLWAXG/tesgsPEmnjEbyeGJYngvcJLBXuaxs5xldhEo/PbbkAbePVxfMB9ZBVVgySkziMcwoFzKAHsNxbEW30QVSA+i2+LamunH342YOIRv0ZDw9Btwgrg3qVPsfZQuKUHNshej3WsLD8fvl1R2MNRzQAytbau+36n629D3K4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=gmail.com 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=cUfGHicv0ZzVSkWw+3sDCCDZKRMBeib2hhPUSeg8NaI=; b=Phi0qP0DODyXnDMhFUuJ/O8e4zA3MB4TZ4hluLH+kHInrndOWPrMVmwVW5kPzvfo8Wax8UmrUZgMJCfrRJ7CuGJfHpReZVGPY0C+BqoOiCGkyECGmjG78ZlM2Xfl5UT0CQDFS13V6ecMB/JFS1vIbvNwBrFfGvRgqse8dXucSE8i3+QEFeVJNou6WJI+o0nM8Rf6SOTH0cF3mwOT9EVwQsf4YKkyudbh0E1gslLdbb44XRkFsJqEsyn4X8DKvVIyeWnr1xKZYGAjZmplxWvIkFSgV783uhmTraDI/DWAkH0aqdjwK/rFXS6GJ5b+Z1eVGuI2AK7S0JuipVF3wBsagA== Received: from BY5PR04CA0016.namprd04.prod.outlook.com (2603:10b6:a03:1d0::26) by LV2PR12MB5966.namprd12.prod.outlook.com (2603:10b6:408:171::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Tue, 12 Nov 2024 09:58:42 +0000 Received: from SJ1PEPF000023D5.namprd21.prod.outlook.com (2603:10b6:a03:1d0:cafe::11) by BY5PR04CA0016.outlook.office365.com (2603:10b6:a03:1d0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28 via Frontend Transport; Tue, 12 Nov 2024 09:58:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF000023D5.mail.protection.outlook.com (10.167.244.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.1 via Frontend Transport; Tue, 12 Nov 2024 09:58:41 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:35 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:34 -0800 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 12 Nov 2024 01:58:33 -0800 From: Chiara Meiohas To: , CC: , , , , Chiara Meiohas , "Mark Bloch" Subject: [PATCH v3 iproute2-next 2/5] rdma: Expose whether RDMA monitoring is supported Date: Tue, 12 Nov 2024 11:57:59 +0200 Message-ID: <20241112095802.2355220-3-cmeioahs@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241112095802.2355220-1-cmeioahs@nvidia.com> References: <20241112095802.2355220-1-cmeioahs@nvidia.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000023D5:EE_|LV2PR12MB5966:EE_ X-MS-Office365-Filtering-Correlation-Id: 10e0025b-2758-4b2c-188c-08dd030096a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|61400799027|82310400026; X-Microsoft-Antispam-Message-Info: rw54O7FzRY8rywnaJOxWEd1TVvYLCD3qxuEX+EdkKw2P1KF/f6nizYbPoA2qiqMcw/20ZeOQOp8v1m8v+7WGpwOMGi83aYnpzrPE0j9zxSqQacpnQr4hXrgasuzmf8cDUnWK1PkoPiEXLZNPXIUtS0wM9Od39V+qa6bCa7Z3yDtMNYjd7+T7/mE6rWW9WuRUmhkkjwIWsLKSqMgimx9Xb/0joaoFbSRKO9md6ZIgLa02H8PE2VKeBBTn7rpGvAqXI9L/MW14WdrjFVMFAc+GalstdqonzCVS6JdPeLFiWsgB6OiMsq8QfXqQ9IVlHC5LrzfzII55emgo2AsS+ydWNSFcxrg9VFDzYfcUEcfFpiIc7Gg3Lr75v9IJMqnVyhPdTjxtdAvwZOIsOoTS+ARdegDCw6TknJkGP8SWz0i9PdzfZ0pmpq6o4QHiCH78S8zuzh2lzdCwWcJxFk94iI2xYhpts835JXBjqazki2s9JHzplDLq1eO9xD8vW0WtBZ3i3NEBsZylAj0H1t1e03pK9mX5rKJ1PzMqEUSSnFFDJIy0mCkzdSz/ynlE4kAZ6v4IohR+Vqnmj8qDgb07FU/ZVgzQ2N5eNIG4Jpva3lGxLbf8XG8LJ1w3vRx+lYc1ybPSEP4KnGXxeBkhKUeN6k1R2gwz7FfJ8dpyItIVg72+xV2lYNXCbbdjC0zAvUF4bpvA3y/4qCQknVKPIa0bcnK0YK2DgpupF0++nbHjxms+IFViPsmuT/41oCtZMs1QbB3rl86o/FzG9TiWOwDiOTBp1PQKLksuOgcvaXjjsc7ZA8rtzsUDx7zfi7mfSr2fO2zQLiK4dtr7TWLry2vS8CuP4sp3lUEkdxqn+5gPeoy1WjGl4AE1jz6ecxY8yhFQcD8Qh6OrISzekThvOozZG75pYp1X2vsZC0AgwvIDo4/smn1GTE/7DG83AjH0atiMpF7xuVJLunW5GwMswrRAW3Tc7onjl/9PoHtlre2loKst6cD40g8ExAn6gL+HjV9qSF0OqgsJxHrPHYvifBzDvP655Tx9Yx70/YN5c14PMkLrGnOM8LWYiZvjT4EmVphdd1Nu6n84PJk7QtC9vqAT6zzGz6LN6eKyQPi2P+m757DacnRS77ryaLGLsIDey64YiSFo5SUXV/Cv42qeOjOH1OGUGItO5r81+be0tIEDahNsDH06Oi2TtShJ6eLJksowFfjfy3O88ZOc63j2z8TGhstf6NXNjimSPqv8ol/DYmtAdZJqiT6nFFKT20ae4061/U6y7wFULpkS/ccFtK8EBHJ6QgT6PaH7vY5ueq6IYeSTNPcKZtRwL7QdLGoJwnpx4R1K6krezf6qCaSQ9SndHEEwendt0Z7d4JdHKvjjwUwOZRayQg2GaswYfhTZ8O6MVoiqKsdPGr5PpVRpmItKRhe96A== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(61400799027)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2024 09:58:41.8451 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10e0025b-2758-4b2c-188c-08dd030096a5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000023D5.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5966 From: Chiara Meiohas Extend the "rdma sys" command to display whether RDMA monitoring is supported. Example output for kernel where monitoring is supported: $ rdma sys show netns shared privileged-qkey off monitor on copy-on-fork on Example output for kernel where monitoring is not supported: $ rdma sys show netns shared privileged-qkey off monitor off copy-on-fork on Signed-off-by: Chiara Meiohas Reviewed-by: Mark Bloch --- man/man8/rdma-system.8 | 9 +++++---- rdma/sys.c | 6 ++++++ rdma/utils.c | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/man/man8/rdma-system.8 b/man/man8/rdma-system.8 index 554938eb..5373027a 100644 --- a/man/man8/rdma-system.8 +++ b/man/man8/rdma-system.8 @@ -38,8 +38,8 @@ rdma-system \- RDMA subsystem configuration .SS rdma system set - set RDMA subsystem network namespace mode or privileged qkey mode -.SS rdma system show - display RDMA subsystem network namespace mode and -privileged qkey state +.SS rdma system show - display RDMA subsystem network namespace mode, +privileged qkey state and whether RDMA monitoring is supported. .PP .I "NEWMODE" @@ -66,8 +66,8 @@ controlled QKEY or not. .PP rdma system show .RS 4 -Shows the state of RDMA subsystem network namespace mode on the system and -the state of privileged qkey parameter. +Shows the state of RDMA subsystem network namespace mode on the system, +the state of privileged qkey parameter and whether RDMA monitor is supported. .RE .PP rdma system set netns exclusive @@ -100,6 +100,7 @@ is *not* allowed to specify a controlled QKEY. .BR rdma (8), .BR rdma-link (8), .BR rdma-resource (8), +.BR rdma-monitor (8), .BR network_namespaces (7), .BR namespaces (7), .br diff --git a/rdma/sys.c b/rdma/sys.c index 7dbe4409..9f538e41 100644 --- a/rdma/sys.c +++ b/rdma/sys.c @@ -20,6 +20,7 @@ static const char *netns_modes_str[] = { static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data) { struct nlattr *tb[RDMA_NLDEV_ATTR_MAX] = {}; + uint8_t mon_mode = 0; bool cof = false; mnl_attr_parse(nlh, 0, rd_attr_cb, tb); @@ -48,6 +49,10 @@ static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data) } + if (tb[RDMA_NLDEV_SYS_ATTR_MONITOR_MODE]) + mon_mode = mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_MONITOR_MODE]); + print_on_off(PRINT_ANY, "monitor", "monitor %s ", mon_mode); + if (tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]) cof = mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]); @@ -77,6 +82,7 @@ static int sys_show(struct rd *rd) { NULL, sys_show_no_args}, { "netns", sys_show_no_args}, { "privileged-qkey", sys_show_no_args}, + { "monitor", sys_show_no_args}, { 0 } }; diff --git a/rdma/utils.c b/rdma/utils.c index bc104e0f..07cb0224 100644 --- a/rdma/utils.c +++ b/rdma/utils.c @@ -478,6 +478,7 @@ static const enum mnl_attr_data_type nldev_policy[RDMA_NLDEV_ATTR_MAX] = { [RDMA_NLDEV_ATTR_DEV_TYPE] = MNL_TYPE_U8, [RDMA_NLDEV_ATTR_PARENT_NAME] = MNL_TYPE_STRING, [RDMA_NLDEV_ATTR_EVENT_TYPE] = MNL_TYPE_U8, + [RDMA_NLDEV_SYS_ATTR_MONITOR_MODE] = MNL_TYPE_U8, }; static int rd_attr_check(const struct nlattr *attr, int *typep) From patchwork Tue Nov 12 09:58:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chiara Meiohas X-Patchwork-Id: 13872003 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2061.outbound.protection.outlook.com [40.107.96.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 806C220EA29; Tue, 12 Nov 2024 09:58:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405537; cv=fail; b=t/QSddXlv2huUc8bppqB3mULM2zXbdmMa8Trv/q5MGZzohx/4EyQmBae+hfQOyu16iTI1b1kNNen1IohxT2hgn73F4ZtC5GgUObmvuJOCzITeG+1EO7Zl3nmziX5MbhpXvsvUMKiXjF/PIUFCWma+BVzWRblqW2d4lTp2LXcBYQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405537; c=relaxed/simple; bh=ncle9SeKtepsEI3IDufpeHD4ZWhqjBnrNRh212vFwYE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ga9kjdqUywEIXFYRNRyLkfnnuAE8PGw+VI8pAsZ8E3EviDHzt/iLkwKw6AwXD01WxWoPODOPQzrPr3G5kSs8fStlPqyiD22Jz7X/BgmIrGS1WrqD6dMI0yaW+9E/sI3sLavazzc+Id3DxyIQDxdgspAEIMho4dCxHsTXLAvicvg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=MjzCpHZ8; arc=fail smtp.client-ip=40.107.96.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="MjzCpHZ8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dYD2Qov2yq5S9Ce+cbIOwej+/JMS3gV6sQ1WR0IxBv9Z0cxGlychHJ17K3uT0Ha1ApNOxuHt6SJ6Pg0NLLi/R52iLZd3ejdAxonCQgUhfRUQqJDHdcwgjP5O+8aWp8qrhDRCmOuRimG10coT15fZeyUmgSk7ZT2nKSGf+QY06SDQscYYGAnNGAbFWXuHoYn6cmngwiMPUm0ztIP6rZr6weR1KebJZUW3jD8rl5ROPHe40Dtesd/9r81mtGzZsgjRsm5+bZUDbRnJ+K0iewQ6kVWnp1U7PYmIVvDnNl0FhYdLVI+4xJyvg1ccX2MdkOG9xPqPiKlk5DasK1bqglDVyQ== 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=WszNR1Ann5KlTSPBb8SuFfcM5mgaLX/yJ0umeESdJoU=; b=bld+73s29JyNWcZENJF8tgO7fNAWniIdwj8jeFHK+65su8YiE0L2ZvUwnMFQPCrGkbxqtAsWvUriQLbS1pb3dKzgQGuh3Vd9ku/rRx+X2s7ufImJLR2o1ZrxSgfboFrAMa6SZVGTPP9e9bzSsitY/dsz5cQDkasQeJY7GVMURlXQp0+zbKWNGf28JLJ6tKcnxmL6sWy5Zq+IIlyUNOICnz1mXgWPV5/Rzv9DK89d+/Ndlni51ksQgfINTaaAfjjt8WBt5q+h8rnW0LQ3+E1jhQLcGJN/kyFqs7XFfwD5e9B+SJhcuma1TlLT/ZksLw2t2N0llxY+YsHT+cxgKXZRkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=gmail.com 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=WszNR1Ann5KlTSPBb8SuFfcM5mgaLX/yJ0umeESdJoU=; b=MjzCpHZ8Mez4xNCT9t+DUqZriObW8A7dZ+qO8O7f69HkbQaRZ0FKRJ2GUcWJUwrbo9Nt0I03LB9ZPxJcu2dogkVGNIsUL1pRnlywVXOQIuxdGq6ma3gUPr6S12tW6Fta91eFrdxJxuB0GeyxQzjfwlwtOeg4wDW+KFIv8FLCQVj7CtOit45HoiwEKM/euhKsYaSMszWQdkwyVJMyiLQvfF6pDWbTHiQuwd7+5RuCtFRzV+pm150vO65L2dFmMdi3QGVUdYTPQ3FG6xYoUdLfID4sxqiTUTmh4uDeIj6+GOumbE1wpKNN7vTxfZf7o+SIq5naeUXJbnwzxg03M78aMQ== Received: from BY5PR04CA0014.namprd04.prod.outlook.com (2603:10b6:a03:1d0::24) by SN7PR12MB6744.namprd12.prod.outlook.com (2603:10b6:806:26c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27; Tue, 12 Nov 2024 09:58:46 +0000 Received: from SJ1PEPF000023D5.namprd21.prod.outlook.com (2603:10b6:a03:1d0:cafe::2a) by BY5PR04CA0014.outlook.office365.com (2603:10b6:a03:1d0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28 via Frontend Transport; Tue, 12 Nov 2024 09:58:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF000023D5.mail.protection.outlook.com (10.167.244.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.1 via Frontend Transport; Tue, 12 Nov 2024 09:58:45 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:42 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:42 -0800 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 12 Nov 2024 01:58:40 -0800 From: Chiara Meiohas To: , CC: , , , , Chiara Meiohas , "Mark Bloch" Subject: [PATCH v3 iproute2-next 3/5] rdma: Fix typo in rdma-link man page Date: Tue, 12 Nov 2024 11:58:00 +0200 Message-ID: <20241112095802.2355220-4-cmeioahs@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241112095802.2355220-1-cmeioahs@nvidia.com> References: <20241112095802.2355220-1-cmeioahs@nvidia.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000023D5:EE_|SN7PR12MB6744:EE_ X-MS-Office365-Filtering-Correlation-Id: eb7a0b8c-8967-4385-d5d0-08dd03009909 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|61400799027|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: xHH+dNol/Ugz5MIlzuzrUIUXbk05LVxQw/a/0F4zV7m2Ckt6Fr3u2P0gR0FGl/FBTaXiluUt3SxFs4mKpbAiipQpveJ3IuhATJr5QrEVEgVtKuW6QbA+DAp9Kb0QMtF5dTtNW6FkeTPIlPiZPteDT4xl5f0OSCbUK5m/WNICIdnnyIs0u0A9eI34BqzMwszTwRVt1DPVA8MRAeLS7shUD5fprQRJtowLcEq6gMIyy1j4ArLJR7yCdco1lYt3PnyU14VBzWTEBxSjJCEbWTH7y9pffjJnKfw+ZEjDNcQ+jdGcpNK9KO/aqT31GvHyO74aS0E6QTYz2Ix4k+8MBf6uJnJ7YBFEe3XGR5/icY0CDpdodx4YXeBjvq4RGIbVM6N6T21VgyTUbCLdSzZLT7RB0tI7jLpHZOHnE+G0b6/dqNYy3Zi+gTctz4ejjU48Tm+aPZQSggduygmxkwurvCTR1Z744KDQ5tTQdrna+L666DUcJOJ20TFsdjMLl/kMVW/6mvqLCKHS+UBvDjF5YQNrIOwhEYAJY2km3H+OfKX2n1f//EvrezITF0V48t7mjo4y22yuSQGJm2SbrcxLjO+RuN2Rs0XrB5f1F0DVsKtUx1D/diPIigAOPwloW17qxaVAh35sfi72rZGjY+6UktIZwpc/j40LxG71JGu/cct8B9QQaAzSycdfo0O0s7mh3YsUCyolVD5UNFFKkVP7qiBifYkNMJQsEDqQtIcQ93D3ZUOOcOVrjc8fG9R2Cl1kZgoS0uol0E3+tNDcugJqELgnySbi/C3ANeyBqJu5i4SO0cp9JXBgyqD0046jWJndXpAoW42A5M+xpi9OjwHcYWIRRn8aSsKIXiK5BvosJZI4FWaabe349X1PEibbCtKYRYwIYUPGgeau4BEyMYu1eIt3atWTj/nmIL8Wdx89avzRxM4Me4hbQIdbBfSJd1IAQrD9C15bXqZPTlThjKFKsDEQaDls8NXLYURCCVh/bOs0JWpTZpjk9bjj+lbGF9OoeH3mn2GK8rRFAdemC5U2sJx+uu9SEbn8FkFK5m97FcQ++NRikENbsVIK68znXgXLZDzhB4vTzsTbeKtR0baTUX1HU4YZal4XyRNRx9VBWkZCJrCumMsuOwD2LR2HNpeC0GJfOqZvMNB7nYb/x3iUucKKpBVhg0U901JCT0ydHAK5pydxJsycDtOtVXr21uRrvJlk+Uzzg3U4vo1nfvM+qe17LzFd8GRdwW6GrGkBFgntfd53SorWtucfMH6QCGHC4S92h8a7EA0xrZt66yNMzxMwpYnUSB1M6EBYVQ9ZkxRvXhc/jfRK/IrB6jUGwNqYOOgkgKOjGgEdF91X+bb+7jft5lPYNWm59SAkZtZUIvr4dIIJxuhsfxQ4kKXg0QBekBDjelHSJO0fYQ4KzM4GDmai/A== X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(61400799027)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2024 09:58:45.8764 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb7a0b8c-8967-4385-d5d0-08dd03009909 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000023D5.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6744 From: Chiara Meiohas Signed-off-by: Chiara Meiohas Reviewed-by: Mark Bloch --- man/man8/rdma-link.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/rdma-link.8 b/man/man8/rdma-link.8 index 32f80228..5e4a5307 100644 --- a/man/man8/rdma-link.8 +++ b/man/man8/rdma-link.8 @@ -6,7 +6,7 @@ rdma-link \- rdma link configuration .ad l .in +8 .ti -8 -.B devlink +.B rdma .RI "[ " OPTIONS " ]" .B link .RI " { " COMMAND " | " From patchwork Tue Nov 12 09:58:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chiara Meiohas X-Patchwork-Id: 13872005 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2087.outbound.protection.outlook.com [40.107.236.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C39B20B801; Tue, 12 Nov 2024 09:59:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405553; cv=fail; b=nw7cIWFYGPOnQxXAHaKZzsIP2wor1C3vMKb15FNcXFmxyVDDhc9kI365ZzafO0n08QeDwCm0wLoSMp/8IDuwU9GPWFD+jKPDY7VMxnLEB9xhn242OEb/k54mdQOSM8C8r7QHkx6Kbq8Ym/i3KjYlPTIE3ra0fHTnJGwwOOJ9I2A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405553; c=relaxed/simple; bh=kPSzhW/HlrttbnmapXqwUMOVhd2/8kC2Vz21qdIZOy0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MNQeJRjhS2CNxmBVjj7eou9g0w3hYqs87mky+66NVHhvePuFRMAxSE2RUL98JlFMaqZpn8OyvV3npYVg437LNNBrnx+9qCvXj3ZLMJ/ipxWxiKxSn74gJr3DUgD6QhRijHniqCGzI/RkutVWf7Wc9BQkqclzJu44+u26mfYUFPI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=CiI9WX3L; arc=fail smtp.client-ip=40.107.236.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="CiI9WX3L" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uZdmv5jEZ5uvhKg6ljnnxdR5R4U3GgWb8Jevz5UvtcrlRsw9igIFfrRb268lIklbnlb/CnLaS1m18G6M7jMvil9Q8fuHBhywdlAOjeDH5pRhs2mVHKc9fsf8VOyBMeo8Qvy2gqp2EuLw8O35Nkxq9imCBkWI3JruoIVZj7Wnvw3GSbl3PpDC8/FhO+F/LW6NxLp7rTLwnLG1cPabfkR7S6HLTYJr8//uuwO1g/2Gzp4R5cBjTvJRKj57PA5BHsu2B9uCEA0YsWAsuOBiDfSUrvAhQmUzfrJ7DaXMynMg4svXOlm+qVb1b//AAyi9NtYHPoKMXnl4P5ZC8rquHjHqVA== 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=jA/MGtEORUUmGMMwM0leDBwubCRVf/5+1zCImVGoFBo=; b=qVXH4+ZtYaVvNwAP9rQztnuFDKYgoC2UDXodpCsNbLJdbXOeYJ0s51NTt/wDEr3Zju2otzXx2z1zVAsMgO0v8C5QnEO2857YQH9F5b8iUSfz9Ej9Rbi15DN5MecC0G4wVlHiC6Ok3VC3LjbSmRWqQqDPRsagzq96bhCHUF4bQWtJxsZwwkapiSw7ghEOR+GLkFBVIt2nGtkuBQ7HxB4F/2skIwhIGMPo6lxTFrUAj+v6mBgFWrRUR2UR6nMkWgaeWYmCMw8/NC4s+/VEYWOLj5RiPz1zl5vfy3njJMbrALPw6x10OX/4bgVCEME10SV3RcFTzi5AT9oqrkfnUsA4MQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=gmail.com 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=jA/MGtEORUUmGMMwM0leDBwubCRVf/5+1zCImVGoFBo=; b=CiI9WX3L7a1LDR6canJcFltA28dJLPRWBuLgShEvpb0O+egna8trqqNHPzzEsACIGzm3WuGGRaGKnCH8/4rXqvdPYdXEaLlOj07Mgu6JdoW+1KwKzao2A6dPGbv1jhkNrkHeOPPKNCLQO1WaB6wdvIWoT6u3ynowS4J6AtyaSYeHaEvfVwB6t1i9I7Uczfh+EJH6w938mBpUPb2wVOEKQbcLOCfTUTlDM7ATsKS3A3mgkXw5QdqTQyUOc81yINnga9WvuhhM2W83R2AN9br6275yjTbDCbuG+6XUoFp0VQAo3V45T6vCvK+YQyH25LFCCaSx+HUBxZZ1D32fQvRS1A== Received: from DM6PR03CA0093.namprd03.prod.outlook.com (2603:10b6:5:333::26) by CH2PR12MB4261.namprd12.prod.outlook.com (2603:10b6:610:a9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29; Tue, 12 Nov 2024 09:59:01 +0000 Received: from DS2PEPF0000343F.namprd02.prod.outlook.com (2603:10b6:5:333:cafe::e2) by DM6PR03CA0093.outlook.office365.com (2603:10b6:5:333::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28 via Frontend Transport; Tue, 12 Nov 2024 09:59:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS2PEPF0000343F.mail.protection.outlook.com (10.167.18.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Tue, 12 Nov 2024 09:59:01 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:51 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:50 -0800 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 12 Nov 2024 01:58:48 -0800 From: Chiara Meiohas To: , CC: , , , , Chiara Meiohas Subject: [PATCH v3 iproute2-next 4/5] rdma: update uapi headers Date: Tue, 12 Nov 2024 11:58:01 +0200 Message-ID: <20241112095802.2355220-5-cmeioahs@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241112095802.2355220-1-cmeioahs@nvidia.com> References: <20241112095802.2355220-1-cmeioahs@nvidia.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF0000343F:EE_|CH2PR12MB4261:EE_ X-MS-Office365-Filtering-Correlation-Id: 3cd9c8c2-99fe-492e-96c6-08dd0300a22f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|61400799027|82310400026|376014; X-Microsoft-Antispam-Message-Info: Vz8LB9oEM/5Mx45yvEtjqWeY1AU55XQwVrjUnUNzQH4KbjkzfjhjalMCqAv1y+n+o5v7T00Oo/1TqIXoiRa2SzZw8J9j8woNVIVaKLZq0VkdmJqrjm+FHRzXQIOxg8+JqaZHhBZoAKJ/xVejOlFlk6iRa01tP1z+KCfQFT88l8NKazBiWDe7Mup48iAe9o2/DgyV20tqBHSwYBQ1Ro/JodQr/wjn+YTv6DSKKgaSk0d3jcUjd7DJZm7O2DQ3N9xWVPC7inN6o8QdwhGD1wZt/7b6W1LVQqvdWyBx2eAEWuGDBFbY3G9HHM/LgQns0fvIDNKI0WvHmBmb4GaI2awf1h1YPg9CzP8qH0oN5JzCgxY8gXHzSta0meW/RIFbAb4yHg1PBKYnBH+C3VANBtGdgeIgTPSXQdWdM4g/++Wb2VtOBGCX1bFlP6ChlcMRkbM5TyQXAPop2GZna5xGiNbkka6IwXRyCaHOxV0ifdTpognONlvbrsfIUGAcea2dw4Ukej9D9FZwzOhOtfQ3hPbiUMbqjEnCUpQNq2gUYuoRKlV9Y2FJoalivY2LSdv5he4N/dg458PKTOtVegQsk5t850Nv4rWxfT1OlgPTd+R59NacYd4e5iv4Yc0YHj1MQakEgL78H83J5dCk1UbxxenDAdXhHyKemqSL+eLT1RUEeXDjv/teV3XOWP9ogtf8zNKyFGvNgb721Hb7pXKguSO4iT75cnstvv4FClo3VsE/ROnm53vAnQ/9Yvw4DMQbPExn9j+DE31/jwgWk0DmjJxhdhesIh+XUN4L2/9Pgwvg5S5Akd9iPZpsvfNb1pXv0qTOsbpAq/g/sSkOOBRiAIKEd8AeonsjoZY69on7PBtJ0ZprMb2bO7YjLoPViInD8rbIuv27Z5xVZOzCT2tSrp7WYJbqWj8HpdZ2rO5p6KVG+a4dd3p0Yz77u2fEDmSwZV1uUK+CwiKim/r9LRhfiU3IhjM2W5+nU4eVoncOOXYW102MUevPRLB0bXXL1+szOVl9HmRPNLOTuaWynTwuVUIgF8A+V5HS3hIOKE9Sx2SSA+fc79F53DvJAbzade7AMXeYZkcjvj65JaOGh1RwCgaOX2qB+eAHP23shYEyekiznEnoMmIss8VaXnh/K51Fi/+17o/godkAfyejfim82dnAWCK/uoII9Q4R1QStNVIgg4hw9vSiQ5+RU1ikJoR4xt9UB065t9KpmdiG7FIHUAkdYcfDfVukiYH8yD02/nObdtFOCdLh2XbdwsNHbDkJb1ZgUn2izRESbAebl64QzKInCQ9jsDFcn6wJVAz6WeU3pFBmANXtTnKNlYyl0MUzm3T6g8Avi5bbs9i3DvIoKD+rSGgbns72JnZYhIDEtb51zbj2UsiAVbe7WYihxg3lYyeKsfyqvxxvTOmub9oLObH9ZA== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(61400799027)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2024 09:59:01.1139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3cd9c8c2-99fe-492e-96c6-08dd0300a22f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF0000343F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4261 From: Chiara Meiohas Update rdma_netlink.h file upto kernel commit 7566752e4d7d ("RDMA/nldev: Add IB device and net device rename events") Signed-off-by: Chiara Meiohas Reviewed-by: Leon Romanovsky --- rdma/include/uapi/rdma/rdma_netlink.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h index aaa78e93..28404085 100644 --- a/rdma/include/uapi/rdma/rdma_netlink.h +++ b/rdma/include/uapi/rdma/rdma_netlink.h @@ -638,6 +638,8 @@ enum rdma_nl_notify_event_type { RDMA_UNREGISTER_EVENT, RDMA_NETDEV_ATTACH_EVENT, RDMA_NETDEV_DETACH_EVENT, + RDMA_RENAME_EVENT, + RDMA_NETDEV_RENAME_EVENT, }; #endif /* _RDMA_NETLINK_H */ From patchwork Tue Nov 12 09:58:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chiara Meiohas X-Patchwork-Id: 13872006 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2043.outbound.protection.outlook.com [40.107.94.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12DF820E337; Tue, 12 Nov 2024 09:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405557; cv=fail; b=AwEAYLDzz789C5vePFh7zJcj8O0TZOSa33FvXUHyuauCI+TGWF0DVYXQH7JTiCkiOHCQwNPs+C85QMaRFY95vEOq6ZExP0/SEHPh4+WFun2aw+bEcTNIY77lO377yYjqxvsK5S2gBveQmB1uF6GUT+0fgYYneLbOPrN1KmOD+qI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731405557; c=relaxed/simple; bh=UFzmybd5CINut2snZ89G6l1Sc+X0nLuZRMEYV7yGPWM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uR/sWLHU7P1rHcs1QaUuO4YjAcy8iuQ+r1Fmwr0afUYFy+Gsrq8Qv0Cy3gYskDXi+Hd887mkhLI0n7+7Nn2shl3On0D3QGlE8QExIIwXGmem5ApoWm9N0nMjL2sQB6JDqtJVJheiRVi+BJuAAZJ8IjzcZudreY5ayhyaE497pi0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=O48i5FHH; arc=fail smtp.client-ip=40.107.94.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="O48i5FHH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RseiTH9sO4nYmfcceHYXozxa32Se2U5V8mPdZAzTEIgLn4C3So3MU/ULvpZCXkeh3cqmnyXMyuQp/PbatCGeB1MA7MiFruK9gFroc7FqpBNXcfnzhboyJ4e8XGTZYdpyHJLEl6BWkMcmegSRMZdfY7XTmtoT0q6YCh7eASieVG/MOZ5tnjjXNNurZSlvbmMJvz6rGsd/pObxFi7Oe/jCh2zr0mdNZ014AQc35FUOYfHiVTJX6rDXnIeBNuJIKNsgztmeV2qYlZy7qoiM2juReSpBTdlLbobhT+M9xZRJ54D0utsH9Ud4st3wBKIpptMw7HWtfamtQtsaYp8lQbm10Q== 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=W25mBNHOOWlyGTa1da1mskKLnu4+rIC6/5XskelSX/g=; b=Z3Bi6cggSgIvpnfJxcuUPgICm09r/jGezKcxtLTsHE2KdpYcscQl6W/GUWImSRUWV/2qJHZGtFrXVwNCxsPxvXjstglukTFVerXg4xqWGLufvvYQhYA/KGkzuLZ8uDJb5HaH0MGIKt4FhOV5bpymoiawsJm65+NF6YtJqwPh+Se89a+ePuFyhhdtLCt666JQpzHGUuM1i4WkWZczyo5cI1NW77EGSqy8VWHXnAezggk5GfLvXEYZ3E8ZLo/6KTp46KLvE1ePK3bmf61QOHG4E4lxuZeOqftRnknEdNRFwVSd64n0uQePycK3KPvuFWKHzx9VHpSGcv8XyVGzIgcW+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=gmail.com 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=W25mBNHOOWlyGTa1da1mskKLnu4+rIC6/5XskelSX/g=; b=O48i5FHHjwzFwCN3y5EOBhtn8LbmR7b3gJTCClEpKIsGQ/KrIlv44yhGvKx3maYzB54iIi6yTFjxVZO8vgFDXZmEp3H9EBW6yRU7ICZ4kuTii9VVoT2tYsNA2RMG65hLsJSCl6zqQYhHRdyreEQvsfSCFvbPFT08FX55VogRdjf2IFDEGaQZjr+eLwhqgItkBAGpqUSzvDZo1uYVWgWb7KCwn2gagMfy6+h3imanYuEfMx36VrVjdZq6IQWgypVLlGpnu+WATUBTycNKjXk0p+3Zadvsug1pFgFxHIy5QEfBu3KrbIkY6NQQx10HcAHBSzs7KA1HYYbFP0jKX5lMCg== Received: from DM6PR03CA0099.namprd03.prod.outlook.com (2603:10b6:5:333::32) by LV8PR12MB9449.namprd12.prod.outlook.com (2603:10b6:408:204::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.20; Tue, 12 Nov 2024 09:59:04 +0000 Received: from DS2PEPF0000343F.namprd02.prod.outlook.com (2603:10b6:5:333:cafe::a9) by DM6PR03CA0099.outlook.office365.com (2603:10b6:5:333::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29 via Frontend Transport; Tue, 12 Nov 2024 09:59:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS2PEPF0000343F.mail.protection.outlook.com (10.167.18.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Tue, 12 Nov 2024 09:59:04 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:55 -0800 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 12 Nov 2024 01:58:54 -0800 Received: from vdi.nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 12 Nov 2024 01:58:52 -0800 From: Chiara Meiohas To: , CC: , , , , Chiara Meiohas , "Mark Bloch" Subject: [PATCH v3 iproute2-next 5/5] rdma: Add IB device and net device rename events Date: Tue, 12 Nov 2024 11:58:02 +0200 Message-ID: <20241112095802.2355220-6-cmeioahs@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241112095802.2355220-1-cmeioahs@nvidia.com> References: <20241112095802.2355220-1-cmeioahs@nvidia.com> Precedence: bulk X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF0000343F:EE_|LV8PR12MB9449:EE_ X-MS-Office365-Filtering-Correlation-Id: ce56e13e-0208-4059-e1d1-08dd0300a421 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|61400799027; X-Microsoft-Antispam-Message-Info: cmgc2To5LZ+NNxEzbrb4Nhpk1FP3yGhHlx4kth5qJAufRy1hLrnyuBymSyGGpneb7qfHD+yuF49fbtgIjiQG9QW9nDaI0t4gFfGYYSIVlWtMbDRoZCoL8r/VA3pqbBjd9OlJQ9L1IW63F+lxry9fNhbgOMpRUVVteV5CdDu8+E7A/HhFQUB8X6xcGR4slZQdIUaPKhvX71PIHrCtJ3IJ633wfPqB0c5Q6oSTOaCVraMwq8dJVIZqsFq6GCp9e1hlnzQKjUjkDLgGSqVkfd7PS7uuZ1wCoYGDXATqXC18Lv5ZZLqlrZ2Yxmmqvm+N8w0EB19Ge2Al3o5Ch5lBddZtpdlYW0t/hJdJKA1hCre7mlFv2CBUouLcr81A/Ny+D2tmuJSocU5GMnP9s0QENY2HytnM7+XciaIJ4uRvbd2L2zRWS7aywgEVhJI1CRU8UuBiAuue51mevLYO+++zniAonP9kdU4qZnNnj5P7pivlddMRcaS5LaBe+p9suj1LdCwEuvsMHdt/t4B5jkZ/kaCz/RltC85okKzCYHTbc2L5ucjir9hJ1g25++MZen0HibswVdKniRpe96DRxQAcGC1HsFKmoD5DUP4QGGXpwbIuJXoKwUfiPoVVQluFdTpbEXXVvThxXGsm4w+x4DMjbZIdMBhVOJ37mAsXsJDUcetzAFN1MNDeXaMpOAE8KJyYLzvOQVjYNmehBXcSM5RYEESABm+kkOEKyMJIR9thDEQPydAURPZI1ZOmCM9WLra7p914WuTcxAo5ZfhrygxX+i3bpop5aNDU1fEAJJHfSnv5L0CL21Zfyte8In8w48G2TfZAKJqIfbeV8nLhsos5a/xCRcP2vlhfQiQPL5CFSFub6KTC4Ad+f19TupTq+DtRbOenXPc03KPlOFmv8jFopMVMdrYufQFIoC3n4fY8iyiq2VHBecozoFancCNDrYluUkUmJkORJbwmtDotumQ76E4mvfXPdBMQXSgjomSNSwYUZqO0DgS9jcrQPYj1qsPjsU5X247wHYvVlCKciJ9TJK6C58iXZgI5ONLlivIL1uBhPiM62GOg818D25iMKvk0eMxoqG4YoiRIBbXnbsS2Q7phngmqAnUiWD8+dZEfMYMu4RSMtdi7LqN7ZcVqK2QkfysB2H8WKDpre41h8shbUUVpHxtzHCWxrhKyrH3X8jr21vtS8x8slOgGn/7A1r6P68BDnN6CYk2bxAzvfgpjSJC8WBqfyzddet9rE/x3DTqPWulp0c+VMMXAyXrQC+uqpJuA7BJYRqabRvqmrEy3gJIfHcxW9BcO833WmKv8gjlB9ocgjas9PjFNv+NCz/Bbb1NEtXnDQfldDetinHlJ56M1CPD27APAOQpMxME0f22/b6XAZ8nldkbOo+AMXY2HfNsOqn7wst67QKB/gwklKZIHXw== X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(61400799027);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2024 09:59:04.3796 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce56e13e-0208-4059-e1d1-08dd0300a421 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF0000343F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9449 From: Chiara Meiohas rdma monitor displays the IB device name and the netdevice name when displaying event info. Since users can modiy these names, we track and notify on renaming events. $ rdma monitor $ rmmod mlx5_ib [UNREGISTER] dev 1 rocep8s0f1 [UNREGISTER] dev 0 rocep8s0f0 $ modprobe mlx5_ib [REGISTER] dev 2 mlx5_0 [NETDEV_ATTACH] dev 2 mlx5_0 port 1 netdev 4 eth2 [REGISTER] dev 3 mlx5_1 [NETDEV_ATTACH] dev 3 mlx5_1 port 1 netdev 5 eth3 [RENAME] dev 2 rocep8s0f0 [RENAME] dev 3 rocep8s0f1 $ devlink dev eswitch set pci/0000:08:00.0 mode switchdev [UNREGISTER] dev 2 rocep8s0f0 [REGISTER] dev 4 mlx5_0 [NETDEV_ATTACH] dev 4 mlx5_0 port 30 netdev 4 eth2 [RENAME] dev 4 rdmap8s0f0 $ echo 4 > /sys/class/net/eth2/device/sriov_numvfs [NETDEV_ATTACH] dev 4 rdmap8s0f0 port 2 netdev 7 eth4 [NETDEV_ATTACH] dev 4 rdmap8s0f0 port 3 netdev 8 eth5 [NETDEV_ATTACH] dev 4 rdmap8s0f0 port 4 netdev 9 eth6 [NETDEV_ATTACH] dev 4 rdmap8s0f0 port 5 netdev 10 eth7 [REGISTER] dev 5 mlx5_0 [NETDEV_ATTACH] dev 5 mlx5_0 port 1 netdev 11 eth8 [REGISTER] dev 6 mlx5_1 [NETDEV_ATTACH] dev 6 mlx5_1 port 1 netdev 12 eth9 [RENAME] dev 5 rocep8s0f0v0 [RENAME] dev 6 rocep8s0f0v1 [REGISTER] dev 7 mlx5_0 [NETDEV_ATTACH] dev 7 mlx5_0 port 1 netdev 13 eth10 [RENAME] dev 7 rocep8s0f0v2 [REGISTER] dev 8 mlx5_0 [NETDEV_ATTACH] dev 8 mlx5_0 port 1 netdev 14 eth11 [RENAME] dev 8 rocep8s0f0v3 $ ip link set eth2 name myeth2 [NETDEV_RENAME] netdev 4 myeth2 $ ip link set eth1 name myeth1 ** no events received, because eth1 is not attached to an IB device ** Signed-off-by: Chiara Meiohas Reviewed-by: Mark Bloch Reviewed-by: Leon Romanovsky --- rdma/monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rdma/monitor.c b/rdma/monitor.c index 8c14d575..fc80f7d8 100644 --- a/rdma/monitor.c +++ b/rdma/monitor.c @@ -41,6 +41,8 @@ static void mon_print_event_type(struct nlattr **tb) [RDMA_UNREGISTER_EVENT] = "[UNREGISTER]", [RDMA_NETDEV_ATTACH_EVENT] = "[NETDEV_ATTACH]", [RDMA_NETDEV_DETACH_EVENT] = "[NETDEV_DETACH]", + [RDMA_RENAME_EVENT] = "[RENAME]", + [RDMA_NETDEV_RENAME_EVENT] = "[NETDEV_RENAME]", }; enum rdma_nl_notify_event_type etype; char unknown_type[32];