Whamcloud - gitweb
LU-10452 lnet: cleanup YAML output
[fs/lustre-release.git] / lnet / utils / lnetconfig / liblnetconfig_lnd.c
index ae5d770..be820b5 100644 (file)
@@ -20,7 +20,7 @@
  *
  * Copyright (c) 2015, James Simmons
  *
- * Copyright (c) 2016, Intel Corporation.
+ * Copyright (c) 2016, 2017, Intel Corporation.
  *
  * Author:
  *   James Simmons <jsimmons@infradead.org>
@@ -31,8 +31,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <libcfs/util/ioctl.h>
+#include "liblnd.h"
 #include "liblnetconfig.h"
-#include "cyaml.h"
 
 static int
 lustre_o2iblnd_show_tun(struct cYAML *lndparams,
@@ -62,6 +62,10 @@ lustre_o2iblnd_show_tun(struct cYAML *lndparams,
                                lnd_cfg->lnd_fmr_cache) == NULL)
                return LUSTRE_CFG_RC_OUT_OF_MEM;
 
+       if (cYAML_create_number(lndparams, "ntx",
+                               lnd_cfg->lnd_ntx) == NULL)
+               return LUSTRE_CFG_RC_OUT_OF_MEM;
+
        if (cYAML_create_number(lndparams, "conns_per_peer",
                                lnd_cfg->lnd_conns_per_peer) == NULL)
                return LUSTRE_CFG_RC_OUT_OF_MEM;
@@ -107,7 +111,7 @@ lustre_ni_show_tunables(struct cYAML *lnd_tunables,
                        __u32 net_type,
                        struct lnet_lnd_tunables *lnd)
 {
-       int rc = LUSTRE_CFG_RC_NO_ERR;
+       int rc = LUSTRE_CFG_RC_NO_MATCH;
 
        if (net_type == O2IBLND)
                rc = lustre_o2iblnd_show_tun(lnd_tunables,
@@ -123,7 +127,7 @@ yaml_extract_o2ib_tun(struct cYAML *tree,
        struct cYAML *map_on_demand = NULL, *concurrent_sends = NULL;
        struct cYAML *fmr_pool_size = NULL, *fmr_cache = NULL;
        struct cYAML *fmr_flush_trigger = NULL, *lndparams = NULL;
-       struct cYAML *conns_per_peer = NULL;
+       struct cYAML *conns_per_peer = NULL, *ntx = NULL;
 
        lndparams = cYAML_get_object_item(tree, "lnd tunables");
        if (!lndparams)
@@ -150,6 +154,9 @@ yaml_extract_o2ib_tun(struct cYAML *tree,
        lnd_cfg->lnd_fmr_cache =
                (fmr_cache) ? fmr_cache->cy_valueint : 0;
 
+       ntx = cYAML_get_object_item(lndparams, "ntx");
+       lnd_cfg->lnd_ntx = (ntx) ? ntx->cy_valueint : 0;
+
        conns_per_peer = cYAML_get_object_item(lndparams, "conns_per_peer");
        lnd_cfg->lnd_conns_per_peer =
                (conns_per_peer) ? conns_per_peer->cy_valueint : 1;