.xcl_name = "rdma",
        .xcl_owner = THIS_MODULE,
        .xcl_ops = &svc_rdma_ops,
-       .xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP,
+       .xcl_max_payload = RPCSVC_MAXPAYLOAD_RDMA,
        .xcl_ident = XPRT_TRANSPORT_RDMA,
 };
 
 
 #include <linux/sunrpc/clnt.h>                 /* rpc_xprt */
 #include <linux/sunrpc/rpc_rdma.h>     /* RPC/RDMA protocol */
 #include <linux/sunrpc/xprtrdma.h>     /* xprt parameters */
+#include <linux/sunrpc/svc.h>          /* RPCSVC_MAXPAYLOAD */
 
 #define RDMA_RESOLVE_TIMEOUT   (5000)  /* 5 seconds */
 #define RDMA_CONNECT_RETRY_MAX (2)     /* retries if no listener backlog */
 /* Workqueue created in svc_rdma.c */
 extern struct workqueue_struct *svc_rdma_wq;
 
+#if RPCSVC_MAXPAYLOAD < (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT)
+#define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD
+#else
+#define RPCSVC_MAXPAYLOAD_RDMA (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT)
+#endif
+
 #endif                         /* _LINUX_SUNRPC_XPRT_RDMA_H */