Whamcloud - gitweb
LU-6245 lnet: remove kernel defines in userland headers 92/13792/6
authorJames Simmons <uja.ornl@gmail.com>
Thu, 19 Mar 2015 15:57:34 +0000 (11:57 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 25 Mar 2015 23:58:48 +0000 (23:58 +0000)
Currently the lnet headers used for user land applications
contain various kernel definations. This is due to the
fact libcfs contains kernel wrappers for user land which
will be going away. This patch sorted the header data
so all kernel containing structures are moved out of
headers that user land will use.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I3904cd692bf2debd3123cbf8ca98dfc518ce0a97
Reviewed-on: http://review.whamcloud.com/13792
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
19 files changed:
libcfs/include/libcfs/libcfs.h
lnet/include/lnet/api.h
lnet/include/lnet/lib-dlc.h
lnet/include/lnet/lib-lnet.h
lnet/include/lnet/lib-types.h
lnet/include/lnet/lnet.h
lnet/include/lnet/lnetctl.h
lnet/include/lnet/lnetst.h
lnet/include/lnet/socklnd.h
lnet/include/lnet/types.h
lnet/lnet/acceptor.c
lnet/lnet/api-ni.c
lnet/selftest/selftest.h
lnet/utils/lnetconfig/liblnetconfig.c
lnet/utils/lnetconfig/liblnetconfig.h
lnet/utils/lst.c
lnet/utils/portals.c
lnet/utils/wirecheck.c
lustre/include/lustre_net.h

index 39511fe..c82a3d9 100644 (file)
 
 #include "curproc.h"
 
-#ifndef offsetof
-# define offsetof(typ,memb) ((long)(long_ptr_t)((char *)&(((typ *)0)->memb)))
-#endif
-
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(a) ((sizeof (a)) / (sizeof ((a)[0])))
 #endif
index 8b04a9a..1d0f648 100644 (file)
  * @{
  */
 
+#ifndef __KERNEL__
+# error This include is only for kernel use.
+#endif
+
 #include <lnet/types.h>
 
 /** \defgroup lnet_init_fini Initialization and cleanup
index 59d57b0..77b15b8 100644 (file)
@@ -28,7 +28,7 @@
 #define LNET_DLC_H
 
 #include <libcfs/libcfs_ioctl.h>
-#include <lnet/lib-types.h>
+#include <lnet/types.h>
 
 #define MAX_NUM_SHOW_ENTRIES   32
 #define LNET_MAX_STR_LEN       128
@@ -40,6 +40,13 @@ struct lnet_ioctl_net_config {
        __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT];
 };
 
+#define LNET_TINY_BUF_IDX      0
+#define LNET_SMALL_BUF_IDX     1
+#define LNET_LARGE_BUF_IDX     2
+
+/* # different router buffer pools */
+#define LNET_NRBPOOLS          (LNET_LARGE_BUF_IDX + 1)
+
 struct lnet_ioctl_pool_cfg {
        struct {
                __u32 pl_npages;
index 4fe3a86..5676cdb 100644 (file)
 #ifndef __LNET_LIB_LNET_H__
 #define __LNET_LIB_LNET_H__
 
+#ifndef __KERNEL__
+# error This include is only for kernel use.
+#endif
+
 #include <libcfs/libcfs.h>
-#include <lnet/types.h>
+#include <lnet/api.h>
 #include <lnet/lnet.h>
 #include <lnet/lib-types.h>
-#include <lnet/lib-dlc.h>
 
 extern lnet_t  the_lnet;                        /* THE network */
 
index 884d473..4c0c98b 100644 (file)
 #ifndef __LNET_LIB_TYPES_H__
 #define __LNET_LIB_TYPES_H__
 
-#ifdef __KERNEL__
-# include <linux/uio.h>
-# include <linux/types.h>
-# include <net/sock.h>
-#else /* !__KERNEL__ */
-# include <sys/types.h>
-#endif /* __KERNEL__ */
-
-#include <libcfs/libcfs.h>
-#include <libcfs/list.h>
-#include <lnet/types.h>
-#include <lnet/lnetctl.h>
+#ifndef __KERNEL__
+# error This include is only for kernel use.
+#endif
 
-#define WIRE_ATTR       __attribute__((packed))
+#include <linux/uio.h>
+#include <linux/types.h>
+#include <net/sock.h>
 
-/* Packed version of lnet_process_id_t to transfer via network */
-typedef struct {
-        lnet_nid_t nid;
-        lnet_pid_t pid;   /* node id / process id */
-} WIRE_ATTR lnet_process_id_packed_t;
-
-/* The wire handle's interface cookie only matches one network interface in
- * one epoch (i.e. new cookie when the interface restarts or the node
- * reboots).  The object cookie only matches one object on that interface
- * during that object's lifetime (i.e. no cookie re-use). */
-typedef struct {
-        __u64 wh_interface_cookie;
-        __u64 wh_object_cookie;
-} WIRE_ATTR lnet_handle_wire_t;
-
-typedef enum {
-        LNET_MSG_ACK = 0,
-        LNET_MSG_PUT,
-        LNET_MSG_GET,
-        LNET_MSG_REPLY,
-        LNET_MSG_HELLO,
-} lnet_msg_type_t;
-
-/* The variant fields of the portals message header are aligned on an 8
- * byte boundary in the message header.  Note that all types used in these
- * wire structs MUST be fixed size and the smaller types are placed at the
- * end. */
-typedef struct lnet_ack {
-        lnet_handle_wire_t  dst_wmd;
-        __u64               match_bits;
-        __u32               mlength;
-} WIRE_ATTR lnet_ack_t;
-
-typedef struct lnet_put {
-        lnet_handle_wire_t  ack_wmd;
-        __u64               match_bits;
-        __u64               hdr_data;
-        __u32               ptl_index;
-        __u32               offset;
-} WIRE_ATTR lnet_put_t;
-
-typedef struct lnet_get {
-        lnet_handle_wire_t  return_wmd;
-        __u64               match_bits;
-        __u32               ptl_index;
-        __u32               src_offset;
-        __u32               sink_length;
-} WIRE_ATTR lnet_get_t;
-
-typedef struct lnet_reply {
-        lnet_handle_wire_t  dst_wmd;
-} WIRE_ATTR lnet_reply_t;
-
-typedef struct lnet_hello {
-        __u64              incarnation;
-        __u32              type;
-} WIRE_ATTR lnet_hello_t;
+#include <lnet/lnetctl.h>
 
-typedef struct {
-        lnet_nid_t          dest_nid;
-        lnet_nid_t          src_nid;
-        lnet_pid_t          dest_pid;
-        lnet_pid_t          src_pid;
-        __u32               type;               /* lnet_msg_type_t */
-        __u32               payload_length;     /* payload data to follow */
-        /*<------__u64 aligned------->*/
-        union {
-                lnet_ack_t   ack;
-                lnet_put_t   put;
-                lnet_get_t   get;
-                lnet_reply_t reply;
-                lnet_hello_t hello;
-        } msg;
-} WIRE_ATTR lnet_hdr_t;
-
-/* A HELLO message contains a magic number and protocol version
- * code in the header's dest_nid, the peer's NID in the src_nid, and
- * LNET_MSG_HELLO in the type field.  All other common fields are zero
- * (including payload_size; i.e. no payload).
- * This is for use by byte-stream LNDs (e.g. TCP/IP) to check the peer is
- * running the same protocol and to find out its NID. These LNDs should
- * exchange HELLO messages when a connection is first established.  Individual
- * LNDs can put whatever else they fancy in lnet_hdr_t::msg.
- */
-typedef struct {
-        __u32   magic;                          /* LNET_PROTO_TCP_MAGIC */
-        __u16   version_major;                  /* increment on incompatible change */
-        __u16   version_minor;                  /* increment on compatible change */
-} WIRE_ATTR lnet_magicversion_t;
-
-/* PROTO MAGIC for LNDs */
-#define LNET_PROTO_IB_MAGIC                 0x0be91b91
-#define LNET_PROTO_RA_MAGIC                 0x0be91b92
-#define LNET_PROTO_QSW_MAGIC                0x0be91b93
-#define LNET_PROTO_GNI_MAGIC                0xb00fbabe /* ask Kim */
-#define LNET_PROTO_TCP_MAGIC                0xeebc0ded
-#define LNET_PROTO_PTL_MAGIC                0x50746C4E /* 'PtlN' unique magic */
-#define LNET_PROTO_MX_MAGIC                 0x4d583130 /* 'MX10'! */
-#define LNET_PROTO_ACCEPTOR_MAGIC           0xacce7100
-#define LNET_PROTO_PING_MAGIC               0x70696E67 /* 'ping' */
-
-/* Placeholder for a future "unified" protocol across all LNDs */
-/* Current LNDs that receive a request with this magic will respond with a
- * "stub" reply using their current protocol */
-#define LNET_PROTO_MAGIC                    0x45726963 /* ! */
-
-
-#define LNET_PROTO_TCP_VERSION_MAJOR        1
-#define LNET_PROTO_TCP_VERSION_MINOR        0
-
-/* Acceptor connection request */
-typedef struct {
-        __u32       acr_magic;                  /* PTL_ACCEPTOR_PROTO_MAGIC */
-        __u32       acr_version;                /* protocol version */
-        __u64       acr_nid;                    /* target NID */
-} WIRE_ATTR lnet_acceptor_connreq_t;
+/* Max payload size */
+#ifndef CONFIG_LNET_MAX_PAYLOAD
+# error "CONFIG_LNET_MAX_PAYLOAD must be defined in config.h"
+#endif
 
-#define LNET_PROTO_ACCEPTOR_VERSION       1
+#define LNET_MAX_PAYLOAD       CONFIG_LNET_MAX_PAYLOAD
+#if (LNET_MAX_PAYLOAD < LNET_MTU)
+# error "LNET_MAX_PAYLOAD too small - error in configure --with-max-payload-mb"
+#elif (LNET_MAX_PAYLOAD > (PAGE_SIZE * LNET_MAX_IOV))
+# error "LNET_MAX_PAYLOAD too large - error in configure --with-max-payload-mb"
+#endif
 
 /* forward refs */
 struct lnet_libmd;
@@ -366,9 +254,6 @@ typedef struct lnet_lnd
        int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock);
 } lnd_t;
 
-#define LNET_NI_STATUS_UP      0x15aac0de
-#define LNET_NI_STATUS_DOWN    0xdeadface
-#define LNET_NI_STATUS_INVALID 0x00000000
 typedef struct {
         lnet_nid_t ns_nid;
         __u32      ns_status;
@@ -382,8 +267,6 @@ struct lnet_tx_queue {
        struct list_head        tq_delayed;     /* delayed TXs */
 };
 
-#define LNET_MAX_INTERFACES    16
-
 typedef struct lnet_ni {
        spinlock_t              ni_lock;
        struct list_head        ni_list;        /* chain on ln_nis */
@@ -562,29 +445,8 @@ typedef struct {
        lnet_kiov_t              rb_kiov[0];    /* the buffer space */
 } lnet_rtrbuf_t;
 
-typedef struct lnet_counters {
-       __u32 msgs_alloc;
-       __u32 msgs_max;
-       __u32 errors;
-       __u32 send_count;
-       __u32 recv_count;
-       __u32 route_count;
-       __u32 drop_count;
-       __u64 send_length;
-       __u64 recv_length;
-       __u64 route_length;
-       __u64 drop_length;
-} WIRE_ATTR lnet_counters_t;
-
 #define LNET_PEER_HASHSIZE   503                /* prime! */
 
-#define LNET_TINY_BUF_IDX      0
-#define LNET_SMALL_BUF_IDX     1
-#define LNET_LARGE_BUF_IDX     2
-
-/* # different router buffer pools */
-#define LNET_NRBPOOLS          (LNET_LARGE_BUF_IDX + 1)
-
 enum {
        /* Didn't match anything */
        LNET_MATCHMD_NONE       = (1 << 0),
index 5e1ad6d..a94790c 100644 (file)
@@ -44,7 +44,7 @@
  */
 
 #include <lnet/types.h>
-#include <lnet/api.h>
+#include <lnet/lib-dlc.h>
 #include <lnet/nidstr.h>
 
 #endif
index be19661..f60a354 100644 (file)
 /*
  * Copyright (c) 2014, Intel Corporation.
  */
-#ifndef _PTLCTL_H_
-#define _PTLCTL_H_
+#ifndef _LNETCTL_H_
+#define _LNETCTL_H_
 
-#include <libcfs/libcfs.h>
 #include <lnet/types.h>
 
 /** \addtogroup lnet_fault_simulation
index 62ff200..086ecbc 100644 (file)
@@ -41,9 +41,6 @@
 #ifndef __LNET_ST_H__
 #define __LNET_ST_H__
 
-#include <libcfs/libcfs.h>
-#include <lnet/lib-types.h>
-
 #define LST_FEAT_NONE          (0)
 #define LST_FEAT_BULK_LEN      (1 << 0)        /* enable variable page size */
 
index 644f360..1271344 100644 (file)
@@ -39,7 +39,6 @@
 #define __LNET_LNET_SOCKLND_H__
 
 #include <lnet/types.h>
-#include <lnet/lib-types.h>
 
 #define SOCKLND_CONN_NONE     (-1)
 #define SOCKLND_CONN_ANY        0
@@ -71,7 +70,7 @@ typedef struct {
          * ksnm_payload is removed because of winnt compiler's limitation:
          * zero-sized array can only be placed at the tail of [nested]
          * structure definitions. lnet payload will be stored just after
-         * the body of structure ksock_lnet_msg_t 
+        * the body of structure ksock_lnet_msg_t
          */
 } WIRE_ATTR ksock_lnet_msg_t;
 
index ac9799b..62480c3 100644 (file)
@@ -111,6 +111,142 @@ static inline __u32 LNET_MKNET(__u32 type, __u32 num)
        return (type << 16) | num;
 }
 
+#define WIRE_ATTR      __attribute__((packed))
+
+/* Packed version of lnet_process_id_t to transfer via network */
+typedef struct {
+       lnet_nid_t nid;
+       lnet_pid_t pid; /* node id / process id */
+} WIRE_ATTR lnet_process_id_packed_t;
+
+/* The wire handle's interface cookie only matches one network interface in
+ * one epoch (i.e. new cookie when the interface restarts or the node
+ * reboots).  The object cookie only matches one object on that interface
+ * during that object's lifetime (i.e. no cookie re-use). */
+typedef struct {
+       __u64 wh_interface_cookie;
+       __u64 wh_object_cookie;
+} WIRE_ATTR lnet_handle_wire_t;
+
+typedef enum {
+       LNET_MSG_ACK = 0,
+       LNET_MSG_PUT,
+       LNET_MSG_GET,
+       LNET_MSG_REPLY,
+       LNET_MSG_HELLO,
+} lnet_msg_type_t;
+
+/* The variant fields of the portals message header are aligned on an 8
+ * byte boundary in the message header.  Note that all types used in these
+ * wire structs MUST be fixed size and the smaller types are placed at the
+ * end. */
+typedef struct lnet_ack {
+       lnet_handle_wire_t      dst_wmd;
+       __u64                   match_bits;
+       __u32                   mlength;
+} WIRE_ATTR lnet_ack_t;
+
+typedef struct lnet_put {
+       lnet_handle_wire_t      ack_wmd;
+       __u64                   match_bits;
+       __u64                   hdr_data;
+       __u32                   ptl_index;
+       __u32                   offset;
+} WIRE_ATTR lnet_put_t;
+
+typedef struct lnet_get {
+       lnet_handle_wire_t      return_wmd;
+       __u64                   match_bits;
+       __u32                   ptl_index;
+       __u32                   src_offset;
+       __u32                   sink_length;
+} WIRE_ATTR lnet_get_t;
+
+typedef struct lnet_reply {
+       lnet_handle_wire_t      dst_wmd;
+} WIRE_ATTR lnet_reply_t;
+
+typedef struct lnet_hello {
+       __u64                   incarnation;
+       __u32                   type;
+} WIRE_ATTR lnet_hello_t;
+
+typedef struct {
+       lnet_nid_t      dest_nid;
+       lnet_nid_t      src_nid;
+       lnet_pid_t      dest_pid;
+       lnet_pid_t      src_pid;
+       __u32           type;           /* lnet_msg_type_t */
+       __u32           payload_length; /* payload data to follow */
+       /*<------__u64 aligned------->*/
+       union {
+               lnet_ack_t      ack;
+               lnet_put_t      put;
+               lnet_get_t      get;
+               lnet_reply_t    reply;
+               lnet_hello_t    hello;
+       } msg;
+} WIRE_ATTR lnet_hdr_t;
+
+/* A HELLO message contains a magic number and protocol version
+ * code in the header's dest_nid, the peer's NID in the src_nid, and
+ * LNET_MSG_HELLO in the type field.  All other common fields are zero
+ * (including payload_size; i.e. no payload).
+ * This is for use by byte-stream LNDs (e.g. TCP/IP) to check the peer is
+ * running the same protocol and to find out its NID. These LNDs should
+ * exchange HELLO messages when a connection is first established.  Individual
+ * LNDs can put whatever else they fancy in lnet_hdr_t::msg.
+ */
+typedef struct {
+       __u32   magic;          /* LNET_PROTO_TCP_MAGIC */
+       __u16   version_major;  /* increment on incompatible change */
+       __u16   version_minor;  /* increment on compatible change */
+} WIRE_ATTR lnet_magicversion_t;
+
+/* PROTO MAGIC for LNDs */
+#define LNET_PROTO_IB_MAGIC            0x0be91b91
+#define LNET_PROTO_GNI_MAGIC           0xb00fbabe /* ask Kim */
+#define LNET_PROTO_TCP_MAGIC           0xeebc0ded
+#define LNET_PROTO_ACCEPTOR_MAGIC      0xacce7100
+#define LNET_PROTO_PING_MAGIC          0x70696E67 /* 'ping' */
+
+/* Placeholder for a future "unified" protocol across all LNDs */
+/* Current LNDs that receive a request with this magic will respond with a
+ *  *  * "stub" reply using their current protocol */
+#define LNET_PROTO_MAGIC               0x45726963 /* ! */
+
+#define LNET_PROTO_TCP_VERSION_MAJOR   1
+#define LNET_PROTO_TCP_VERSION_MINOR   0
+
+/* Acceptor connection request */
+typedef struct {
+       __u32   acr_magic;      /* PTL_ACCEPTOR_PROTO_MAGIC */
+       __u32   acr_version;    /* protocol version */
+       __u64   acr_nid;        /* target NID */
+} WIRE_ATTR lnet_acceptor_connreq_t;
+
+#define LNET_PROTO_ACCEPTOR_VERSION    1
+
+typedef struct lnet_counters {
+       __u32   msgs_alloc;
+       __u32   msgs_max;
+       __u32   errors;
+       __u32   send_count;
+       __u32   recv_count;
+       __u32   route_count;
+       __u32   drop_count;
+       __u64   send_length;
+       __u64   recv_length;
+       __u64   route_length;
+       __u64   drop_length;
+} WIRE_ATTR lnet_counters_t;
+
+#define LNET_NI_STATUS_UP      0x15aac0de
+#define LNET_NI_STATUS_DOWN    0xdeadface
+#define LNET_NI_STATUS_INVALID 0x00000000
+
+#define LNET_MAX_INTERFACES    16
+
 /**
  * Objects maintained by the LNet are accessed through handles. Handle types
  * have names of the form lnet_handle_xx_t, where xx is one of the two letter
@@ -312,21 +448,6 @@ typedef struct {
 /** limit on the number of fragments in discontiguous MDs */
 #define LNET_MAX_IOV    256
 
-/* Max payload size */
-#ifndef CONFIG_LNET_MAX_PAYLOAD
-# error "CONFIG_LNET_MAX_PAYLOAD must be defined in config.h"
-#else
-# define LNET_MAX_PAYLOAD      CONFIG_LNET_MAX_PAYLOAD
-# if (LNET_MAX_PAYLOAD < LNET_MTU)
-#  error "LNET_MAX_PAYLOAD too small - error in configure --with-max-payload-mb"
-# elif defined(__KERNEL__)
-#  if (LNET_MAX_PAYLOAD > (PAGE_SIZE * LNET_MAX_IOV))
-/*  PAGE_SIZE is a constant: check with cpp! */
-#   error "LNET_MAX_PAYLOAD too large - error in configure --with-max-payload-mb"
-#  endif
-# endif
-#endif
-
 /**
  * Options for the MD structure. See lnet_md_t::options.
  */
index b6d85ef..0c735f4 100644 (file)
@@ -254,8 +254,6 @@ lnet_accept(struct socket *sock, __u32 magic)
 
                 if (magic == le32_to_cpu(LNET_PROTO_TCP_MAGIC))
                         str = "'old' socknal/tcpnal";
-                else if (lnet_accept_magic(magic, LNET_PROTO_RA_MAGIC))
-                        str = "'old' ranal";
                 else
                         str = "unrecognised";
 
index a6e80b7..6658c06 100644 (file)
@@ -35,9 +35,8 @@
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
-#include <lnet/lib-lnet.h>
-#include <lnet/lib-dlc.h>
 #include <linux/log2.h>
+#include <lnet/lib-lnet.h>
 
 #define D_LNI D_CONSOLE
 
index 9c0100b..da2f63a 100644 (file)
@@ -44,7 +44,7 @@
 #define LNET_ONLY
 
 #include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
+#include <lnet/api.h>
 #include <lnet/lib-lnet.h>
 #include <lnet/lib-types.h>
 #include <lnet/lnetst.h>
index 46c00f0..93d733a 100644 (file)
@@ -38,8 +38,7 @@
 #include <libcfs/libcfsutil.h>
 #include <lnet/lnetctl.h>
 #include <lnet/socklnd.h>
-#include <lnet/lib-dlc.h>
-#include <lnet/nidstr.h>
+#include <lnet/lnet.h>
 #include "liblnetconfig.h"
 #include "cyaml.h"
 
index 2e246fc..0ec300d 100644 (file)
@@ -24,8 +24,8 @@
  *   Amir Shehata <amir.shehata@intel.com>
  */
 
-#ifndef LIB_LUSTRE_CONFIG_API_H
-#define LIB_LUSTRE_CONFIG_API_H
+#ifndef LIB_LNET_CONFIG_API_H
+#define LIB_LNET_CONFIG_API_H
 
 #define LUSTRE_CFG_RC_NO_ERR                    0
 #define LUSTRE_CFG_RC_BAD_PARAM                        -1
@@ -246,4 +246,4 @@ int lustre_yaml_del(char *f, struct cYAML **err_rc);
 int lustre_yaml_show(char *f, struct cYAML **show_rc,
                     struct cYAML **err_rc);
 
-#endif /* LIB_LUSTRE_CONFIG_API_H */
+#endif /* LIB_LNET_CONFIG_API_H */
index 7917e3e..81803db 100644 (file)
 
 #include <getopt.h>
 #include <pwd.h>
+#include <unistd.h>
+
 #include <libcfs/libcfsutil.h>
 #include <lnet/lnetctl.h>
 #include <lnet/lnetst.h>
-#include <lnet/nidstr.h>
-/* NB: these includes are layering violation */
-#include <lustre_ver.h>
-#include <lustre/lustre_idl.h>
+#include <lnet/lnet.h>
 
 lst_sid_t LST_INVALID_SID = {LNET_NID_ANY, -1};
 static lst_sid_t           session_id;
@@ -2951,8 +2950,10 @@ lst_get_bulk_param(int argc, char **argv, lst_test_bulk_param_t *bulk)
                                 return -1;
                         }
 
-                } else if (strcasestr(argv[i], "size=") == argv[i] ||
-                         strcasestr(argv[i], "s=") == argv[i]) {
+               } 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);
@@ -2969,7 +2970,7 @@ lst_get_bulk_param(int argc, char **argv, lst_test_bulk_param_t *bulk)
                         else if (*end == 'm' || *end == 'M')
                                 bulk->blk_size *= 1024 * 1024;
 
-                       if (bulk->blk_size > PAGE_CACHE_SIZE * LNET_MAX_IOV) {
+                       if (bulk->blk_size > max_size) {
                                 fprintf(stderr, "Size exceed limitation: %d bytes\n",
                                         bulk->blk_size);
                                 return -1;
index c8e67c8..1f314c9 100644 (file)
  */
 
 #include <libcfs/libcfsutil.h>
-#include <lnet/nidstr.h>
 #include <lnet/lnetctl.h>
 #include <lnet/socklnd.h>
-#include <lnet/lib-dlc.h>
+#include <lnet/lnet.h>
 #include <getopt.h>
 #include <netdb.h>
 
index d37a734..ac7f1cc 100644 (file)
 #define _GNU_SOURCE
 #endif
 
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <lnet/lib-types.h>
-
-#include <string.h>
+#include <lnet/types.h>
 
 #ifndef HAVE_STRNLEN
 #define strnlen(s, i) strlen(s)
index 274aa90..73b2a45 100644 (file)
@@ -56,7 +56,8 @@
  */
 
 #include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
+#include <lnet/nidstr.h>
+#include <lnet/api.h>
 #include <lustre/lustre_idl.h>
 #include <lustre_ha.h>
 #include <lustre_sec.h>