return -EPROTONOSUPPORT;
}
+#ifdef HAVE_FMR_POOL_API
/*
* FMR does not support gaps but the tx has gaps then
* we should make sure that the number of fragments we'll be sending
return -EFBIG;
}
}
+#endif
fps = net->ibn_fmr_ps[cpt];
rc = kiblnd_fmr_pool_map(fps, tx, rd, nob, 0, &tx->tx_fmr);
* for FastReg or FMR with no gaps we can accumulate all
* the fragments in one FastReg or FMR fragment.
*/
- if (((dev->ibd_dev_caps & IBLND_DEV_CAPS_FMR_ENABLED) && !tx->tx_gaps) ||
+ if (
+#ifdef HAVE_FMR_POOL_API
+ ((dev->ibd_dev_caps & IBLND_DEV_CAPS_FMR_ENABLED)
+ && !tx->tx_gaps) ||
+#endif
(dev->ibd_dev_caps & IBLND_DEV_CAPS_FASTREG_ENABLED)) {
/* FMR requires zero based address */
+#ifdef HAVE_FMR_POOL_API
if (dev->ibd_dev_caps & IBLND_DEV_CAPS_FMR_ENABLED)
rd->rd_frags[0].rf_addr &= ~hdev->ibh_page_mask;
+#endif
rd->rd_frags[0].rf_nob = nob;
rd->rd_nfrags = 1;
} else {
static void
kiblnd_unmap_tx(struct kib_tx *tx)
{
- if (tx->tx_fmr.fmr_pfmr || tx->tx_fmr.fmr_frd)
+ if (
+#ifdef HAVE_FMR_POOL_API
+ tx->tx_fmr.fmr_pfmr ||
+#endif
+ tx->tx_fmr.fmr_frd)
kiblnd_fmr_pool_unmap(&tx->tx_fmr, tx->tx_status);
if (tx->tx_nfrags != 0) {
* dead in the water and fail the operation.
*/
if (tunables->lnd_map_on_demand &&
- (net->ibn_dev->ibd_dev_caps & IBLND_DEV_CAPS_FASTREG_ENABLED ||
- net->ibn_dev->ibd_dev_caps & IBLND_DEV_CAPS_FMR_ENABLED))
+ (net->ibn_dev->ibd_dev_caps & IBLND_DEV_CAPS_FASTREG_ENABLED
+#ifdef HAVE_FMR_POOL_API
+ || net->ibn_dev->ibd_dev_caps & IBLND_DEV_CAPS_FMR_ENABLED
+#endif
+ ))
return NULL;
/*
unsigned short port;
int rc;
- LASSERT(capable(CAP_NET_BIND_SERVICE));
-
/* allow the port to be reused */
rc = rdma_set_reuseaddr(cmid, 1);
if (rc != 0) {
}
}
- CERROR("Failed to bind to a free privileged port\n");
- return rc;
+ CERROR("cannot bind to a free privileged port: rc = %d\n", rc);
+
+ return rc;
}
static int
int rc;
if (!capable(CAP_NET_BIND_SERVICE)) {
- new_creds = prepare_creds();
+ new_creds = prepare_kernel_cred(NULL);
if (!new_creds)
return -ENOMEM;