Whamcloud - gitweb
LU-13569 lnet: Add health ping stats
[fs/lustre-release.git] / lnet / utils / lnetconfig / liblnetconfig.c
index c815732..dd59a33 100644 (file)
@@ -2250,6 +2250,14 @@ continue_without_udsp_info:
                                                hstats.hlni_local_error)
                                                        == NULL)
                                goto out;
+                       if (cYAML_create_number(yhstats, "ping_count",
+                                               hstats.hlni_ping_count)
+                                                       == NULL)
+                               goto out;
+                       if (cYAML_create_number(yhstats, "next_ping",
+                                               hstats.hlni_next_ping)
+                                                       == NULL)
+                               goto out;
 
 continue_without_msg_stats:
                        tunables = cYAML_create_object(item, "tunables");
@@ -3134,6 +3142,16 @@ continue_without_udsp_info:
                                                hstats->hlpni_network_timeout)
                                                        == NULL)
                                goto out;
+                       if (cYAML_create_number(yhstats, "ping_count",
+                                               hstats->hlpni_ping_count)
+                                                       == NULL)
+                               goto out;
+
+                       if (cYAML_create_number(yhstats, "next_ping",
+                                               hstats->hlpni_next_ping)
+                                                       == NULL)
+                               goto out;
+
                }
        }
 
@@ -3710,7 +3728,7 @@ int lustre_lnet_show_max_intf(int seq_no, struct cYAML **show_rc,
        }
 
        return build_global_yaml_entry(err_str, sizeof(err_str), seq_no,
-                                      "max_intf", max_intf, show_rc,
+                                      "max_interfaces", max_intf, show_rc,
                                       err_rc, l_errno);
 }
 
@@ -4735,7 +4753,9 @@ static int handle_yaml_config_global_settings(struct cYAML *tree,
        int rc = 0;
 
        seq_no = cYAML_get_object_item(tree, "seq_no");
-       max_intf = cYAML_get_object_item(tree, "max_intf");
+       max_intf = cYAML_get_object_item(tree, "max_interfaces");
+       if (!max_intf) /* try legacy name */
+               max_intf = cYAML_get_object_item(tree, "max_intf");
        if (max_intf)
                rc = lustre_lnet_config_max_intf(max_intf->cy_valueint,
                                                 seq_no ? seq_no->cy_valueint
@@ -4823,7 +4843,9 @@ static int handle_yaml_del_global_settings(struct cYAML *tree,
        int rc = 0;
 
        seq_no = cYAML_get_object_item(tree, "seq_no");
-       max_intf = cYAML_get_object_item(tree, "max_intf");
+       max_intf = cYAML_get_object_item(tree, "max_interfaces");
+       if (!max_intf) /* try legacy name */
+               max_intf = cYAML_get_object_item(tree, "max_intf");
        if (max_intf)
                rc = lustre_lnet_config_max_intf(LNET_INTERFACES_MAX_DEFAULT,
                                                 seq_no ? seq_no->cy_valueint
@@ -4864,7 +4886,9 @@ static int handle_yaml_show_global_settings(struct cYAML *tree,
        int rc = 0;
 
        seq_no = cYAML_get_object_item(tree, "seq_no");
-       max_intf = cYAML_get_object_item(tree, "max_intf");
+       max_intf = cYAML_get_object_item(tree, "max_interfaces");
+       if (!max_intf) /* try legacy name */
+               max_intf = cYAML_get_object_item(tree, "max_intf");
        if (max_intf)
                rc = lustre_lnet_show_max_intf(seq_no ? seq_no->cy_valueint
                                                        : -1,