@@ -37,6 +37,7 @@
#define __LNET_LIB_TYPES_H__
#include <linux/kthread.h>
+#include <linux/net.h>
#include <linux/uio.h>
#include <linux/types.h>
#include <linux/completion.h>
@@ -46,12 +47,9 @@
#include <uapi/linux/lnet/lnet-dlc.h>
/* Max payload size */
-#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
+#define LNET_MAX_PAYLOAD LNET_MTU
+
+#define LNET_MAX_IOV (LNET_MAX_PAYLOAD >> PAGE_SHIFT)
/* forward refs */
struct lnet_libmd;
@@ -522,9 +522,6 @@ struct lnet_md {
#define LNET_MTU_BITS 20
#define LNET_MTU (1 << LNET_MTU_BITS)
-/** limit on the number of fragments in discontiguous MDs */
-#define LNET_MAX_IOV 256
-
/**
* Options for the MD structure. See lnet_md::options.
*/
@@ -8,16 +8,6 @@ config LNET
case of Lustre routers only the LNet layer is required. Lately other
projects are also looking into using LNet as their networking API as well.
-config LNET_MAX_PAYLOAD
- int "Lustre lnet max transfer payload (default 1MB)"
- depends on LNET
- default "1048576"
- help
- This option defines the maximum size of payload in bytes that lnet
- can put into its transport.
-
- If unsure, use default.
-
config LNET_SELFTEST
tristate "Lustre networking self testing"
depends on LNET
@@ -1414,7 +1414,7 @@ static void kiblnd_destroy_fmr_pool_list(struct list_head *head)
static int kiblnd_alloc_fmr_pool(struct kib_fmr_poolset *fps, struct kib_fmr_pool *fpo)
{
struct ib_fmr_pool_param param = {
- .max_pages_per_fmr = LNET_MAX_PAYLOAD / PAGE_SIZE,
+ .max_pages_per_fmr = LNET_MAX_IOV,
.page_shift = PAGE_SHIFT,
.access = (IB_ACCESS_LOCAL_WRITE |
IB_ACCESS_REMOTE_WRITE),
@@ -1474,7 +1474,7 @@ static int kiblnd_alloc_freg_pool(struct kib_fmr_poolset *fps,
frd->frd_mr = ib_alloc_mr(fpo->fpo_hdev->ibh_pd,
fastreg_gaps ? IB_MR_TYPE_SG_GAPS :
IB_MR_TYPE_MEM_REG,
- LNET_MAX_PAYLOAD / PAGE_SIZE);
+ LNET_MAX_IOV);
if (IS_ERR(frd->frd_mr)) {
rc = PTR_ERR(frd->frd_mr);
CERROR("Failed to allocate ib_alloc_mr: %d\n", rc);
@@ -56,6 +56,7 @@
#include <linux/libcfs/libcfs.h>
#include <uapi/linux/lnet/nidstr.h>
#include <linux/lnet/api.h>
+#include <linux/lnet/lib-types.h>
#include <uapi/linux/lustre/lustre_idl.h>
#include <lustre_errno.h>
#include <lustre_ha.h>