AC_MSG_RESULT(no)
])
+ LB_LINUX_TRY_COMPILE([
+ #include <linux/version.h>
+ #include <linux/pci.h>
+ #if !HAVE_GFP_T
+ typedef int gfp_t;
+ #endif
+ #include <rdma/ib_verbs.h>
+ ],[
+ return RDMA_TRANSPORT_IWARP ==
+ rdma_node_get_transport(RDMA_NODE_RNIC);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_OFED_TRANSPORT_IWARP, 1,
+ [has transport iWARP])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+
EXTRA_KCFLAGS="$EXTRA_KCFLAGS_save"
fi
fi
LASSERT (net->ibn_dev->ibd_mrs[0] != NULL);
if (*kiblnd_tunables.kib_map_on_demand > 0 &&
- *kiblnd_tunables.kib_map_on_demand < rd->rd_nfrags)
+ *kiblnd_tunables.kib_map_on_demand <= rd->rd_nfrags)
return NULL;
if (net->ibn_dev->ibd_nmrs == 1)
return rc;
}
-#if 1
+#ifdef HAVE_OFED_TRANSPORT_IWARP
/* XXX We can't trust this value returned by Chelsio driver, it's wrong
* and we have reported the bug, remove these in the future when Chelsio
* bug got fixed. */
#define IBLND_CREDIT_HIGHWATER_V1 7 /* V1 only : when eagerly to return credits */
#define IBLND_CREDITS_DEFAULT 8 /* default # of peer credits */
-#define IBLND_CREDITS_MAX 4096 /* Max # of peer credits */
+#define IBLND_CREDITS_MAX ((typeof(((kib_msg_t*) 0)->ibm_credits)) - 1) /* Max # of peer credits */
#define IBLND_MSG_QUEUE_SIZE(v) ((v) == IBLND_MSG_VERSION_1 ? \
IBLND_MSG_QUEUE_SIZE_V1 : \
if (*kiblnd_tunables.kib_peertxcredits > IBLND_CREDITS_MAX)
*kiblnd_tunables.kib_peertxcredits = IBLND_CREDITS_MAX;
+ if (*kiblnd_tunables.kib_peertxcredits > *kiblnd_tunables.kib_credits)
+ *kiblnd_tunables.kib_peertxcredits = *kiblnd_tunables.kib_credits;
+
if (*kiblnd_tunables.kib_peercredits_hiw < *kiblnd_tunables.kib_peertxcredits / 2)
*kiblnd_tunables.kib_peercredits_hiw = *kiblnd_tunables.kib_peertxcredits / 2;
*kiblnd_tunables.kib_peercredits_hiw = *kiblnd_tunables.kib_peertxcredits - 1;
if (*kiblnd_tunables.kib_map_on_demand < 0 ||
- *kiblnd_tunables.kib_map_on_demand >= IBLND_MAX_RDMA_FRAGS)
+ *kiblnd_tunables.kib_map_on_demand > IBLND_MAX_RDMA_FRAGS)
*kiblnd_tunables.kib_map_on_demand = 0; /* disable map-on-demand */
+ if (*kiblnd_tunables.kib_map_on_demand == 1)
+ *kiblnd_tunables.kib_map_on_demand = 2; /* don't make sense to create map if only one fragment */
+
if (*kiblnd_tunables.kib_concurrent_sends == 0) {
if (*kiblnd_tunables.kib_map_on_demand > 0 &&
*kiblnd_tunables.kib_map_on_demand <= IBLND_MAX_RDMA_FRAGS / 8)