From f3a8c0f936fc748f1e86931464b2876e7ba5bb58 Mon Sep 17 00:00:00 2001 From: Stephen Champion Date: Fri, 9 Dec 2016 12:31:49 -0800 Subject: [PATCH] LU-7734 lnet: Update lnetctl usage Bring lnetctl help descriptions, man page, and usage in line with changes to peer functions. Signed-off-by: Stephen Champion Test-Parameters: trivial Change-Id: Idf115319727d92f23e50a97585f2f2c1e8c1b7b8 Reviewed-on: https://review.whamcloud.com/24279 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Olaf Weber Reviewed-by: Amir Shehata Tested-by: Amir Shehata --- lnet/utils/lnetctl.c | 9 +++-- lustre/doc/lnetctl.8 | 107 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 75 insertions(+), 41 deletions(-) diff --git a/lnet/utils/lnetctl.c b/lnet/utils/lnetctl.c index 1c6c731..2707787 100644 --- a/lnet/utils/lnetctl.c +++ b/lnet/utils/lnetctl.c @@ -144,8 +144,9 @@ command_t peer_cmds[] = { "\t--prim_nid: Primary NID of the peer.\n" "\t--nid: list of NIDs to remove. If none provided,\n" "\t peer is deleted\n"}, - {"show", jt_show_peer, 0, "show peer credits\n" - "\t--nid: NID of peer to filter on.\n"}, + {"show", jt_show_peer, 0, "show peer information\n" + "\t--nid: NID of peer to filter on.\n" + "\t--verbose: Include extended statistics\n"}, { 0, 0, 0, NULL } }; @@ -1202,7 +1203,7 @@ static int jt_show_peer(int argc, char **argv) struct cYAML *err_rc = NULL, *show_rc = NULL; int detail = 0; - const char *const short_options = "k:vh"; + const char *const short_options = "n:vh"; const struct option long_options[] = { { "nid", 1, NULL, 'n' }, { "verbose", 0, NULL, 'v' }, @@ -1213,7 +1214,7 @@ static int jt_show_peer(int argc, char **argv) while ((opt = getopt_long(argc, argv, short_options, long_options, NULL)) != -1) { switch (opt) { - case 'k': + case 'n': nid = optarg; break; case 'v': diff --git a/lustre/doc/lnetctl.8 b/lustre/doc/lnetctl.8 index 2dba6e2..00e8849 100644 --- a/lustre/doc/lnetctl.8 +++ b/lustre/doc/lnetctl.8 @@ -102,6 +102,54 @@ parameter\. . .br \-\-verbose: display detailed output per network + +. +.SS "Peer Configuration" +.TP +\fBlnetctl peer\fR add +Configure an LNET peer with at least one supplied NID\. By default, peers are marked as multi-rail capable\. If prim_nid is not specified, the first NID in this list is assumed to be the primary NID for the peer. +. +.br +. +\-\-nid: one or more peer NIDs to add to the peer\. +. +.br +. +\-\-prim_nid: Primary NID of the peer\. +. +.br +\-\-non_mr: create this peer as not Multi-Rail capable\. +. +.br + +.TP +\fBlnetctl peer\fR del +Delete a peer NID. The primary NID must be specified. If the removed NID is the primary NID, the peer entry will be deleted. +. +.br +. +\-\-nid: one or more peer NIDs to remove from the peer\. +. +.br +. +\-\-prim_nid: Primary NID of the peer\. +. +.br + +.TP +\fBlnetctl peer\fR show +Show configured peers. By default, lists all peers and associated NIDs. +. +.br +. +\-\-nid: list of primary nids to filter on +. +.br +. +\-\-verbose: Include extended statistics, including credits and counters. +. +.br + . .SS "Route Configuration" . @@ -278,33 +326,6 @@ Show LNET statistics .br . -.SS "Showing Peer Credits" -. -.TP -\fBlnetctl peer_credits\fR -Show details on configured peer credits -. -.br -\-> Peer nid -. -.br -\-> State -. -.br -\-> Reference count on the peer -. -.br -\-> Maximum transmit credits -. -.br -\-> Available transmit credits -. -.br -\-> Available router credits -. -.br -\-> Minimum router credits\. -. .SH "EXAMPLES" . .SS "Initializing LNet after load" @@ -585,10 +606,10 @@ statistics: . .br . -.SS "Showing peer credits information" +.SS "Showing peer information" . .IP "\(bu" 4 -lnetctl peer_credits show +lnetctl peer show . .IP "" 0 . @@ -596,28 +617,40 @@ lnetctl peer_credits show peer: . .br - \- nid: 192\.168\.205\.131@tcp1 + \- primary nid: 10\.148\.0\.8@o2ib +. +.br + Multi\-Rail: True +. +.br + peer ni: +. +.br + \- nid: 10\.148\.0\.8@o2ib +. +.br + state: NA . .br - state: down + \- primary nid: 10\.148\.0\.20@o2ib . .br - refcount: 4 + Multi\-Rail: True . .br - max_ni_tx_credits: 8 + peer ni: . .br - available_tx_credits: 8 + \- nid: 10\.148\.0\.20@o2ib . .br - available_rtr_credits: 8 + state: NA . .br - min_rtr_credits: 7 + \- nid: 10\.148\.0\.25@o2ib . .br - tx_q_num_of_buf: 0 + state: NA . .br -- 1.8.3.1