From patchwork Wed Jul 10 07:24:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 1130236 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="1qQ+Q23R"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45k9hC0xzhz9s8m for ; Wed, 10 Jul 2019 17:25:31 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727290AbfGJHZa (ORCPT ); Wed, 10 Jul 2019 03:25:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:50972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727142AbfGJHZ3 (ORCPT ); Wed, 10 Jul 2019 03:25:29 -0400 Received: from localhost (unknown [37.142.3.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6A3162064A; Wed, 10 Jul 2019 07:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562743528; bh=G/KyMQ/sBMSGwWT989Jllk8MzKBp/jEPFdA2ekkuwY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1qQ+Q23RBxpAUq9gTszG/XRC8KJBj6POObVtgekhTe7r5v6Wa5Ecs0N5kIrdN14Jg IzxOWdHY4dl6vsfAfge2si0r9NbEZtgu5rbnA3FglrQr/eFI3nwIiOkJb3ZFnt0f1h hPBPjhapzRLMPqvIFErxuJsuf1WodaJn5Lt2bqTM= From: Leon Romanovsky To: Stephen Hemminger Cc: Leon Romanovsky , netdev , David Ahern , Mark Zhang , RDMA mailing list Subject: [PATCH iproute2-rc 8/8] rdma: Document counter statistic Date: Wed, 10 Jul 2019 10:24:55 +0300 Message-Id: <20190710072455.9125-9-leon@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190710072455.9125-1-leon@kernel.org> References: <20190710072455.9125-1-leon@kernel.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Mark Zhang Add document of accessing the QP counter, including bind/unbind a QP to a counter manually or automatically, and dump counter statistics. Signed-off-by: Mark Zhang Signed-off-by: Leon Romanovsky --- man/man8/rdma-dev.8 | 1 + man/man8/rdma-link.8 | 1 + man/man8/rdma-resource.8 | 1 + man/man8/rdma-statistic.8 | 167 ++++++++++++++++++++++++++++++++++++++ man/man8/rdma.8 | 7 +- 5 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 man/man8/rdma-statistic.8 diff --git a/man/man8/rdma-dev.8 b/man/man8/rdma-dev.8 index 38e34b3b..e77e7cd0 100644 --- a/man/man8/rdma-dev.8 +++ b/man/man8/rdma-dev.8 @@ -77,6 +77,7 @@ previously created using iproute2 ip command. .BR rdma-link (8), .BR rdma-resource (8), .BR rdma-system (8), +.BR rdma-statistic (8), .br .SH AUTHOR diff --git a/man/man8/rdma-link.8 b/man/man8/rdma-link.8 index b3b40de7..32f80228 100644 --- a/man/man8/rdma-link.8 +++ b/man/man8/rdma-link.8 @@ -97,6 +97,7 @@ Removes RXE link rxe_eth0 .BR rdma (8), .BR rdma-dev (8), .BR rdma-resource (8), +.BR rdma-statistic (8), .br .SH AUTHOR diff --git a/man/man8/rdma-resource.8 b/man/man8/rdma-resource.8 index 40b073db..05030d0a 100644 --- a/man/man8/rdma-resource.8 +++ b/man/man8/rdma-resource.8 @@ -103,6 +103,7 @@ Show CQs belonging to pid 30489 .BR rdma (8), .BR rdma-dev (8), .BR rdma-link (8), +.BR rdma-statistic (8), .br .SH AUTHOR diff --git a/man/man8/rdma-statistic.8 b/man/man8/rdma-statistic.8 new file mode 100644 index 00000000..2c31b08a --- /dev/null +++ b/man/man8/rdma-statistic.8 @@ -0,0 +1,167 @@ +.TH RDMA\-STATISTIC 8 "17 Mar 2019" "iproute2" "Linux" +.SH NAME +rdma-statistic \- RDMA statistic counter configuration +.SH SYNOPSIS +.sp +.ad l +.in +8 +.ti -8 +.B rdma +.RI "[ " OPTIONS " ]" +.B statistic +.RI " { " COMMAND " | " +.BR help " }" +.sp + +.ti -8 +.B rdma statistic +.RI "[ " OBJECT " ]" +.B show + +.ti -8 +.B rdma statistic +.RI "[ " OBJECT " ]" +.B show link +.RI "[ " DEV/PORT_INDX " ]" + +.ti -8 +.B rdma statistic +.IR OBJECT +.B mode + +.ti -8 +.B rdma statistic +.IR OBJECT +.B set +.IR COUNTER_SCOPE +.RI "[ " DEV/PORT_INDEX "]" +.B auto +.RI "{ " CRITERIA " | " +.BR off " }" + +.ti -8 +.B rdma statistic +.IR OBJECT +.B bind +.IR COUNTER_SCOPE +.RI "[ " DEV/PORT_INDEX "]" +.RI "[ " OBJECT-ID " ]" +.RI "[ " COUNTER-ID " ]" + +.ti -8 +.B rdma statistic +.IR OBJECT +.B unbind +.IR COUNTER_SCOPE +.RI "[ " DEV/PORT_INDEX "]" +.RI "[ " COUNTER-ID " ]" +.RI "[ " OBJECT-ID " ]" + +.ti -8 +.IR COUNTER_SCOPE " := " +.RB "{ " link " | " dev " }" + +.ti -8 +.IR OBJECT " := " +.RB "{ " qp " }" + +.ti -8 +.IR CRITERIA " := " +.RB "{ " type " }" + +.SH "DESCRIPTION" +.SS rdma statistic [object] show - Queries the specified RDMA device for RDMA and driver-specific statistics. Show the default hw counters if object is not specified + +.PP +.I "DEV" +- specifies counters on this RDMA device to show. + +.I "PORT_INDEX" +- specifies counters on this RDMA port to show. + +.SS rdma statistic set - configure counter statistic auto-mode for a specific device/port +In auto mode all objects belong to one category are bind automatically to a single counter set. + +.SS rdma statistic bind - manually bind an object (e.g., a qp) with a counter +When bound the statistics of this object are available in this counter. + +.SS rdma statistic unbind - manually unbind an object (e.g., a qp) from the counter previously bound +When unbound the statistics of this object are no longer available in this counter; And if object id is not specified then all objects on this counter will be unbound. + +.I "COUNTER-ID" +- specifies the id of the counter to be bound. +If this argument is omitted then a new counter will be allocated. + +.SH "EXAMPLES" +.PP +rdma statistic show +.RS 4 +Shows the state of the default counter of all RDMA devices on the system. +.RE +.PP +rdma statistic show link mlx5_2/1 +.RS 4 +Shows the state of the default counter of specified RDMA port +.RE +.PP +rdma statistic qp show +.RS 4 +Shows the state of all qp counters of all RDMA devices on the system. +.RE +.PP +rdma statistic qp show link mlx5_2/1 +.RS 4 +Shows the state of all qp counters of specified RDMA port. +.RE +.PP +rdma statistic qp show link mlx5_2 pid 30489 +.RS 4 +Shows the state of all qp counters of specified RDMA port and belonging to pid 30489 +.RE +.PP +rdma statistic qp mode +.RS 4 +List current counter mode on all deivces +.RE +.PP +rdma statistic qp mode link mlx5_2/1 +.RS 4 +List current counter mode of device mlx5_2 port 1 +.RE +.PP +rdma statistic qp set link mlx5_2/1 auto type on +.RS 4 +On device mlx5_2 port 1, for each new QP bind it with a counter automatically. Per counter for QPs with same qp type in each process. Currently only "type" is supported. +.RE +.PP +rdma statistic qp set link mlx5_2/1 auto off +.RS 4 +Turn-off auto mode on device mlx5_2 port 1. The allocated counters can be manually accessed. +.RE +.PP +rdma statistic qp bind link mlx5_2/1 lqpn 178 +.RS 4 +On device mlx5_2 port 1, allocate a counter and bind the specified qp on it +.RE +.PP +rdma statistic qp unbind link mlx5_2/1 cntn 4 lqpn 178 +.RS 4 +On device mlx5_2 port 1, bind the specified qp on the specified counter +.RE +.PP +rdma statistic qp unbind link mlx5_2/1 cntn 4 +.RS 4 +On device mlx5_2 port 1, unbind all QPs on the specified counter. After that this counter will be released automatically by the kernel. + +.RE +.PP + +.SH SEE ALSO +.BR rdma (8), +.BR rdma-dev (8), +.BR rdma-link (8), +.BR rdma-resource (8), +.br + +.SH AUTHOR +Mark Zhang diff --git a/man/man8/rdma.8 b/man/man8/rdma.8 index 3ae33987..ef29b1c6 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 " | " system " }" +.BR dev " | " link " | " system " | " statistic " }" .sp .ti -8 @@ -74,6 +74,10 @@ Generate JSON output. .B sys - RDMA subsystem related. +.TP +.B statistic +- RDMA counter statistic related. + .PP The names of all objects may be written in full or abbreviated form, for example @@ -112,6 +116,7 @@ Exit status is 0 if command was successful or a positive integer upon failure. .BR rdma-link (8), .BR rdma-resource (8), .BR rdma-system (8), +.BR rdma-statistic (8), .br .SH REPORTING BUGS