#if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
cfs_sysctl_table_header_t *kib_sysctl; /* sysctl interface */
#endif
+ int *kib_require_priv_port;/* accept only privileged ports */
+ int *kib_use_priv_port; /* use privileged port for active connect */
} kib_tunables_t;
extern kib_tunables_t kiblnd_tunables;
IBLND_CREDIT_HIGHWATER_V1 : \
*kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */
+#ifdef HAVE_RDMA_CREATE_ID_4ARG
+#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps, qpt)
+#else
+#define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps)
+#endif
+
static inline int
kiblnd_concurrent_sends_v1(void)
{
struct kib_hca_dev;
+/* o2iblnd can run over aliased interface */
+#ifdef IFALIASZ
+#define KIB_IFNAME_SIZE IFALIASZ
+#else
+#define KIB_IFNAME_SIZE 256
+#endif
+
typedef struct
{
cfs_list_t ibd_list; /* chain on kib_devs */
cfs_list_t ibd_fail_list; /* chain on kib_failed_devs */
__u32 ibd_ifip; /* IPoIB interface IP */
- char ibd_ifname[32]; /* IPoIB interface name */
+ /** IPoIB interface name */
+ char ibd_ifname[KIB_IFNAME_SIZE];
int ibd_nnets; /* # nets extant */
cfs_time_t ibd_next_failover;
cfs_atomic_t ibh_ref; /* refcount */
} kib_hca_dev_t;
-#define IBLND_POOL_DEADLINE 300 /* # of seconds to keep pool alive */
+/** # of seconds to keep pool alive */
+#define IBLND_POOL_DEADLINE 300
+/** # of seconds to retry if allocation failed */
+#define IBLND_POOL_RETRY 1
typedef struct
{
int ibc_ready:1; /* CQ callback fired */
unsigned long ibc_last_send; /* time of last send */
cfs_list_t ibc_early_rxs; /* rxs completed before ESTABLISHED */
+ cfs_list_t ibc_tx_noops; /* IBLND_MSG_NOOPs for IBLND_MSG_VERSION_1 */
cfs_list_t ibc_tx_queue; /* sends that need a credit */
cfs_list_t ibc_tx_queue_nocred;/* sends that don't need a credit */
cfs_list_t ibc_tx_queue_rsrvd; /* sends that need to reserve an ACK/DONE msg */
!kiblnd_send_keepalive(conn))
return 0; /* No need to send NOOP */
- if (!cfs_list_empty(&conn->ibc_tx_queue_nocred))
- return 0; /* NOOP can be piggybacked */
+ if (IBLND_OOB_CAPABLE(conn->ibc_version)) {
+ if (!cfs_list_empty(&conn->ibc_tx_queue_nocred))
+ return 0; /* NOOP can be piggybacked */
- if (!IBLND_OOB_CAPABLE(conn->ibc_version))
- /* can't piggyback? */
- return cfs_list_empty(&conn->ibc_tx_queue);
+ /* No tx to piggyback NOOP onto or no credit to send a tx */
+ return (cfs_list_empty(&conn->ibc_tx_queue) || conn->ibc_credits == 0);
+ }
+
+ if (!cfs_list_empty(&conn->ibc_tx_noops) || /* NOOP already queued */
+ !cfs_list_empty(&conn->ibc_tx_queue_nocred) || /* can be piggybacked */
+ conn->ibc_credits == 0) /* no credit */
+ return 0;
+
+ if (conn->ibc_credits == 1 && /* last credit reserved for */
+ conn->ibc_outstanding_credits == 0) /* giving back credits */
+ return 0;
/* No tx to piggyback NOOP onto or no credit to send a tx */
- return (cfs_list_empty(&conn->ibc_tx_queue) || conn->ibc_credits == 0);
+ return (cfs_list_empty(&conn->ibc_tx_queue) || conn->ibc_credits == 1);
}
static inline void