Whamcloud - gitweb
LU-10157 lnet: make LNET_MAX_IOV dependent on page size
[fs/lustre-release.git] / lnet / utils / lst.c
index ff8db84..0b6d40a 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2016, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -51,7 +51,7 @@
 #include <linux/lnet/lnetctl.h>
 #include <linux/lnet/lnetst.h>
 #include <linux/lnet/nidstr.h>
-#include <utils/obdctl.h>
+#include "lnetconfig/liblnetconfig.h"
 
 struct lst_sid LST_INVALID_SID = { .ses_nid = LNET_NID_ANY, .ses_stamp = -1 };
 static struct lst_sid session_id;
@@ -2952,8 +2952,6 @@ lst_get_bulk_param(int argc, char **argv, struct lst_test_bulk_param *bulk)
 
                } else if (strcasestr(argv[i], "size=") == argv[i] ||
                           strcasestr(argv[i], "s=") == argv[i]) {
-                       int max_size = sysconf(_SC_PAGESIZE) * LNET_MAX_IOV;
-
                         tok = strchr(argv[i], '=') + 1;
 
                         bulk->blk_size = strtol(tok, &end, 0);
@@ -2970,7 +2968,7 @@ lst_get_bulk_param(int argc, char **argv, struct lst_test_bulk_param *bulk)
                         else if (*end == 'm' || *end == 'M')
                                 bulk->blk_size *= 1024 * 1024;
 
-                       if (bulk->blk_size > max_size) {
+                       if (bulk->blk_size > LNET_MTU) {
                                 fprintf(stderr, "Size exceed limitation: %d bytes\n",
                                         bulk->blk_size);
                                 return -1;
@@ -3332,9 +3330,9 @@ main(int argc, char **argv)
         if (rc < 0)
                 goto errorout;
 
-        rc = ptl_initialize(argc, argv);
-        if (rc < 0)
-                goto errorout;
+       rc = lustre_lnet_config_lib_init();
+       if (rc < 0)
+               goto errorout;
 
         Parser_init("lst > ", lst_cmdlist);