Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH V2 for-next 16/19] IB/hns: Update the rq head when modify qp state
From: Salil Mehta @ 2016-09-20 16:07 UTC (permalink / raw)
  To: dledford
  Cc: salil.mehta, xavier.huwei, oulijun, yisen.zhuang, mehta.salil.lnk,
	xuwei5, linux-rdma, linux-kernel, linuxarm
In-Reply-To: <20160920160712.1190216-1-salil.mehta@huawei.com>

From: Lijun Ou <oulijun@huawei.com>

The rq head in qpc was zero will miss the rq wqes which
have be sent, so here we should take the real value.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index bc06004..2070e9e 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -2248,7 +2248,8 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
 
 		roce_set_field(context->qpc_bytes_68,
 			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_M,
-			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S, 0);
+			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S,
+			       hr_qp->rq.head);
 		roce_set_field(context->qpc_bytes_68,
 			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_M,
 			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_S, 0);
-- 
1.9.1

^ permalink raw reply related

* [PATCH V2 for-next 17/19] IB/hns: Fix the bug when platform_get_resource() exec fail
From: Salil Mehta @ 2016-09-20 16:07 UTC (permalink / raw)
  To: dledford
  Cc: salil.mehta, xavier.huwei, oulijun, yisen.zhuang, mehta.salil.lnk,
	xuwei5, linux-rdma, linux-kernel, linuxarm
In-Reply-To: <20160920160712.1190216-1-salil.mehta@huawei.com>

From: Lijun Ou <oulijun@huawei.com>

This patch mainly fixes the bug with platform_get_resource().
It should return NULL when platform_get_resource() exec fail.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_pd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/infiniband/hw/hns/hns_roce_pd.c b/drivers/infiniband/hw/hns/hns_roce_pd.c
index 0cd6132..05db7d5 100644
--- a/drivers/infiniband/hw/hns/hns_roce_pd.c
+++ b/drivers/infiniband/hw/hns/hns_roce_pd.c
@@ -110,6 +110,10 @@ int hns_roce_uar_alloc(struct hns_roce_dev *hr_dev, struct hns_roce_uar *uar)
 			     (hr_dev->caps.phy_num_uars - 1) + 1;
 
 	res = platform_get_resource(hr_dev->pdev, IORESOURCE_MEM, 0);
+	if (!res) {
+		dev_err(&hr_dev->pdev->dev, "memory resource not found!\n");
+		return -EINVAL;
+	}
 	uar->pfn = ((res->start) >> PAGE_SHIFT) + uar->index;
 
 	return 0;
-- 
1.9.1

^ permalink raw reply related

* [PATCH V2 for-next 18/19] IB/hns: Delete the redundant lines in hns_roce_v1_m_qp()
From: Salil Mehta @ 2016-09-20 16:07 UTC (permalink / raw)
  To: dledford
  Cc: salil.mehta, xavier.huwei, oulijun, yisen.zhuang, mehta.salil.lnk,
	xuwei5, linux-rdma, linux-kernel, linuxarm
In-Reply-To: <20160920160712.1190216-1-salil.mehta@huawei.com>

From: Lijun Ou <oulijun@huawei.com>

It doesn't need to assign for the filed of qp state in qpc separately
when qp happen to migrate state which supported in RoCE engine v1.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
PATCH V2: Addressed comments provided by Leon Romanovsky
          Link: https://lkml.org/lkml/2016/9/15/123
PATCH V1: Initial Submit
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 2070e9e..d52eeda 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -2387,11 +2387,6 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
 		roce_set_bit(context->qpc_bytes_140,
 			     QP_CONTEXT_QPC_BYTES_140_RNR_RETRY_FLG_S, 0);
 
-		roce_set_field(context->qpc_bytes_144,
-			       QP_CONTEXT_QPC_BYTES_144_QP_STATE_M,
-			       QP_CONTEXT_QPC_BYTES_144_QP_STATE_S,
-			       attr->qp_state);
-
 		roce_set_field(context->qpc_bytes_148,
 			       QP_CONTEXT_QPC_BYTES_148_CHECK_FLAG_M,
 			       QP_CONTEXT_QPC_BYTES_148_CHECK_FLAG_S, 0);
@@ -2498,21 +2493,15 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp, const struct ib_qp_attr *attr,
 			       QP_CONTEXT_QPC_BYTES_188_TX_RETRY_CUR_INDEX_M,
 			       QP_CONTEXT_QPC_BYTES_188_TX_RETRY_CUR_INDEX_S,
 			       0);
-	} else if ((cur_state == IB_QPS_INIT && new_state == IB_QPS_RESET) ||
+	} else if (!((cur_state == IB_QPS_INIT && new_state == IB_QPS_RESET) ||
 		   (cur_state == IB_QPS_INIT && new_state == IB_QPS_ERR) ||
 		   (cur_state == IB_QPS_RTR && new_state == IB_QPS_RESET) ||
 		   (cur_state == IB_QPS_RTR && new_state == IB_QPS_ERR) ||
 		   (cur_state == IB_QPS_RTS && new_state == IB_QPS_RESET) ||
 		   (cur_state == IB_QPS_RTS && new_state == IB_QPS_ERR) ||
 		   (cur_state == IB_QPS_ERR && new_state == IB_QPS_RESET) ||
-		   (cur_state == IB_QPS_ERR && new_state == IB_QPS_ERR)) {
-		roce_set_field(context->qpc_bytes_144,
-			       QP_CONTEXT_QPC_BYTES_144_QP_STATE_M,
-			       QP_CONTEXT_QPC_BYTES_144_QP_STATE_S,
-			       attr->qp_state);
-
-	} else {
-		dev_err(dev, "not support this modify\n");
+		   (cur_state == IB_QPS_ERR && new_state == IB_QPS_ERR))) {
+		dev_err(dev, "not support this status migration\n");
 		goto out;
 	}
 
-- 
1.9.1

^ permalink raw reply related

* [PATCH V2 for-next 19/19] IB/hns: Fix for removal of redundant code
From: Salil Mehta @ 2016-09-20 16:07 UTC (permalink / raw)
  To: dledford
  Cc: salil.mehta, xavier.huwei, oulijun, yisen.zhuang, mehta.salil.lnk,
	xuwei5, linux-rdma, linux-kernel, linuxarm
In-Reply-To: <20160920160712.1190216-1-salil.mehta@huawei.com>

This patch removes the redundant code lines present in the
functions get_send_wqe() and get_recv_wqe(). This also fixes
the error in calculating the SQ WQE.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
---
PATCH V1: This has been create to address the Leon
          Romanovsky's comment provided in below patches:
	  Link: https://lkml.org/lkml/2016/9/15/117
	  Link: https://lkml.org/lkml/2016/9/13/54
---
 drivers/infiniband/hw/hns/hns_roce_hw_v1.c |  3 ++-
 drivers/infiniband/hw/hns/hns_roce_qp.c    | 18 ------------------
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index d52eeda..71232e5 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -1552,7 +1552,8 @@ static int hns_roce_v1_poll_one(struct hns_roce_cq *hr_cq,
 		/* SQ conrespond to CQE */
 		sq_wqe = get_send_wqe(*cur_qp, roce_get_field(cqe->cqe_byte_4,
 						CQE_BYTE_4_WQE_INDEX_M,
-						CQE_BYTE_4_WQE_INDEX_S));
+						CQE_BYTE_4_WQE_INDEX_S)&
+						((*cur_qp)->sq.wqe_cnt-1));
 		switch (sq_wqe->flag & HNS_ROCE_WQE_OPCODE_MASK) {
 		case HNS_ROCE_WQE_OPCODE_SEND:
 			wc->opcode = IB_WC_SEND;
diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c
index 6a38909..e86dd8d 100644
--- a/drivers/infiniband/hw/hns/hns_roce_qp.c
+++ b/drivers/infiniband/hw/hns/hns_roce_qp.c
@@ -784,29 +784,11 @@ static void *get_wqe(struct hns_roce_qp *hr_qp, int offset)
 
 void *get_recv_wqe(struct hns_roce_qp *hr_qp, int n)
 {
-	struct ib_qp *ibqp = &hr_qp->ibqp;
-	struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
-
-	if ((n < 0) || (n > hr_qp->rq.wqe_cnt)) {
-		dev_err(&hr_dev->pdev->dev, "rq wqe index:%d,rq wqe cnt:%d\r\n",
-			n, hr_qp->rq.wqe_cnt);
-		return NULL;
-	}
-
 	return get_wqe(hr_qp, hr_qp->rq.offset + (n << hr_qp->rq.wqe_shift));
 }
 
 void *get_send_wqe(struct hns_roce_qp *hr_qp, int n)
 {
-	struct ib_qp *ibqp = &hr_qp->ibqp;
-	struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
-
-	if ((n < 0) || (n > hr_qp->sq.wqe_cnt)) {
-		dev_err(&hr_dev->pdev->dev, "sq wqe index:%d,sq wqe cnt:%d\r\n",
-			n, hr_qp->sq.wqe_cnt);
-		return NULL;
-	}
-
 	return get_wqe(hr_qp, hr_qp->sq.offset + (n << hr_qp->sq.wqe_shift));
 }
 
-- 
1.9.1

^ permalink raw reply related

* Re: [RFC v2 00/11] QLogic RDMA Driver (qedr) RFC
From: Leon Romanovsky @ 2016-09-20 16:23 UTC (permalink / raw)
  To: Elior, Ariel
  Cc: Amrani, Ram, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	Kalderon, Michal, Mintz, Yuval, Borundia, Rajesh,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <CY1PR0701MB133773B2CB71FA6362CADCFF90F70-UpKza+2NMNLi6bjPjkn3FE5OhdzP3rhOnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]

On Tue, Sep 20, 2016 at 01:33:25PM +0000, Elior, Ariel wrote:
> > On Tue, Sep 20, 2016 at 01:35:52PM +0300, Ram Amrani wrote:
> ...
> > > The series adds on top of RFC v1:
> > > * a check for all drivers that IB_ACCESS_MW_BIND isn't set for ib_get_dma_mr
> > > * relocation of qedr user API to include/rdma/uapi/providers/
> > > * removal of qedr_devlist_local
> > > * fixed error handling in qedr_alloc_resources()
> > > * configuration of PBL in ib_map_mr_sg() driver implementation,
> > >   rather than post_send's IB_WR_REG_MR
> > > * misc.: placed code in proper patch, fixed a few comments,
> > >   removed extra parentheses
> > >
> > > Thanks for everyone which pointed out problems in the driver.
> > >
> > > Any review/comment is appreciated.
> >
> > Very nice,
> > Any reason why didn't you drop debug module parameter and decided to
> > mimic already available kernel core functionality?
> >
> > You got technical explanations why it is bad idea to use it. If you need additional
> > voices
> > to support my claims, you will find them in thread about VERBOSE flag and responses
> > from
> > Doug, and Dennis.
> >
> > Thanks
> Hi Leon,
> The RFC cover letter lists what has been addressed. Debug printouts are not addressed in V2 as the discussion on that topic is not concluded (more thoughts from us on debug printouts incoming on the thread). There were many comments to V1 which are not relevant to debug printouts which are addressed by V2. We are requesting further comment, hence RFC V2. Rest assured, if it is the final opinion in the relevant discussion that pr_debug is the way to go, that's what we'll do.

The module parameters is no-go.

> Thanks,
> Ariel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [RFC v2 06/12] qedr: Add support for QP verbs
From: Leon Romanovsky @ 2016-09-20 16:30 UTC (permalink / raw)
  To: Ram Amrani
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA,
	Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA,
	Yuval.Mintz-YGCgFSpz5w/QT0dZR+AlfA,
	rajesh.borundia-YGCgFSpz5w/QT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474367764-9555-7-git-send-email-Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3615 bytes --]

On Tue, Sep 20, 2016 at 01:35:58PM +0300, Ram Amrani wrote:
> From: Ram amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
>
> Add support for Queue Pair verbs which adds, deletes,
> modifies and queries Queue Pairs.
>
> Signed-off-by: Rajesh Borundia <rajesh.borundia-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Ram Amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/infiniband/hw/qedr/main.c          |   15 +-
>  drivers/infiniband/hw/qedr/qedr.h          |  126 +++
>  drivers/infiniband/hw/qedr/qedr_cm.h       |   40 +
>  drivers/infiniband/hw/qedr/qedr_hsi_rdma.h |   11 +
>  drivers/infiniband/hw/qedr/verbs.c         | 1095 ++++++++++++++++++++++++-
>  drivers/infiniband/hw/qedr/verbs.h         |    7 +
>  drivers/net/ethernet/qlogic/qed/qed_cxt.h  |    1 +
>  drivers/net/ethernet/qlogic/qed/qed_roce.c | 1211 ++++++++++++++++++++++++++++
>  drivers/net/ethernet/qlogic/qed/qed_roce.h |   71 ++
>  include/linux/qed/qed_roce_if.h            |  144 ++++
>  include/uapi/rdma/providers/qedr-abi.h     |   35 +

Please be aware that the last version for ABI header files doesn't have
"provider" name in directory path (include/uapi/rdma/qedr-abi.h)


>  11 files changed, 2753 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/infiniband/hw/qedr/qedr_cm.h
>
> diff --git a/drivers/infiniband/hw/qedr/main.c b/drivers/infiniband/hw/qedr/main.c
> index c99dd6a..10ad9ed 100644
> --- a/drivers/infiniband/hw/qedr/main.c
> +++ b/drivers/infiniband/hw/qedr/main.c
> @@ -52,7 +52,7 @@ uint debug;
>  module_param(debug, uint, 0);
>  MODULE_PARM_DESC(debug, "Default debug msglevel");
>
> -static LIST_HEAD(qedr_dev_list);

You are removing code which was added in previous patches, why do you do
it?

> +#define QEDR_WQ_MULTIPLIER_DFT	(3)
>
>  void qedr_ib_dispatch_event(struct qedr_dev *dev, u8 port_num,
>  			    enum ib_event_type type)
> @@ -99,7 +99,11 @@ static int qedr_register_device(struct qedr_dev *dev)
>  				     QEDR_UVERBS(CREATE_CQ) |
>  				     QEDR_UVERBS(RESIZE_CQ) |
>  				     QEDR_UVERBS(DESTROY_CQ) |
> -				     QEDR_UVERBS(REQ_NOTIFY_CQ);
> +				     QEDR_UVERBS(REQ_NOTIFY_CQ) |
> +				     QEDR_UVERBS(CREATE_QP) |
> +				     QEDR_UVERBS(MODIFY_QP) |
> +				     QEDR_UVERBS(QUERY_QP) |
> +				     QEDR_UVERBS(DESTROY_QP);
>
>  	dev->ibdev.phys_port_cnt = 1;
>  	dev->ibdev.num_comp_vectors = dev->num_cnq;
> @@ -124,6 +128,11 @@ static int qedr_register_device(struct qedr_dev *dev)
>  	dev->ibdev.resize_cq = qedr_resize_cq;
>  	dev->ibdev.req_notify_cq = qedr_arm_cq;
>
> +	dev->ibdev.create_qp = qedr_create_qp;
> +	dev->ibdev.modify_qp = qedr_modify_qp;
> +	dev->ibdev.query_qp = qedr_query_qp;
> +	dev->ibdev.destroy_qp = qedr_destroy_qp;
> +
>  	dev->ibdev.query_pkey = qedr_query_pkey;
>
>  	dev->ibdev.dma_device = &dev->pdev->dev;
> @@ -619,6 +628,8 @@ static struct qedr_dev *qedr_add(struct qed_dev *cdev, struct pci_dev *pdev,
>  		goto init_err;
>  	}
>
> +	dev->wq_multiplier = QEDR_WQ_MULTIPLIER_DFT;
> +
>  	qedr_pci_set_atomic(dev, pdev);
>
>  	rc = qedr_alloc_resources(dev);
> diff --git a/drivers/infiniband/hw/qedr/qedr.h b/drivers/infiniband/hw/qedr/qedr.h
> index dd974d5..05017be 100644
> --- a/drivers/infiniband/hw/qedr/qedr.h
> +++ b/drivers/infiniband/hw/qedr/qedr.h
> @@ -49,6 +49,9 @@
>  enum DP_QEDR_MODULE {
>  	QEDR_MSG_INIT = 0x10000,

We prefer shift notation (1 << 16) instead of 0x10000.

>  	QEDR_MSG_CQ = 0x20000,
> +	QEDR_MSG_RQ = 0x40000,
> +	QEDR_MSG_SQ = 0x80000,
> +	QEDR_MSG_QP = (QEDR_MSG_SQ | QEDR_MSG_RQ),
>  	QEDR_MSG_MR = 0x100000,
>  	QEDR_MSG_MISC = 0x400000,
>  };

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [RFC v2 04/12] qedr: Add support for user context verbs
From: Leon Romanovsky @ 2016-09-20 16:45 UTC (permalink / raw)
  To: Ram Amrani
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA,
	Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA,
	Yuval.Mintz-YGCgFSpz5w/QT0dZR+AlfA,
	rajesh.borundia-YGCgFSpz5w/QT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474367764-9555-5-git-send-email-Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2215 bytes --]

On Tue, Sep 20, 2016 at 01:35:56PM +0300, Ram Amrani wrote:
> From: Ram amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
>
> Add support for ucontext, query port, add and del gid verbs.
>
> Signed-off-by: Rajesh Borundia <rajesh.borundia-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Ram Amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
> ---

<...>

> +++ b/drivers/infiniband/hw/qedr/verbs.c
> @@ -0,0 +1,417 @@
> +/* QLogic qed NIC Driver
> + * Copyright (c) 2015 QLogic Corporation
> + *
> + * This software is available under the terms of the GNU General Public License
> + * (GPL) Version 2, available from the file COPYING in the main directory of
> + * this source tree.
> + */

<...>

> --- /dev/null
> +++ b/drivers/infiniband/hw/qedr/verbs.h
> @@ -0,0 +1,26 @@
> +/* QLogic qed NIC Driver
> + * Copyright (c) 2015 QLogic Corporation
> + *
> + * This software is available under the terms of the GNU General Public License
> + * (GPL) Version 2, available from the file COPYING in the main directory of
> + * this source tree.
> + */

<...>

> +++ b/include/uapi/rdma/providers/qedr-abi.h
> @@ -0,0 +1,27 @@
> +/* QLogic qed NIC Driver
> + * Copyright (c) 2015 QLogic Corporation
> + *
> + * This software is available under the terms of the GNU General Public License
> + * (GPL) Version 2, available from the file COPYING in the main directory of
> + * this source tree.
> + */

Are you sure that you want GPL-only license?


> +#ifndef __QEDR_USER_H__
> +#define __QEDR_USER_H__
> +
> +#define QEDR_ABI_VERSION		(6)

Is it possible to start new file with new driver from ABI version 1 and
not 6?

> +
> +/* user kernel communication data structures. */
> +
> +struct qedr_alloc_ucontext_resp {
> +	u64 db_pa;
> +	u32 db_size;
> +
> +	u32 max_send_wr;
> +	u32 max_recv_wr;
> +	u32 max_srq_wr;
> +	u32 sges_per_send_wr;
> +	u32 sges_per_recv_wr;
> +	u32 sges_per_srq_wr;
> +	int max_cqes;
> +};
> +#endif /* __QEDR_USER_H__ */
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* RE: [PATCH for-next 12/20] IB/hns: Return bad wr while post send failed
From: Salil Mehta @ 2016-09-20 16:46 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: dledford@redhat.com, Huwei (Xavier), oulijun,
	Zhuangyuzeng (Yisen), xuwei (O), mehta.salil.lnk@gmail.com,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linuxarm, Huangdongdong (Donald)
In-Reply-To: <20160915090742.GV26069@leon.nu>


> -----Original Message-----
> From: Leon Romanovsky [mailto:leon@kernel.org]
> Sent: Thursday, September 15, 2016 10:08 AM
> To: Salil Mehta
> Cc: dledford@redhat.com; Huwei (Xavier); oulijun; Zhuangyuzeng (Yisen);
> xuwei (O); mehta.salil.lnk@gmail.com; linux-rdma@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm; Huangdongdong (Donald)
> Subject: Re: [PATCH for-next 12/20] IB/hns: Return bad wr while post
> send failed
> 
> On Fri, Sep 09, 2016 at 06:30:43PM +0800, Salil Mehta wrote:
> > From: Lijun Ou <oulijun@huawei.com>
> >
> > While post failed, hns roce should return the wr failed to user.
> > We omitted this while qp type is wrong and fixed it.
> >
> > Signed-off-by: Lijun Ou <oulijun@huawei.com>
> > Signed-off-by: Dongdong Huang(Donald) <hdd.huang@huawei.com>
> > Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
> > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > ---
> >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > index f4d2515..f0d6315 100644
> > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > @@ -264,8 +264,10 @@ int hns_roce_v1_post_send(struct ib_qp *ibqp,
> struct ib_send_wr *wr,
> >  			}
> >  			ind++;
> >  		} else {
> 
> You should move the check of supported QPs to the beginning of
> post_send
> and don't enter into the loop at all.
Hi Leon,
Agreed. I have made this change in floated V2 patch.

Thanks
Salil
> 
> > -			dev_dbg(dev, "unSupported QP type\n");
> > -			break;
> > +			dev_err(dev, "unSupported QP type\n");
> 
> During initial review of hns driver, Lijun was asked to canonize debug
> messages and don't use different styles and especially sUcH case.
Ok. I have corrected for this instance in V2 patch.

Thanks
Salil
> 
> > +			ret = -EOPNOTSUPP;
> > +			*bad_wr = wr;
> 
> IMHO, the proper thing is to return NULL, because this is not wrong wr.
Ok. Done this change as well.

Thanks
Salil
> 
> > +			goto out;
> >  		}
> >  	}
> >
> > --
> > 1.7.9.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* RE: [PATCH for-next 03/20] IB/hns: Add the check for pointer ctrl
From: Salil Mehta @ 2016-09-20 16:50 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Huwei (Xavier),
	oulijun, Zhuangyuzeng (Yisen), xuwei (O),
	mehta.salil.lnk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linuxarm
In-Reply-To: <20160915100757.GW26069-2ukJVAZIZ/Y@public.gmane.org>


> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-
> owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Leon Romanovsky
> Sent: Thursday, September 15, 2016 11:08 AM
> To: Salil Mehta
> Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org; Huwei (Xavier); oulijun; Zhuangyuzeng (Yisen);
> xuwei (O); mehta.salil.lnk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org;
> linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Linuxarm
> Subject: Re: [PATCH for-next 03/20] IB/hns: Add the check for pointer
> ctrl
> 
> On Fri, Sep 09, 2016 at 06:30:34PM +0800, Salil Mehta wrote:
> > From: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> >
> > The pointer ctrl may be null, so we add check for it.
> >
> > Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> > Reviewed-by: Wei Hu <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> > Signed-off-by: Salil Mehta <salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> > ---
> >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > index 5f76fc1..ea47ec4 100644
> > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > @@ -336,6 +336,12 @@ int hns_roce_v1_post_recv(struct ib_qp *ibqp,
> struct ib_recv_wr *wr,
> >  		}
> >
> >  		ctrl = get_recv_wqe(hr_qp, ind);
> > +		if (unlikely(!ctrl)) {
> 
> Yes, as you wrote, this check and patch are redundant too.
I have dropped this patch in reworked V2 patch and introduced new patch
to remove the redundant code as well in get_recv_wqe() and get_send_wqe().

Thanks
Salil
> 
> > +			dev_err(dev, "Get recv wqe failed!\n");
> > +			ret = -EINVAL;
> > +			*bad_wr = wr;
> > +			goto out;
> > +		}
> >
> >  		roce_set_field(ctrl->rwqe_byte_12,
> >  			       RQ_WQE_CTRL_RWQE_BYTE_12_RWQE_SGE_NUM_M,
> > --
> > 1.7.9.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> in
> > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* RE: [PATCH for-next 18/20] IB/hns: Update the rq head when modify qp state
From: Salil Mehta @ 2016-09-20 16:56 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: dledford@redhat.com, Huwei (Xavier), oulijun,
	Zhuangyuzeng (Yisen), xuwei (O), mehta.salil.lnk@gmail.com,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linuxarm
In-Reply-To: <20160915101246.GX26069@leon.nu>



> -----Original Message-----
> From: Leon Romanovsky [mailto:leon@kernel.org]
> Sent: Thursday, September 15, 2016 11:13 AM
> To: Salil Mehta
> Cc: dledford@redhat.com; Huwei (Xavier); oulijun; Zhuangyuzeng (Yisen);
> xuwei (O); mehta.salil.lnk@gmail.com; linux-rdma@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm
> Subject: Re: [PATCH for-next 18/20] IB/hns: Update the rq head when
> modify qp state
> 
> On Fri, Sep 09, 2016 at 06:30:49PM +0800, Salil Mehta wrote:
> > From: Lijun Ou <oulijun@huawei.com>
> >
> > The rq head in qpc was zero will miss the rq wqes which
> > have be sent, so here we should take the real value.
> >
> > Signed-off-by: Lijun Ou <oulijun@huawei.com>
> > Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
> > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > ---
> >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > index bdd9453..7a61d7e 100644
> > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > @@ -2266,7 +2266,8 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp,
> const struct ib_qp_attr *attr,
> >
> >  		roce_set_field(context->qpc_bytes_68,
> >  			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_M,
> > -			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S, 0);
> > +			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S,
> > +			       hr_qp->rq.head);
> 
> Are you sure that it should be list_head and not value?
This is correct. Variable head is not list_head but a u32 value. 
Hope I understood your point correctly.

Best regards
Salil
> 
> >  		roce_set_field(context->qpc_bytes_68,
> >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_M,
> >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_S, 0);
> > --
> > 1.7.9.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* RE: [PATCH for-next 20/20] IB/hns: Delete the redundant lines in hns_roce_v1_m_qp()
From: Salil Mehta @ 2016-09-20 16:57 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: dledford@redhat.com, Huwei (Xavier), oulijun,
	Zhuangyuzeng (Yisen), xuwei (O), mehta.salil.lnk@gmail.com,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linuxarm
In-Reply-To: <20160915101529.GY26069@leon.nu>

> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-
> owner@vger.kernel.org] On Behalf Of Leon Romanovsky
> Sent: Thursday, September 15, 2016 11:15 AM
> To: Salil Mehta
> Cc: dledford@redhat.com; Huwei (Xavier); oulijun; Zhuangyuzeng (Yisen);
> xuwei (O); mehta.salil.lnk@gmail.com; linux-rdma@vger.kernel.org;
> linux-kernel@vger.kernel.org; Linuxarm
> Subject: Re: [PATCH for-next 20/20] IB/hns: Delete the redundant lines
> in hns_roce_v1_m_qp()
> 
> On Fri, Sep 09, 2016 at 06:30:51PM +0800, Salil Mehta wrote:
> > From: Lijun Ou <oulijun@huawei.com>
> >
> > It doesn't need to assign for the filed of qp state in qpc separately
> > when qp happen to migrate state which supported in RoCE engine v1.
> >
> > Signed-off-by: Lijun Ou <oulijun@huawei.com>
> > Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
> > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > ---
> >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |   14 +++-----------
> >  1 file changed, 3 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > index 7a61d7e..3bc32fc 100644
> > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > @@ -2405,11 +2405,6 @@ static int hns_roce_v1_m_qp(struct ib_qp
> *ibqp, const struct ib_qp_attr *attr,
> >  		roce_set_bit(context->qpc_bytes_140,
> >  			     QP_CONTEXT_QPC_BYTES_140_RNR_RETRY_FLG_S, 0);
> >
> > -		roce_set_field(context->qpc_bytes_144,
> > -			       QP_CONTEXT_QPC_BYTES_144_QP_STATE_M,
> > -			       QP_CONTEXT_QPC_BYTES_144_QP_STATE_S,
> > -			       attr->qp_state);
> > -
> >  		roce_set_field(context->qpc_bytes_148,
> >  			       QP_CONTEXT_QPC_BYTES_148_CHECK_FLAG_M,
> >  			       QP_CONTEXT_QPC_BYTES_148_CHECK_FLAG_S, 0);
> > @@ -2524,13 +2519,10 @@ static int hns_roce_v1_m_qp(struct ib_qp
> *ibqp, const struct ib_qp_attr *attr,
> >  		   (cur_state == IB_QPS_RTS && new_state == IB_QPS_ERR) ||
> >  		   (cur_state == IB_QPS_ERR && new_state == IB_QPS_RESET)
> ||
> >  		   (cur_state == IB_QPS_ERR && new_state == IB_QPS_ERR)) {
> > -		roce_set_field(context->qpc_bytes_144,
> > -			       QP_CONTEXT_QPC_BYTES_144_QP_STATE_M,
> > -			       QP_CONTEXT_QPC_BYTES_144_QP_STATE_S,
> > -			       attr->qp_state);
> > -
> > +		/* It will not do additional options in engine v1 */
> > +		;
> 
> It will leave empty if() {..}, it is worth to rewrite to have one if
> for
> error path only.
Agreed & changed in patch v2!

Thanks
Salil
> 
> >  	} else {
> > -		dev_err(dev, "not support this modify\n");
> > +		dev_err(dev, "not support this status migration\n");
> >  		goto out;
> >  	}
> >
> > --
> > 1.7.9.5
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [RFC 02/11] Add RoCE driver framework
From: Leon Romanovsky @ 2016-09-20 17:03 UTC (permalink / raw)
  To: Elior, Ariel
  Cc: Mintz, Yuval, dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	Mark Bloch, Ram Amrani, David Miller, Ariel Elior,
	Michal Kalderon, Rajesh Borundia,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev
In-Reply-To: <CY1PR0701MB13376438A5767BC844EA35C290F70-UpKza+2NMNLi6bjPjkn3FE5OhdzP3rhOnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3713 bytes --]

On Tue, Sep 20, 2016 at 03:04:12PM +0000, Elior, Ariel wrote:
> > From: Leon Romanovsky [mailto:leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org]
> > On Thu, Sep 15, 2016 at 05:11:03AM +0000, Mintz, Yuval wrote:
> > > > As a summary, I didn't see in your responses any real life example where you will
> > > > need global debug level for your driver.
> > >
> > > Not sure what you you're expecting - a list of BZs /private e-mails where
> > > user reproductions were needed?
> > > You're basically ignoring my claims that such are used, instead wanting
> > > "evidence". I'm not going to try and produce any such.
> >
> > I asked an example and not evidence, where "modprobe your_driver
> > debug=1" will be superior to "modprobe your_driver dyndbg==pmf".
> >
> > https://www.kernel.org/doc/Documentation/dynamic-debug-howto.txt
> Hi,
>
> dyndbg vs module param:
> Dynamic debug has two very nice features: dynamic activation/configuration and per line/file/module/format activation. The module param has neither, but it does have a few merits which I am not sure dyndbg has:
> (1)
> It can activate printouts according to *flow*. A lot of thought has been put into associating the right printout in our driver at the right verbosity level with the right "flow tag" (e.g. QEDR_MSG_INIT, QEDR_MSG_QP). The module parameter accepts a bitmask which allows setting any subset of these flows. This means that with the correct values for the parameter I can open only "init" printouts, or only "Memory Region" printouts, even if these cross multiple files / functions and don't share a common format. Presumably, one would claim that we could add the "flow tag" to the format to every printout according to its flow, but that would encumber the printouts, and also doesn't scale well to printouts which belong to multiple flows, where the current approach allows this (QEDR_MSG_SQ | QEDR_
 MSG_RQ).

Dynamic prints are enabled per-print. The best possible granularity
which you can achieve.

> (2)
> As Yuval pointed out, there are users out there which have no trouble loading a driver with a module parameter, at probe or at kernel boot, but would be at a loss in mounting debugfs and dumping a matchspec script into a node there. As kernel developers, educating users is part of what we do, but it comes with a cost.

You are free to add this parameter to your out-of-tree driver. As I said
before to Yuval your module "debug" is equal to "dyndbg". Your users can
use it and is already available in kernel.

> (3)
> debugfs can be compiled out of the kernel in some codesize sensitive environments, or may not exist in an emergency shell or kdump kernel, whereas the module parameter would always be there.
>
> Simply allowing our module parameter mechanism to be dynamically activated is very straightforward - we planned on adding a debugfs node for that anyway. But I would keep the module parameter for the sake of those less capable users and also for when debugfs is not available as detailed in (3) above.

This is an example why we don't want this module parameter, once added it
will be with us forever.

>
> I certainly see the merits of joining an existing infrastructure instead of implementing our own thing, but I would like to know if there are ways of obtaining the merits I listed for our approach via that infrastructure.
>
> Leon, aside of commenting on the above, can you give an example of a driver which in your opinion does a good job of using dyndbg?

All modern drivers in this subsystem are supporting dyndbg out of the
box.

General note, can you please configure your email to wrap lines? It is
very hard to read, follow and respond to lines with >800 symbols in them.

>
> Thanks,
> Ariel
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH for-next 18/20] IB/hns: Update the rq head when modify qp state
From: Leon Romanovsky @ 2016-09-20 17:05 UTC (permalink / raw)
  To: Salil Mehta
  Cc: dledford@redhat.com, Huwei (Xavier), oulijun,
	Zhuangyuzeng (Yisen), xuwei (O), mehta.salil.lnk@gmail.com,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linuxarm
In-Reply-To: <F4CC6FACFEB3C54C9141D49AD221F7F91A724AFE@lhreml503-mbx>

[-- Attachment #1: Type: text/plain, Size: 2354 bytes --]

On Tue, Sep 20, 2016 at 04:56:35PM +0000, Salil Mehta wrote:
>
>
> > -----Original Message-----
> > From: Leon Romanovsky [mailto:leon@kernel.org]
> > Sent: Thursday, September 15, 2016 11:13 AM
> > To: Salil Mehta
> > Cc: dledford@redhat.com; Huwei (Xavier); oulijun; Zhuangyuzeng (Yisen);
> > xuwei (O); mehta.salil.lnk@gmail.com; linux-rdma@vger.kernel.org;
> > linux-kernel@vger.kernel.org; Linuxarm
> > Subject: Re: [PATCH for-next 18/20] IB/hns: Update the rq head when
> > modify qp state
> >
> > On Fri, Sep 09, 2016 at 06:30:49PM +0800, Salil Mehta wrote:
> > > From: Lijun Ou <oulijun@huawei.com>
> > >
> > > The rq head in qpc was zero will miss the rq wqes which
> > > have be sent, so here we should take the real value.
> > >
> > > Signed-off-by: Lijun Ou <oulijun@huawei.com>
> > > Reviewed-by:  Wei Hu (Xavier) <xavier.huwei@huawei.com>
> > > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > > ---
> > >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > index bdd9453..7a61d7e 100644
> > > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > @@ -2266,7 +2266,8 @@ static int hns_roce_v1_m_qp(struct ib_qp *ibqp,
> > const struct ib_qp_attr *attr,
> > >
> > >  		roce_set_field(context->qpc_bytes_68,
> > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_M,
> > > -			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S, 0);
> > > +			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S,
> > > +			       hr_qp->rq.head);
> >
> > Are you sure that it should be list_head and not value?
> This is correct. Variable head is not list_head but a u32 value.
> Hope I understood your point correctly.

Thanks, you understood me right.
The name "head" mislead me.
Sorry for that.

>
> Best regards
> Salil
> >
> > >  		roce_set_field(context->qpc_bytes_68,
> > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_M,
> > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_S, 0);
> > > --
> > > 1.7.9.5
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> > in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH rdma-next V1 0/8] Export vendors specific ABIs
From: Adit Ranadive @ 2016-09-20 17:32 UTC (permalink / raw)
  To: Leon Romanovsky, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Christoph Hellwig,
	Jason Gunthorpe, Laurence Oberman
In-Reply-To: <1474195823-10429-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On Sun Sep 18 2016 03:50:15 GMT-0700 (PDT), Leon Romanovsky wrote:
> The consolidate library revealed the fact that vendor specific
> structures and defines are copy/pasted between kernel and user-space.
> 
> This patch set moves these headers from internal driver directory to common
> place and unifies their name to be drivername-abi.h, so it will be easily shared
> by numerous libraries supported in https://github.com/linux-rdma/rdma-core
> 

I had asked this to Leon offline but he recommended to ask on the ML.

What happens if this shared functionality is split between multiple files? Can we 
just add them in the same folder (so uapi/rdma/provider-abi1.h,
uapi/rdma/provider-abi2.h, etc.)?

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* RE: [PATCH for-next 18/20] IB/hns: Update the rq head when modify qp state
From: Salil Mehta @ 2016-09-20 17:49 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Huwei (Xavier),
	oulijun, Zhuangyuzeng (Yisen), xuwei (O),
	mehta.salil.lnk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linuxarm
In-Reply-To: <20160920170553.GU26673-2ukJVAZIZ/Y@public.gmane.org>



> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-
> owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Leon Romanovsky
> Sent: Tuesday, September 20, 2016 6:06 PM
> To: Salil Mehta
> Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org; Huwei (Xavier); oulijun; Zhuangyuzeng (Yisen);
> xuwei (O); mehta.salil.lnk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org;
> linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Linuxarm
> Subject: Re: [PATCH for-next 18/20] IB/hns: Update the rq head when
> modify qp state
> 
> On Tue, Sep 20, 2016 at 04:56:35PM +0000, Salil Mehta wrote:
> >
> >
> > > -----Original Message-----
> > > From: Leon Romanovsky [mailto:leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org]
> > > Sent: Thursday, September 15, 2016 11:13 AM
> > > To: Salil Mehta
> > > Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org; Huwei (Xavier); oulijun; Zhuangyuzeng
> (Yisen);
> > > xuwei (O); mehta.salil.lnk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org;
> > > linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Linuxarm
> > > Subject: Re: [PATCH for-next 18/20] IB/hns: Update the rq head when
> > > modify qp state
> > >
> > > On Fri, Sep 09, 2016 at 06:30:49PM +0800, Salil Mehta wrote:
> > > > From: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> > > >
> > > > The rq head in qpc was zero will miss the rq wqes which
> > > > have be sent, so here we should take the real value.
> > > >
> > > > Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> > > > Reviewed-by:  Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> > > > Signed-off-by: Salil Mehta <salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> > > > ---
> > > >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |    3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > > index bdd9453..7a61d7e 100644
> > > > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > > > @@ -2266,7 +2266,8 @@ static int hns_roce_v1_m_qp(struct ib_qp
> *ibqp,
> > > const struct ib_qp_attr *attr,
> > > >
> > > >  		roce_set_field(context->qpc_bytes_68,
> > > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_M,
> > > > -			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S, 0);
> > > > +			       QP_CONTEXT_QPC_BYTES_68_RQ_HEAD_S,
> > > > +			       hr_qp->rq.head);
> > >
> > > Are you sure that it should be list_head and not value?
> > This is correct. Variable head is not list_head but a u32 value.
> > Hope I understood your point correctly.
> 
> Thanks, you understood me right.
> The name "head" mislead me.
> Sorry for that.
No worries at all :)

Thanks
Salil
> 
> >
> > Best regards
> > Salil
> > >
> > > >  		roce_set_field(context->qpc_bytes_68,
> > > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_M,
> > > >  			       QP_CONTEXT_QPC_BYTES_68_RQ_CUR_INDEX_S,
> 0);
> > > > --
> > > > 1.7.9.5
> > > >
> > > > --
> > > > To unsubscribe from this list: send the line "unsubscribe linux-
> rdma"
> > > in
> > > > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > > > More majordomo info at  http://vger.kernel.org/majordomo-
> info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 00/16] Consolidated RDMA userspace: rdma-core
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Amrani, Ram, Adit Ranadive, Bart Van Assche, Christoph Hellwig,
	Dalessandro, Dennis, Devesh Sharma, Donald Dutile, Doug Ledford,
	Hal Rosenstock, Honggang Li, Jarod Wilson, John Jolly, Kamal Heib,
	Knut Omang, Leon Romanovsky, Mike Marciniszyn, Moni Shoua,
	Sean Hefty, Selvin Xavier, Steve Wise

Hello Everyone,

We are starting the transition to the consolidated user space. Doug has setup
a shared github here:

  https://github.com/linux-rdma/rdma-core

Which now contains the base 'merge' commit, this is simply each of the
original 18 repositories placed in a sub directory, unmodified.

This tree will not be rebased. New work can target this tree.

An earlier version of the patch series that follows has already been
posted, and has been part of my preview tree for some time. The
original mailing list threads are here:

  http://www.spinics.net/lists/linux-rdma/msg39026.html
  http://www.spinics.net/lists/linux-rdma/msg39328.html
  http://www.spinics.net/lists/linux-rdma/msg40014.html
  http://www.spinics.net/lists/linux-rdma/msg40086.html

This series to unify the build system (+ any comments) will be applied to the
tree right away and Doug + Leon will start generally accepting patches.

My preview tree:
 https://github.com/jgunthorpe/rdma-plumbing

Contains another ~70 patches which will be batched up and posted to this list
for review. Notably those patches include the sample RPM and DEB packaging,
and other packaging related items.

Jason

Christoph Hellwig (2):
  Remove README files in the provider directories
  Remove iwpmd/README

Jason Gunthorpe (14):
  Fix bogus executable file permissions
  Include pthreads in the provider libraries
  Be explicit about _GNU_SOURCE
  hfi/ipath: Use the name of the provider for the .driver file
  ibcm: Actually use the version script when linking
  iwpm: Update autotools enough to build
  rdmacm: Control symbol export from librspreload
  Unified CMake build system
  Support obsolete cmake from 2013
  Add a MAINTAINERS file
  Remove the auto* based build systems
  Remove the ChangeLog files
  Remove Debian and RPM packaging files
  ibacm: Remove windows support files

 CMakeLists.txt                                     |   293 +
 COPYING                                            |     6 +
 COPYING.BSD                                        |    26 +
 srp_daemon/debian/copyright => COPYING.GPL2        |    51 +-
 MAINTAINERS                                        |   125 +
 README.md                                          |    97 +
 buildlib/FindLDSymVer.cmake                        |    41 +
 buildlib/RDMA_DoFixup.cmake                        |    25 +
 buildlib/RDMA_EnableCStd.cmake                     |    23 +
 buildlib/config.h.in                               |    35 +
 buildlib/fixup-include/rdma-rdma_user_rxe.h        |   144 +
 buildlib/fixup-include/valgrind-drd.h              |     3 +
 buildlib/fixup-include/valgrind-memcheck.h         |     5 +
 buildlib/provider.map                              |     6 +
 buildlib/publish_headers.cmake                     |    20 +
 buildlib/rdma_functions.cmake                      |   280 +
 ibacm/CMakeLists.txt                               |    69 +
 ibacm/ChangeLog                                    |     0
 ibacm/INSTALL                                      |     0
 ibacm/Makefile.am                                  |    49 -
 ibacm/NEWS                                         |     0
 ibacm/README                                       |    12 -
 ibacm/autogen.sh                                   |     5 -
 ibacm/configure.ac                                 |   106 -
 ibacm/dirs                                         |     1 -
 ibacm/ibacm.spec.in                                |    90 -
 ibacm/windows/acm_windows.c                        |    33 -
 ibacm/windows/acme/SOURCES                         |    36 -
 ibacm/windows/acme/makefile                        |     7 -
 ibacm/windows/acme_windows.c                       |    96 -
 ibacm/windows/dirs                                 |     1 -
 ibacm/windows/libacm_windows.c                     |    52 -
 ibacm/windows/library/Sources                      |    32 -
 ibacm/windows/library/libacm.rc                    |    46 -
 ibacm/windows/library/libacm_export.def            |    34 -
 ibacm/windows/library/libacm_exports.src           |    12 -
 ibacm/windows/library/makefile                     |     7 -
 ibacm/windows/osd.h                                |    91 -
 ibacm/windows/service/Sources                      |    31 -
 ibacm/windows/service/makefile                     |     7 -
 iwpmd/ChangeLog                                    |   276 -
 iwpmd/Makefile.am                                  |    11 -
 iwpmd/README                                       |    36 -
 iwpmd/autogen.sh                                   |    11 -
 iwpmd/configure.ac                                 |    37 -
 iwpmd/iwpmd.spec.in                                |   127 -
 iwpmd/src/CMakeLists.txt                           |    12 +
 libcxgb3/ChangeLog                                 |   791 -
 libcxgb3/Makefile.am                               |    27 -
 libcxgb3/README                                    |    19 -
 libcxgb3/autogen.sh                                |     8 -
 libcxgb3/config/.gitignore                         |     0
 libcxgb3/configure.in                              |    69 -
 libcxgb3/cxgb3.driver                              |     1 -
 libcxgb3/libcxgb3.spec.in                          |    55 -
 libcxgb3/src/CMakeLists.txt                        |     6 +
 libcxgb3/src/iwch.map                              |     6 -
 libcxgb4/ChangeLog                                 |  1133 --
 libcxgb4/Makefile.am                               |    27 -
 libcxgb4/README                                    |    19 -
 libcxgb4/autogen.sh                                |     8 -
 libcxgb4/config/config.guess                       |  1439 --
 libcxgb4/config/config.sub                         |  1811 ---
 libcxgb4/config/depcomp                            |   530 -
 libcxgb4/config/install-sh                         |   323 -
 libcxgb4/configure.in                              |    69 -
 libcxgb4/cxgb4.driver                              |     1 -
 libcxgb4/libcxgb4.spec.in                          |    55 -
 libcxgb4/src/CMakeLists.txt                        |     8 +
 libcxgb4/src/cxgb4.map                             |     6 -
 libhfi1verbs/Makefile.am                           |    83 -
 libhfi1verbs/README                                |    23 -
 libhfi1verbs/add_fedora_entry.sh                   |    18 -
 libhfi1verbs/autogen.sh                            |    64 -
 libhfi1verbs/configure.in                          |   124 -
 libhfi1verbs/fedora_changelog.txt                  |     2 -
 libhfi1verbs/hfi1.driver                           |     1 -
 libhfi1verbs/libhfi1.spec.in                       |   109 -
 libhfi1verbs/makefile                              |   107 -
 libhfi1verbs/makesrpm.sh                           |    21 -
 libhfi1verbs/src/CMakeLists.txt                    |     4 +
 libhfi1verbs/src/hfiverbs.map                      |     4 -
 libi40iw/Makefile.am                               |    26 -
 libi40iw/configure.ac                              |    72 -
 libi40iw/i40iw.driver                              |     1 -
 libi40iw/libi40iw.spec.in                          |    72 -
 libi40iw/src/CMakeLists.txt                        |     5 +
 libi40iw/src/i40iw.map                             |    39 -
 libibcm/ChangeLog                                  |     0
 libibcm/INSTALL                                    |     0
 libibcm/Makefile.am                                |    35 -
 libibcm/NEWS                                       |     0
 libibcm/autogen.sh                                 |     9 -
 libibcm/configure.in                               |    72 -
 libibcm/examples/CMakeLists.txt                    |     2 +
 libibcm/libibcm.spec.in                            |    53 -
 libibcm/src/CMakeLists.txt                         |     9 +
 libibcm/src/cm.c                                   |     2 +-
 libibumad/ChangeLog                                |    94 -
 libibumad/Makefile.am                              |    75 -
 libibumad/autogen.sh                               |    11 -
 libibumad/configure.in                             |    72 -
 libibumad/libibumad.spec.in                        |    74 -
 libibumad/man/CMakeLists.txt                       |    42 +
 libibumad/src/CMakeLists.txt                       |    14 +
 libibumad/tests/CMakeLists.txt                     |     5 +
 libibverbs/ChangeLog                               |   583 -
 libibverbs/Makefile.am                             |   132 -
 libibverbs/autogen.sh                              |     4 -
 libibverbs/config/.gitignore                       |     8 -
 libibverbs/configure.ac                            |   125 -
 libibverbs/debian/changelog                        |   139 -
 libibverbs/debian/compat                           |     1 -
 libibverbs/debian/control                          |    80 -
 libibverbs/debian/copyright                        |    49 -
 libibverbs/debian/ibverbs-utils.install            |     2 -
 libibverbs/debian/libibverbs-dev.install           |     4 -
 libibverbs/debian/libibverbs-dev.links             |    16 -
 libibverbs/debian/libibverbs1.install              |     1 -
 libibverbs/debian/libibverbs1.postinst             |    10 -
 libibverbs/debian/rules                            |    11 -
 libibverbs/debian/source/format                    |     1 -
 libibverbs/debian/watch                            |     3 -
 libibverbs/examples/CMakeLists.txt                 |    31 +
 libibverbs/examples/asyncwatch.c                   |     2 +-
 libibverbs/examples/rc_pingpong.c                  |     2 +-
 libibverbs/examples/srq_pingpong.c                 |     2 +-
 libibverbs/examples/uc_pingpong.c                  |     2 +-
 libibverbs/examples/ud_pingpong.c                  |     2 +-
 libibverbs/examples/xsrq_pingpong.c                |     2 +-
 libibverbs/libibverbs.spec.in                      |   169 -
 libibverbs/man/CMakeLists.txt                      |    83 +
 libibverbs/src/CMakeLists.txt                      |    36 +
 libibverbs/src/device.c                            |     2 +-
 libibverbs/src/init.c                              |     2 +-
 libibverbs/src/sysfs.c                             |     2 +-
 libibverbs/src/verbs.c                             |     1 +
 libipathverbs/CMakeLists.txt                       |     4 +
 libipathverbs/Makefile.am                          |    79 -
 libipathverbs/README                               |    24 -
 libipathverbs/autogen.sh                           |    43 -
 libipathverbs/configure.in                         |   118 -
 libipathverbs/ipath.driver                         |     1 -
 libipathverbs/libipathverbs.spec.in                |   104 -
 libipathverbs/src/CMakeLists.txt                   |     4 +
 libipathverbs/src/ipathverbs.map                   |     4 -
 libipathverbs/truescale-serdes.cmds                |     0
 libmlx4/Makefile.am                                |    19 -
 libmlx4/README                                     |    58 -
 libmlx4/autogen.sh                                 |     4 -
 libmlx4/config/.gitignore                          |     8 -
 libmlx4/configure.ac                               |    96 -
 libmlx4/debian/changelog                           |    73 -
 libmlx4/debian/compat                              |     1 -
 libmlx4/debian/control                             |    47 -
 libmlx4/debian/copyright                           |    43 -
 libmlx4/debian/libmlx4-1.install                   |     2 -
 libmlx4/debian/libmlx4-dev.install                 |     1 -
 .../debian/patches/driver-plugin-directory.patch   |    10 -
 libmlx4/debian/patches/series                      |     1 -
 libmlx4/debian/rules                               |    10 -
 libmlx4/debian/source/format                       |     1 -
 libmlx4/debian/watch                               |     3 -
 libmlx4/libmlx4.spec.in                            |    90 -
 libmlx4/mlx4.driver                                |     1 -
 libmlx4/src/CMakeLists.txt                         |     9 +
 libmlx4/src/mlx4.map                               |     5 -
 libmlx5/Makefile.am                                |    27 -
 libmlx5/README                                     |    14 -
 libmlx5/autogen.sh                                 |     7 -
 libmlx5/config/.gitignore                          |     8 -
 libmlx5/configure.ac                               |   108 -
 libmlx5/debian/changelog                           |    18 -
 libmlx5/debian/compat                              |     1 -
 libmlx5/debian/control                             |    47 -
 libmlx5/debian/copyright                           |    43 -
 libmlx5/debian/libmlx5-1.install                   |     2 -
 libmlx5/debian/libmlx5-dev.install                 |     1 -
 .../debian/patches/driver-plugin-directory.patch   |    10 -
 libmlx5/debian/patches/series                      |     1 -
 libmlx5/debian/rules                               |    10 -
 libmlx5/debian/source/format                       |     1 -
 libmlx5/debian/watch                               |     3 -
 libmlx5/libmlx5.spec.in                            |    60 -
 libmlx5/m4/ax_gcc_func_attribute.m4                |   223 -
 libmlx5/mlx5.driver                                |     1 -
 libmlx5/src/CMakeLists.txt                         |     9 +
 libmlx5/src/mlx5.map                               |     5 -
 libmthca/ChangeLog                                 |   378 -
 libmthca/Makefile.am                               |    29 -
 libmthca/README                                    |    59 -
 libmthca/autogen.sh                                |     8 -
 libmthca/config/.gitignore                         |     8 -
 libmthca/configure.in                              |    80 -
 libmthca/debian/changelog                          |    73 -
 libmthca/debian/compat                             |     1 -
 libmthca/debian/control                            |    48 -
 libmthca/debian/copyright                          |    44 -
 libmthca/debian/libmthca-dev.install               |     1 -
 libmthca/debian/libmthca1.install                  |     2 -
 .../debian/patches/driver-plugin-directory.patch   |    10 -
 libmthca/debian/patches/series                     |     1 -
 libmthca/debian/rules                              |    10 -
 libmthca/debian/source/format                      |     1 -
 libmthca/debian/watch                              |     3 -
 libmthca/libmthca.spec.in                          |    97 -
 libmthca/mthca.driver                              |     1 -
 libmthca/src/CMakeLists.txt                        |    10 +
 libmthca/src/memfree.c                             |     2 +-
 libmthca/src/mthca.map                             |     5 -
 libnes/Makefile.am                                 |    26 -
 libnes/autogen.sh                                  |    12 -
 libnes/config/.gitignore                           |     0
 libnes/configure.in                                |    72 -
 libnes/libnes.spec.in                              |   107 -
 libnes/nes.driver                                  |     1 -
 libnes/src/CMakeLists.txt                          |     4 +
 libnes/src/nes.map                                 |     5 -
 libocrdma/Makefile.am                              |    23 -
 libocrdma/README                                   |    19 -
 libocrdma/autogen.sh                               |     8 -
 libocrdma/config/.gitignore                        |     8 -
 libocrdma/configure.in                             |    68 -
 libocrdma/libocrdma.spec.in                        |    71 -
 libocrdma/ocrdma.driver                            |     1 -
 libocrdma/src/CMakeLists.txt                       |     4 +
 libocrdma/src/ocrdma.map                           |     5 -
 librdmacm/ChangeLog                                |     0
 librdmacm/INSTALL                                  |     0
 librdmacm/Makefile.am                              |   138 -
 librdmacm/NEWS                                     |     0
 librdmacm/autogen.sh                               |     5 -
 librdmacm/configure.ac                             |   108 -
 librdmacm/examples/CMakeLists.txt                  |    43 +
 librdmacm/examples/rping.c                         |     2 +-
 librdmacm/librdmacm.spec.in                        |    79 -
 librdmacm/man/CMakeLists.txt                       |    65 +
 librdmacm/src/CMakeLists.txt                       |    39 +
 librdmacm/src/librspreload.map                     |    33 +
 librdmacm/src/preload.c                            |     6 +-
 librdmacm/src/rsocket.c                            |     2 +-
 librxe/AUTHORS                                     |     0
 librxe/CMakeLists.txt                              |     4 +
 librxe/COPYING                                     |     0
 librxe/ChangeLog                                   |     0
 librxe/INSTALL                                     |     0
 librxe/Makefile.am                                 |    36 -
 librxe/Makefile.in                                 |   939 --
 librxe/NEWS                                        |     0
 librxe/README                                      |     0
 librxe/aclocal.m4                                  |  9390 ------------
 librxe/config.h.in                                 |    89 -
 librxe/config/config.guess                         |  1526 --
 librxe/config/config.sub                           |  1658 ---
 librxe/config/depcomp                              |   530 -
 librxe/config/install-sh                           |   519 -
 librxe/config/ltmain.sh                            |  9636 ------------
 librxe/config/missing                              |   360 -
 librxe/configure                                   | 14728 -------------------
 librxe/configure.in                                |    75 -
 librxe/librxe.spec                                 |    55 -
 librxe/librxe.spec.in                              |    55 -
 librxe/man/CMakeLists.txt                          |     4 +
 librxe/rxe.driver                                  |     1 -
 librxe/src/CMakeLists.txt                          |     3 +
 librxe/src/rxe.map                                 |     5 -
 srp_daemon/ChangeLog                               |    66 -
 srp_daemon/Makefile.am                             |    80 -
 srp_daemon/NEWS                                    |     1 -
 srp_daemon/autogen.sh                              |     7 -
 srp_daemon/build-deb.sh                            |    68 -
 srp_daemon/configure.ac                            |    73 -
 srp_daemon/debian/changelog                        |    11 -
 srp_daemon/debian/compat                           |     1 -
 srp_daemon/debian/control                          |    14 -
 srp_daemon/debian/postinst                         |    26 -
 srp_daemon/debian/prerm                            |    11 -
 srp_daemon/debian/rules                            |    14 -
 srp_daemon/debian/source/format                    |     1 -
 srp_daemon/man/CMakeLists.txt                      |     4 +
 srp_daemon/srp_daemon/CMakeLists.txt               |    32 +
 srp_daemon/srptools.spec.in                        |   141 -
 282 files changed, 1750 insertions(+), 53469 deletions(-)
 create mode 100644 CMakeLists.txt
 create mode 100644 COPYING
 create mode 100644 COPYING.BSD
 rename srp_daemon/debian/copyright => COPYING.GPL2 (89%)
 create mode 100644 MAINTAINERS
 create mode 100644 README.md
 create mode 100644 buildlib/FindLDSymVer.cmake
 create mode 100644 buildlib/RDMA_DoFixup.cmake
 create mode 100644 buildlib/RDMA_EnableCStd.cmake
 create mode 100644 buildlib/config.h.in
 create mode 100644 buildlib/fixup-include/rdma-rdma_user_rxe.h
 create mode 100644 buildlib/fixup-include/valgrind-drd.h
 create mode 100644 buildlib/fixup-include/valgrind-memcheck.h
 create mode 100644 buildlib/provider.map
 create mode 100644 buildlib/publish_headers.cmake
 create mode 100644 buildlib/rdma_functions.cmake
 create mode 100644 ibacm/CMakeLists.txt
 delete mode 100644 ibacm/ChangeLog
 delete mode 100644 ibacm/INSTALL
 delete mode 100644 ibacm/Makefile.am
 delete mode 100644 ibacm/NEWS
 delete mode 100644 ibacm/README
 delete mode 100755 ibacm/autogen.sh
 delete mode 100644 ibacm/configure.ac
 delete mode 100644 ibacm/dirs
 delete mode 100644 ibacm/ibacm.spec.in
 delete mode 100644 ibacm/windows/acm_windows.c
 delete mode 100644 ibacm/windows/acme/SOURCES
 delete mode 100644 ibacm/windows/acme/makefile
 delete mode 100644 ibacm/windows/acme_windows.c
 delete mode 100644 ibacm/windows/dirs
 delete mode 100644 ibacm/windows/libacm_windows.c
 delete mode 100644 ibacm/windows/library/Sources
 delete mode 100644 ibacm/windows/library/libacm.rc
 delete mode 100644 ibacm/windows/library/libacm_export.def
 delete mode 100644 ibacm/windows/library/libacm_exports.src
 delete mode 100644 ibacm/windows/library/makefile
 delete mode 100644 ibacm/windows/osd.h
 delete mode 100644 ibacm/windows/service/Sources
 delete mode 100644 ibacm/windows/service/makefile
 delete mode 100644 iwpmd/ChangeLog
 delete mode 100644 iwpmd/Makefile.am
 delete mode 100644 iwpmd/README
 delete mode 100755 iwpmd/autogen.sh
 delete mode 100644 iwpmd/configure.ac
 delete mode 100644 iwpmd/iwpmd.spec.in
 create mode 100644 iwpmd/src/CMakeLists.txt
 delete mode 100644 libcxgb3/ChangeLog
 delete mode 100644 libcxgb3/Makefile.am
 delete mode 100644 libcxgb3/README
 delete mode 100755 libcxgb3/autogen.sh
 delete mode 100644 libcxgb3/config/.gitignore
 delete mode 100644 libcxgb3/configure.in
 delete mode 100644 libcxgb3/cxgb3.driver
 delete mode 100644 libcxgb3/libcxgb3.spec.in
 create mode 100644 libcxgb3/src/CMakeLists.txt
 delete mode 100644 libcxgb3/src/iwch.map
 delete mode 100644 libcxgb4/ChangeLog
 delete mode 100644 libcxgb4/Makefile.am
 delete mode 100644 libcxgb4/README
 delete mode 100755 libcxgb4/autogen.sh
 delete mode 100755 libcxgb4/config/config.guess
 delete mode 100755 libcxgb4/config/config.sub
 delete mode 100755 libcxgb4/config/depcomp
 delete mode 100755 libcxgb4/config/install-sh
 delete mode 100644 libcxgb4/configure.in
 delete mode 100644 libcxgb4/cxgb4.driver
 delete mode 100644 libcxgb4/libcxgb4.spec.in
 create mode 100644 libcxgb4/src/CMakeLists.txt
 delete mode 100644 libcxgb4/src/cxgb4.map
 delete mode 100644 libhfi1verbs/Makefile.am
 delete mode 100644 libhfi1verbs/README
 delete mode 100644 libhfi1verbs/add_fedora_entry.sh
 delete mode 100755 libhfi1verbs/autogen.sh
 delete mode 100644 libhfi1verbs/configure.in
 delete mode 100644 libhfi1verbs/fedora_changelog.txt
 delete mode 100644 libhfi1verbs/hfi1.driver
 delete mode 100644 libhfi1verbs/libhfi1.spec.in
 delete mode 100644 libhfi1verbs/makefile
 delete mode 100644 libhfi1verbs/makesrpm.sh
 create mode 100644 libhfi1verbs/src/CMakeLists.txt
 delete mode 100644 libhfi1verbs/src/hfiverbs.map
 delete mode 100644 libi40iw/Makefile.am
 delete mode 100644 libi40iw/configure.ac
 delete mode 100644 libi40iw/i40iw.driver
 delete mode 100644 libi40iw/libi40iw.spec.in
 create mode 100644 libi40iw/src/CMakeLists.txt
 delete mode 100644 libi40iw/src/i40iw.map
 delete mode 100644 libibcm/ChangeLog
 delete mode 100644 libibcm/INSTALL
 delete mode 100644 libibcm/Makefile.am
 delete mode 100644 libibcm/NEWS
 delete mode 100755 libibcm/autogen.sh
 delete mode 100644 libibcm/configure.in
 create mode 100644 libibcm/examples/CMakeLists.txt
 delete mode 100644 libibcm/libibcm.spec.in
 create mode 100644 libibcm/src/CMakeLists.txt
 mode change 100755 => 100644 libibcm/src/cm.c
 delete mode 100644 libibumad/ChangeLog
 delete mode 100644 libibumad/Makefile.am
 delete mode 100755 libibumad/autogen.sh
 delete mode 100644 libibumad/configure.in
 delete mode 100644 libibumad/libibumad.spec.in
 create mode 100644 libibumad/man/CMakeLists.txt
 create mode 100644 libibumad/src/CMakeLists.txt
 create mode 100644 libibumad/tests/CMakeLists.txt
 delete mode 100644 libibverbs/ChangeLog
 delete mode 100644 libibverbs/Makefile.am
 delete mode 100755 libibverbs/autogen.sh
 delete mode 100644 libibverbs/config/.gitignore
 delete mode 100644 libibverbs/configure.ac
 delete mode 100644 libibverbs/debian/changelog
 delete mode 100644 libibverbs/debian/compat
 delete mode 100644 libibverbs/debian/control
 delete mode 100644 libibverbs/debian/copyright
 delete mode 100644 libibverbs/debian/ibverbs-utils.install
 delete mode 100644 libibverbs/debian/libibverbs-dev.install
 delete mode 100644 libibverbs/debian/libibverbs-dev.links
 delete mode 100644 libibverbs/debian/libibverbs1.install
 delete mode 100644 libibverbs/debian/libibverbs1.postinst
 delete mode 100755 libibverbs/debian/rules
 delete mode 100644 libibverbs/debian/source/format
 delete mode 100644 libibverbs/debian/watch
 create mode 100644 libibverbs/examples/CMakeLists.txt
 delete mode 100644 libibverbs/libibverbs.spec.in
 create mode 100644 libibverbs/man/CMakeLists.txt
 create mode 100644 libibverbs/src/CMakeLists.txt
 create mode 100644 libipathverbs/CMakeLists.txt
 delete mode 100644 libipathverbs/Makefile.am
 delete mode 100644 libipathverbs/README
 delete mode 100755 libipathverbs/autogen.sh
 delete mode 100644 libipathverbs/configure.in
 delete mode 100644 libipathverbs/ipath.driver
 delete mode 100644 libipathverbs/libipathverbs.spec.in
 create mode 100644 libipathverbs/src/CMakeLists.txt
 delete mode 100644 libipathverbs/src/ipathverbs.map
 mode change 100644 => 100755 libipathverbs/truescale-serdes.cmds
 delete mode 100644 libmlx4/Makefile.am
 delete mode 100644 libmlx4/README
 delete mode 100755 libmlx4/autogen.sh
 delete mode 100644 libmlx4/config/.gitignore
 delete mode 100644 libmlx4/configure.ac
 delete mode 100644 libmlx4/debian/changelog
 delete mode 100644 libmlx4/debian/compat
 delete mode 100644 libmlx4/debian/control
 delete mode 100644 libmlx4/debian/copyright
 delete mode 100644 libmlx4/debian/libmlx4-1.install
 delete mode 100644 libmlx4/debian/libmlx4-dev.install
 delete mode 100644 libmlx4/debian/patches/driver-plugin-directory.patch
 delete mode 100644 libmlx4/debian/patches/series
 delete mode 100755 libmlx4/debian/rules
 delete mode 100644 libmlx4/debian/source/format
 delete mode 100644 libmlx4/debian/watch
 delete mode 100644 libmlx4/libmlx4.spec.in
 delete mode 100644 libmlx4/mlx4.driver
 create mode 100644 libmlx4/src/CMakeLists.txt
 delete mode 100644 libmlx4/src/mlx4.map
 delete mode 100644 libmlx5/Makefile.am
 delete mode 100644 libmlx5/README
 delete mode 100755 libmlx5/autogen.sh
 delete mode 100644 libmlx5/config/.gitignore
 delete mode 100644 libmlx5/configure.ac
 delete mode 100644 libmlx5/debian/changelog
 delete mode 100644 libmlx5/debian/compat
 delete mode 100644 libmlx5/debian/control
 delete mode 100644 libmlx5/debian/copyright
 delete mode 100644 libmlx5/debian/libmlx5-1.install
 delete mode 100644 libmlx5/debian/libmlx5-dev.install
 delete mode 100644 libmlx5/debian/patches/driver-plugin-directory.patch
 delete mode 100644 libmlx5/debian/patches/series
 delete mode 100755 libmlx5/debian/rules
 delete mode 100644 libmlx5/debian/source/format
 delete mode 100644 libmlx5/debian/watch
 delete mode 100644 libmlx5/libmlx5.spec.in
 delete mode 100644 libmlx5/m4/ax_gcc_func_attribute.m4
 delete mode 100644 libmlx5/mlx5.driver
 create mode 100644 libmlx5/src/CMakeLists.txt
 delete mode 100644 libmlx5/src/mlx5.map
 delete mode 100644 libmthca/ChangeLog
 delete mode 100644 libmthca/Makefile.am
 delete mode 100644 libmthca/README
 delete mode 100755 libmthca/autogen.sh
 delete mode 100644 libmthca/config/.gitignore
 delete mode 100644 libmthca/configure.in
 delete mode 100644 libmthca/debian/changelog
 delete mode 100644 libmthca/debian/compat
 delete mode 100644 libmthca/debian/control
 delete mode 100644 libmthca/debian/copyright
 delete mode 100644 libmthca/debian/libmthca-dev.install
 delete mode 100644 libmthca/debian/libmthca1.install
 delete mode 100644 libmthca/debian/patches/driver-plugin-directory.patch
 delete mode 100644 libmthca/debian/patches/series
 delete mode 100755 libmthca/debian/rules
 delete mode 100644 libmthca/debian/source/format
 delete mode 100644 libmthca/debian/watch
 delete mode 100644 libmthca/libmthca.spec.in
 delete mode 100644 libmthca/mthca.driver
 create mode 100644 libmthca/src/CMakeLists.txt
 delete mode 100644 libmthca/src/mthca.map
 delete mode 100644 libnes/Makefile.am
 delete mode 100755 libnes/autogen.sh
 delete mode 100644 libnes/config/.gitignore
 delete mode 100644 libnes/configure.in
 delete mode 100644 libnes/libnes.spec.in
 delete mode 100644 libnes/nes.driver
 create mode 100644 libnes/src/CMakeLists.txt
 delete mode 100644 libnes/src/nes.map
 delete mode 100644 libocrdma/Makefile.am
 delete mode 100644 libocrdma/README
 delete mode 100644 libocrdma/autogen.sh
 delete mode 100644 libocrdma/config/.gitignore
 delete mode 100644 libocrdma/configure.in
 delete mode 100644 libocrdma/libocrdma.spec.in
 delete mode 100644 libocrdma/ocrdma.driver
 create mode 100644 libocrdma/src/CMakeLists.txt
 delete mode 100644 libocrdma/src/ocrdma.map
 delete mode 100644 librdmacm/ChangeLog
 delete mode 100644 librdmacm/INSTALL
 delete mode 100644 librdmacm/Makefile.am
 delete mode 100644 librdmacm/NEWS
 delete mode 100755 librdmacm/autogen.sh
 delete mode 100644 librdmacm/configure.ac
 create mode 100644 librdmacm/examples/CMakeLists.txt
 delete mode 100644 librdmacm/librdmacm.spec.in
 create mode 100644 librdmacm/man/CMakeLists.txt
 create mode 100644 librdmacm/src/CMakeLists.txt
 create mode 100644 librdmacm/src/librspreload.map
 delete mode 100644 librxe/AUTHORS
 create mode 100644 librxe/CMakeLists.txt
 delete mode 100644 librxe/COPYING
 delete mode 100644 librxe/ChangeLog
 delete mode 100644 librxe/INSTALL
 delete mode 100644 librxe/Makefile.am
 delete mode 100644 librxe/Makefile.in
 delete mode 100644 librxe/NEWS
 delete mode 100644 librxe/README
 delete mode 100644 librxe/aclocal.m4
 delete mode 100644 librxe/config.h.in
 delete mode 100755 librxe/config/config.guess
 delete mode 100755 librxe/config/config.sub
 delete mode 100755 librxe/config/depcomp
 delete mode 100755 librxe/config/install-sh
 delete mode 100755 librxe/config/ltmain.sh
 delete mode 100755 librxe/config/missing
 delete mode 100755 librxe/configure
 delete mode 100644 librxe/configure.in
 delete mode 100644 librxe/librxe.spec
 delete mode 100644 librxe/librxe.spec.in
 create mode 100644 librxe/man/CMakeLists.txt
 delete mode 100644 librxe/rxe.driver
 create mode 100644 librxe/src/CMakeLists.txt
 delete mode 100644 librxe/src/rxe.map
 delete mode 100644 srp_daemon/ChangeLog
 delete mode 100644 srp_daemon/Makefile.am
 delete mode 100644 srp_daemon/NEWS
 delete mode 100755 srp_daemon/autogen.sh
 delete mode 100755 srp_daemon/build-deb.sh
 delete mode 100644 srp_daemon/configure.ac
 delete mode 100644 srp_daemon/debian/changelog
 delete mode 100644 srp_daemon/debian/compat
 delete mode 100644 srp_daemon/debian/control
 delete mode 100644 srp_daemon/debian/postinst
 delete mode 100644 srp_daemon/debian/prerm
 delete mode 100755 srp_daemon/debian/rules
 delete mode 100644 srp_daemon/debian/source/format
 create mode 100644 srp_daemon/man/CMakeLists.txt
 create mode 100644 srp_daemon/srp_daemon/CMakeLists.txt
 delete mode 100644 srp_daemon/srptools.spec.in

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 01/16] Fix bogus executable file permissions
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474409425-15769-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

- cm.c is a source file and should not be executable
- truescale-serdes.cmds is a script and should be executable

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 libibcm/src/cm.c                    | 0
 libipathverbs/truescale-serdes.cmds | 0
 2 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 => 100644 libibcm/src/cm.c
 mode change 100644 => 100755 libipathverbs/truescale-serdes.cmds

diff --git a/libibcm/src/cm.c b/libibcm/src/cm.c
old mode 100755
new mode 100644
diff --git a/libipathverbs/truescale-serdes.cmds b/libipathverbs/truescale-serdes.cmds
old mode 100644
new mode 100755
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 02/16] Include pthreads in the provider libraries
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474409425-15769-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

It is a mistake to not explicitly link to the libraries required.
Not linking causes the symbols to drop the symbol version which could
cause runtime problems down the road if pthreads ever goes through
another symbol version change.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 libhfi1verbs/configure.in  | 2 ++
 libi40iw/configure.ac      | 2 ++
 libipathverbs/configure.in | 2 ++
 libmthca/configure.in      | 2 ++
 libnes/configure.in        | 2 ++
 libocrdma/configure.in     | 2 ++
 librxe/configure.in        | 2 ++
 7 files changed, 14 insertions(+)

diff --git a/libhfi1verbs/configure.in b/libhfi1verbs/configure.in
index 5bbcffc0dc56..a8218914f53f 100644
--- a/libhfi1verbs/configure.in
+++ b/libhfi1verbs/configure.in
@@ -81,6 +81,8 @@ AC_PROG_CC
 dnl Checks for libraries
 AC_CHECK_LIB(ibverbs, ibv_get_device_list, [],
     AC_MSG_ERROR([ibv_get_device_list() not found.  libhfi1verbs requires libibverbs.]))
+AC_CHECK_LIB(pthread, pthread_mutex_init, [],
+    AC_MSG_ERROR([pthread_mutex_init() not found.  libhfi1verbs requires libpthread.]))
 
 dnl Checks for header files.
 AC_CHECK_HEADER(infiniband/driver.h, [],
diff --git a/libi40iw/configure.ac b/libi40iw/configure.ac
index 04e246d75366..108ffd5999b9 100644
--- a/libi40iw/configure.ac
+++ b/libi40iw/configure.ac
@@ -23,6 +23,8 @@ then
 AC_CHECK_LIB(ibverbs, ibv_get_device_list, [],
     AC_MSG_ERROR([ibv_get_device_list() not found.  libi40iw requires libibverbs.]))
 fi
+AC_CHECK_LIB(pthread, pthread_mutex_init, [],
+    AC_MSG_ERROR([pthread_mutex_init() not found.  libi40iw requires libpthread.]))
 
 dnl Checks for header files.
 AC_CHECK_HEADERS(sysfs/libsysfs.h)
diff --git a/libipathverbs/configure.in b/libipathverbs/configure.in
index 70093c3a8acb..9718d56e4411 100644
--- a/libipathverbs/configure.in
+++ b/libipathverbs/configure.in
@@ -81,6 +81,8 @@ AC_CHECK_SIZEOF(long)
 dnl Checks for library functions
 AC_CHECK_FUNCS(ibv_read_sysfs_file ibv_dontfork_range ibv_dofork_range \
     ibv_register_driver)
+AC_CHECK_LIB(pthread, pthread_mutex_init, [],
+    AC_MSG_ERROR([pthread_mutex_init() not found. libipathverbs requires libpthread.]))
 
 dnl Now check if for libibverbs 1.0 vs 1.1
 dummy=if$$
diff --git a/libmthca/configure.in b/libmthca/configure.in
index ffd5db6962f6..c5454436bf8f 100644
--- a/libmthca/configure.in
+++ b/libmthca/configure.in
@@ -30,6 +30,8 @@ AC_PROG_CC
 dnl Checks for libraries
 AC_CHECK_LIB(ibverbs, ibv_get_device_list, [],
     AC_MSG_ERROR([ibv_get_device_list() not found.  libmthca requires libibverbs.]))
+AC_CHECK_LIB(pthread, pthread_mutex_init, [],
+    AC_MSG_ERROR([pthread_mutex_init() not found.  libmthca requires libpthread.]))
 
 dnl Checks for header files.
 AC_CHECK_HEADER(infiniband/driver.h, [],
diff --git a/libnes/configure.in b/libnes/configure.in
index 0cde51420753..08e9948ed13c 100644
--- a/libnes/configure.in
+++ b/libnes/configure.in
@@ -23,6 +23,8 @@ then
 AC_CHECK_LIB(ibverbs, ibv_get_device_list, [],
     AC_MSG_ERROR([ibv_get_device_list() not found.  libnes requires libibverbs.]))
 fi
+AC_CHECK_LIB(pthread, pthread_mutex_init, [],
+    AC_MSG_ERROR([pthread_mutex_init() not found.  libnes requires libpthread.]))
 
 dnl Checks for header files.
 AC_CHECK_HEADERS(sysfs/libsysfs.h)
diff --git a/libocrdma/configure.in b/libocrdma/configure.in
index a0c8175035f9..659d79f52f25 100644
--- a/libocrdma/configure.in
+++ b/libocrdma/configure.in
@@ -24,6 +24,8 @@ then
 AC_CHECK_LIB(ibverbs, ibv_get_device_list, [],
     AC_MSG_ERROR([ibv_get_device_list() not found.  libocrdma requires libibverbs.]))
 fi
+AC_CHECK_LIB(pthread, pthread_mutex_init, [],
+    AC_MSG_ERROR([pthread_mutex_init() not found.  libocrdma requires libpthread.]))
 
 dnl Checks for header files.
 AC_CHECK_HEADERS(sysfs/libsysfs.h)
diff --git a/librxe/configure.in b/librxe/configure.in
index 4f349cc9bae7..957d65000704 100644
--- a/librxe/configure.in
+++ b/librxe/configure.in
@@ -36,6 +36,8 @@ if test x$enable_repackage = x || test x$enable_repackage = xno; then
         AC_MSG_ERROR([<infiniband/driver.h> not found.  librxe requires libibverbs.]))
     AC_CHECK_FUNCS(ibv_read_sysfs_file ibv_dontfork_range ibv_dofork_range \
         ibv_register_driver)
+    AC_CHECK_LIB(pthread, pthread_mutex_init, [],
+    AC_MSG_ERROR([pthread_mutex_init() not found.  librxe requires libpthread.]))
 
     dummy=if$$
     cat <<IBV_VERSION > $dummy.c
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 03/16] Be explicit about _GNU_SOURCE
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474409425-15769-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

The recommended way to use this macro is at the top of the source file,
avoid globally setting it via 'gcc -D' as few source files actually
need it. In this tree we only need it in 19 out of 101 sources.

_GNU_SOURCE changes the behaviour of a few select calls away from the C99
standard and should generally be minimized.

Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> (ibcm,rdmacm)
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 ibacm/Makefile.am                   | 2 +-
 iwpmd/Makefile.am                   | 2 +-
 libhfi1verbs/Makefile.am            | 2 +-
 libi40iw/Makefile.am                | 2 +-
 libibcm/Makefile.am                 | 2 +-
 libibcm/src/cm.c                    | 2 +-
 libibverbs/configure.ac             | 1 -
 libibverbs/examples/asyncwatch.c    | 2 +-
 libibverbs/examples/rc_pingpong.c   | 2 +-
 libibverbs/examples/srq_pingpong.c  | 2 +-
 libibverbs/examples/uc_pingpong.c   | 2 +-
 libibverbs/examples/ud_pingpong.c   | 2 +-
 libibverbs/examples/xsrq_pingpong.c | 2 +-
 libibverbs/src/device.c             | 2 +-
 libibverbs/src/init.c               | 2 +-
 libibverbs/src/sysfs.c              | 2 +-
 libibverbs/src/verbs.c              | 1 +
 libipathverbs/Makefile.am           | 2 +-
 libmthca/Makefile.am                | 2 +-
 libmthca/src/memfree.c              | 2 +-
 libnes/Makefile.am                  | 2 +-
 libocrdma/Makefile.am               | 2 +-
 librdmacm/Makefile.am               | 2 +-
 librdmacm/examples/rping.c          | 2 +-
 librdmacm/src/preload.c             | 2 +-
 librdmacm/src/rsocket.c             | 2 +-
 librxe/Makefile.am                  | 2 +-
 27 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/ibacm/Makefile.am b/ibacm/Makefile.am
index a910585a8fd9..c5cdc6905714 100644
--- a/ibacm/Makefile.am
+++ b/ibacm/Makefile.am
@@ -1,6 +1,6 @@
 AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/linux -I$(srcdir)/src
 
-AM_CFLAGS = -g -Wall -D_GNU_SOURCE 
+AM_CFLAGS = -g -Wall
 AM_LDFLAGS = -lpthread -ldl
 
 if HAVE_LD_VERSION_SCRIPT
diff --git a/iwpmd/Makefile.am b/iwpmd/Makefile.am
index 1a1473c4bd78..fbb4334da961 100644
--- a/iwpmd/Makefile.am
+++ b/iwpmd/Makefile.am
@@ -1,5 +1,5 @@
 AM_CPPFLAGS = -I$(includedir)/libnl3 -I/usr/include/libnl3
-AM_CFLAGS = -O2 -Wall -D_GNU_SOURCE
+AM_CFLAGS = -O2 -Wall
 ACLOCAL_AMFLAGS = -I m4
 
 bin_PROGRAMS = src/iwpmd
diff --git a/libhfi1verbs/Makefile.am b/libhfi1verbs/Makefile.am
index cd6ca0aa6100..3a51f0ba9889 100644
--- a/libhfi1verbs/Makefile.am
+++ b/libhfi1verbs/Makefile.am
@@ -51,7 +51,7 @@
 # Copyright (c) 2007. QLogic Corp. All rights reserved.
 # Copyright (c) 2003, 2004, 2005. PathScale, Inc. All rights reserved.
 
-AM_CFLAGS = -g -Wall -D_GNU_SOURCE
+AM_CFLAGS = -g -Wall
 
 hfiverbs_version_script = @HFIVERBS_VERSION_SCRIPT@
 
diff --git a/libi40iw/Makefile.am b/libi40iw/Makefile.am
index 92772e5c8503..98d6f8ae1226 100644
--- a/libi40iw/Makefile.am
+++ b/libi40iw/Makefile.am
@@ -1,7 +1,7 @@
 lib_LTLIBRARIES = src/libi40iw.la
 
 AM_CPPFLAGS = -I$(srcdir)/src
-AM_CFLAGS = -O2 -Wall -D_GNU_SOURCE
+AM_CFLAGS = -O2 -Wall
 
 if HAVE_LD_VERSION_SCRIPT
     i40iw_version_script = -Wl,--version-script=$(srcdir)/src/i40iw.map
diff --git a/libibcm/Makefile.am b/libibcm/Makefile.am
index 2333930db548..e4be9f887b1c 100644
--- a/libibcm/Makefile.am
+++ b/libibcm/Makefile.am
@@ -3,7 +3,7 @@ INCLUDES = -I$(srcdir)/include
 lib_LTLIBRARIES = src/libibcm.la
 
 ACLOCAL_AMFLAGS = -I config
-AM_CFLAGS = -g -Wall -D_GNU_SOURCE
+AM_CFLAGS = -g -Wall
 
 src_libibcm_la_CFLAGS = $(AM_CFLAGS)
 
diff --git a/libibcm/src/cm.c b/libibcm/src/cm.c
index 996268141a04..5c56381fd5db 100644
--- a/libibcm/src/cm.c
+++ b/libibcm/src/cm.c
@@ -32,7 +32,7 @@
  *
  * $Id$
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/configure.ac b/libibverbs/configure.ac
index 90c33dfb7c75..a8046f3c5a72 100644
--- a/libibverbs/configure.ac
+++ b/libibverbs/configure.ac
@@ -11,7 +11,6 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 dnl Checks for programs
 AC_PROG_CC
-AC_USE_SYSTEM_EXTENSIONS
 AC_PROG_LN_S
 LT_INIT
 
diff --git a/libibverbs/examples/asyncwatch.c b/libibverbs/examples/asyncwatch.c
index a77c1c8802c2..df1261503b7d 100644
--- a/libibverbs/examples/asyncwatch.c
+++ b/libibverbs/examples/asyncwatch.c
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/examples/rc_pingpong.c b/libibverbs/examples/rc_pingpong.c
index 8d5835774590..967678362833 100644
--- a/libibverbs/examples/rc_pingpong.c
+++ b/libibverbs/examples/rc_pingpong.c
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/examples/srq_pingpong.c b/libibverbs/examples/srq_pingpong.c
index f61acb006c83..a1061c31972d 100644
--- a/libibverbs/examples/srq_pingpong.c
+++ b/libibverbs/examples/srq_pingpong.c
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/examples/uc_pingpong.c b/libibverbs/examples/uc_pingpong.c
index 272dc2668708..b25d16c79021 100644
--- a/libibverbs/examples/uc_pingpong.c
+++ b/libibverbs/examples/uc_pingpong.c
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/examples/ud_pingpong.c b/libibverbs/examples/ud_pingpong.c
index 6d32cedc1284..fa99b9e51dfb 100644
--- a/libibverbs/examples/ud_pingpong.c
+++ b/libibverbs/examples/ud_pingpong.c
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/examples/xsrq_pingpong.c b/libibverbs/examples/xsrq_pingpong.c
index 70c576098581..ff00180f2644 100644
--- a/libibverbs/examples/xsrq_pingpong.c
+++ b/libibverbs/examples/xsrq_pingpong.c
@@ -30,7 +30,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/src/device.c b/libibverbs/src/device.c
index 82d928a5d4b2..cfdf7cfd337c 100644
--- a/libibverbs/src/device.c
+++ b/libibverbs/src/device.c
@@ -30,7 +30,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/src/init.c b/libibverbs/src/init.c
index dbdd7954a090..bca0e02d11e1 100644
--- a/libibverbs/src/init.c
+++ b/libibverbs/src/init.c
@@ -30,7 +30,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/src/sysfs.c b/libibverbs/src/sysfs.c
index 0b6ad1e8cc9e..2e68da4bc97f 100644
--- a/libibverbs/src/sysfs.c
+++ b/libibverbs/src/sysfs.c
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libibverbs/src/verbs.c b/libibverbs/src/verbs.c
index fc8b9f65e4e4..debb6f687111 100644
--- a/libibverbs/src/verbs.c
+++ b/libibverbs/src/verbs.c
@@ -31,6 +31,7 @@
  * SOFTWARE.
  */
 
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libipathverbs/Makefile.am b/libipathverbs/Makefile.am
index 21cd83440b42..f9d4698c5e2c 100644
--- a/libipathverbs/Makefile.am
+++ b/libipathverbs/Makefile.am
@@ -33,7 +33,7 @@
 # combinations of this program with other software, or any other
 # product whatsoever.
 
-AM_CFLAGS = -g -Wall -D_GNU_SOURCE
+AM_CFLAGS = -g -Wall
 
 ipathverbs_version_script = @IPATHVERBS_VERSION_SCRIPT@
 
diff --git a/libmthca/Makefile.am b/libmthca/Makefile.am
index e9be461693cd..1dd9a7ba8601 100644
--- a/libmthca/Makefile.am
+++ b/libmthca/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS = -g -Wall -D_GNU_SOURCE
+AM_CFLAGS = -g -Wall
 
 mthca_version_script = @MTHCA_VERSION_SCRIPT@
 
diff --git a/libmthca/src/memfree.c b/libmthca/src/memfree.c
index 53f01fcd6369..87de4c0f5899 100644
--- a/libmthca/src/memfree.c
+++ b/libmthca/src/memfree.c
@@ -29,7 +29,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/libnes/Makefile.am b/libnes/Makefile.am
index a5fdfc27517e..ade8e8b1eee8 100644
--- a/libnes/Makefile.am
+++ b/libnes/Makefile.am
@@ -1,7 +1,7 @@
 
 lib_LTLIBRARIES = src/libnes.la
 
-AM_CFLAGS = -g -Wall -D_GNU_SOURCE
+AM_CFLAGS = -g -Wall
 
 if HAVE_LD_VERSION_SCRIPT
     nes_version_script = -Wl,--version-script=$(srcdir)/src/nes.map
diff --git a/libocrdma/Makefile.am b/libocrdma/Makefile.am
index c07f38c0bc65..9b786e2b51a4 100644
--- a/libocrdma/Makefile.am
+++ b/libocrdma/Makefile.am
@@ -1,7 +1,7 @@
 
 lib_LTLIBRARIES = src/libocrdma.la
 
-AM_CFLAGS = -Wall -D_GNU_SOURCE
+AM_CFLAGS = -Wall
 
 if HAVE_LD_VERSION_SCRIPT
     ocrdma_version_script = -Wl,--version-script=$(srcdir)/src/ocrdma.map
diff --git a/librdmacm/Makefile.am b/librdmacm/Makefile.am
index bf721345f68d..84af01a14b4b 100644
--- a/librdmacm/Makefile.am
+++ b/librdmacm/Makefile.am
@@ -5,7 +5,7 @@ lib_LTLIBRARIES = src/librdmacm.la
 rslib_LTLIBRARIES = src/librspreload.la
 
 ACLOCAL_AMFLAGS = -I config
-AM_CFLAGS = -g -Wall -D_GNU_SOURCE -DSYSCONFDIR=\"$(sysconfdir)\" -DRDMADIR=\"@rdmadir@\"
+AM_CFLAGS = -g -Wall -DSYSCONFDIR=\"$(sysconfdir)\" -DRDMADIR=\"@rdmadir@\"
 
 src_librdmacm_la_CFLAGS = $(AM_CFLAGS)
 src_librspreload_la_CFLAGS = $(AM_CFLAGS)
diff --git a/librdmacm/examples/rping.c b/librdmacm/examples/rping.c
index a0d10779a8b1..171857dcb5ca 100644
--- a/librdmacm/examples/rping.c
+++ b/librdmacm/examples/rping.c
@@ -30,7 +30,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
-
+#define _GNU_SOURCE
 #include <getopt.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/librdmacm/src/preload.c b/librdmacm/src/preload.c
index 3a0bc4c8c71d..a0bc1cfbd7a5 100644
--- a/librdmacm/src/preload.c
+++ b/librdmacm/src/preload.c
@@ -30,7 +30,7 @@
  * SOFTWARE.
  *
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/librdmacm/src/rsocket.c b/librdmacm/src/rsocket.c
index c4f1b57dbb9a..818505fbe02e 100644
--- a/librdmacm/src/rsocket.c
+++ b/librdmacm/src/rsocket.c
@@ -30,7 +30,7 @@
  * SOFTWARE.
  *
  */
-
+#define _GNU_SOURCE
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif /* HAVE_CONFIG_H */
diff --git a/librxe/Makefile.am b/librxe/Makefile.am
index fe6c36c4eaba..972ae3b390b7 100644
--- a/librxe/Makefile.am
+++ b/librxe/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS = -g -Wall -D_GNU_SOURCE
+AM_CFLAGS = -g -Wall
   
 rxe_version_script = @RXE_VERSION_SCRIPT@
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 04/16] hfi/ipath: Use the name of the provider for the .driver file
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474409425-15769-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

The standard is to use the same name for the library and .driver
file. The library is called hfi1verbs/ipathverbs so should the .driver,
add the verbs suffix.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 libhfi1verbs/Makefile.am                          | 4 ++--
 libhfi1verbs/{hfi1.driver => hfi1verbs.driver}    | 0
 libipathverbs/Makefile.am                         | 4 ++--
 libipathverbs/{ipath.driver => ipathverbs.driver} | 0
 4 files changed, 4 insertions(+), 4 deletions(-)
 rename libhfi1verbs/{hfi1.driver => hfi1verbs.driver} (100%)
 rename libipathverbs/{ipath.driver => ipathverbs.driver} (100%)

diff --git a/libhfi1verbs/Makefile.am b/libhfi1verbs/Makefile.am
index 3a51f0ba9889..135e2a2f3ec0 100644
--- a/libhfi1verbs/Makefile.am
+++ b/libhfi1verbs/Makefile.am
@@ -63,7 +63,7 @@ if HAVE_IBV_DEVICE_LIBRARY_EXTENSION
     src_libhfi1verbs_la_LDFLAGS = -avoid-version -release @IBV_DEVICE_LIBRARY_EXTENSION@ \
         $(hfiverbs_version_script)
     hfiverbsconfdir = $(sysconfdir)/libibverbs.d
-    hfiverbsconf_DATA = hfi1.driver
+    hfiverbsconf_DATA = hfi1verbs.driver
 else
     hfiverbslibdir = $(libdir)/infiniband
     hfiverbslib_LTLIBRARIES = src/hfiverbs.la
@@ -77,7 +77,7 @@ EXTRA_DIST = src/hfiverbs.h \
     config \
     autom4te.cache \
     libhfi1.spec.in \
-    hfi1.driver
+    hfi1verbs.driver
 
 dist-hook: libhfi1.spec
 	cp libhfi1.spec $(distdir)
diff --git a/libhfi1verbs/hfi1.driver b/libhfi1verbs/hfi1verbs.driver
similarity index 100%
rename from libhfi1verbs/hfi1.driver
rename to libhfi1verbs/hfi1verbs.driver
diff --git a/libipathverbs/Makefile.am b/libipathverbs/Makefile.am
index f9d4698c5e2c..4d3e9258d989 100644
--- a/libipathverbs/Makefile.am
+++ b/libipathverbs/Makefile.am
@@ -45,7 +45,7 @@ if HAVE_IBV_DEVICE_LIBRARY_EXTENSION
     src_libipathverbs_la_LDFLAGS = -avoid-version -release @IBV_DEVICE_LIBRARY_EXTENSION@ \
         $(ipathverbs_version_script)
     ipathverbsconfdir = $(sysconfdir)/libibverbs.d
-    ipathverbsconf_DATA = ipath.driver
+    ipathverbsconf_DATA = ipathverbs.driver
 else
     ipathverbslibdir = $(libdir)/infiniband
     ipathverbslib_LTLIBRARIES = src/ipathverbs.la
@@ -59,7 +59,7 @@ EXTRA_DIST = src/ipathverbs.h \
     src/ipath-abi.h \
     src/ipathverbs.map \
     libipathverbs.spec.in \
-    ipath.driver \
+    ipathverbs.driver \
     truescale-serdes.cmds \
     truescale.conf
 
diff --git a/libipathverbs/ipath.driver b/libipathverbs/ipathverbs.driver
similarity index 100%
rename from libipathverbs/ipath.driver
rename to libipathverbs/ipathverbs.driver
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 05/16] ibcm: Actually use the version script when linking
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474409425-15769-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

There is a typo in the Makefile.am that resulted in the version
script being ignored.

This changes the symbol names in the shlib, eg
    50: 0000000000001620   530 FUNC    GLOBAL DEFAULT   11 ib_cm_open_device
becomes
    46: 00000000000015f0   530 FUNC    GLOBAL DEFAULT   12 ib_cm_open_device@@IBCM_1.0

Binaries linked to the old library will continue to work with the new one.

Binaries linked to the new library will print a dynamic linker warning when
using the old library:

  ./a.out: /usr/lib/x86_64-linux-gnu/libibcm.so.1: no version information available (required by ./a.out)

But apparently continue to work.

Drepper (https://www.akkadia.org/drepper/symbol-versioning) seems to indicate
that going forward if we do decide to rev a symbol version then resolution for
binaries linked to the old library will continue to prefer the IBCM_1.0
symbol.  This makes sense as it is the basic mechanism used to introduce
symbol versions in the first place.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 libibcm/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libibcm/Makefile.am b/libibcm/Makefile.am
index e4be9f887b1c..ff0b1ded12a3 100644
--- a/libibcm/Makefile.am
+++ b/libibcm/Makefile.am
@@ -8,9 +8,9 @@ AM_CFLAGS = -g -Wall
 src_libibcm_la_CFLAGS = $(AM_CFLAGS)
 
 if HAVE_LD_VERSION_SCRIPT
-    ibcm_version_script = -Wl,--version-script=$(srcdir)/src/libibcm.map
+    libibcm_version_script = -Wl,--version-script=$(srcdir)/src/libibcm.map
 else
-    ibcm_version_script =
+    libibcm_version_script =
 endif
 
 src_libibcm_la_SOURCES = src/cm.c
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 06/16] iwpm: Update autotools enough to build
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474409425-15769-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

auto* drift has rendered it unbuildable on modern distros.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 iwpmd/NEWS         |  0
 iwpmd/autogen.sh   | 10 +---------
 iwpmd/configure.ac |  2 +-
 3 files changed, 2 insertions(+), 10 deletions(-)
 create mode 100644 iwpmd/NEWS

diff --git a/iwpmd/NEWS b/iwpmd/NEWS
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/iwpmd/autogen.sh b/iwpmd/autogen.sh
index 4827884ba1f1..6abb4f8446bd 100755
--- a/iwpmd/autogen.sh
+++ b/iwpmd/autogen.sh
@@ -1,11 +1,3 @@
 #! /bin/sh
 
-# create config dir if not exist
-test -d config || mkdir config
-
-set -x
-aclocal -I config
-libtoolize --force --copy
-autoheader
-automake --foreign --add-missing --copy
-autoconf
+autoreconf -ifv -I config
diff --git a/iwpmd/configure.ac b/iwpmd/configure.ac
index 989452a6295c..5d5388ba2ed9 100644
--- a/iwpmd/configure.ac
+++ b/iwpmd/configure.ac
@@ -7,7 +7,7 @@ AC_CONFIG_SRCDIR([src/iwarp_pm_server.c])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE(-Wall -Werror)
+AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects])
 
 # Checks for programs.
 AC_PROG_CC
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 07/16] rdmacm: Control symbol export from librspreload
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474409425-15769-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Since librspreload is a LD_PRELOAD library it should only export
symbols it intends to override. The following internal symbols were
leaking out:

 getenv_options
 idm_clear
 idm_set
 idx_insert
 idx_remove
 idx_replace
 set_rsocket_options

The simplest way to fix this is with a map file.

Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 librdmacm/Makefile.am          |  5 ++++-
 librdmacm/src/librspreload.map | 33 +++++++++++++++++++++++++++++++++
 librdmacm/src/preload.c        |  4 ++--
 3 files changed, 39 insertions(+), 3 deletions(-)
 create mode 100644 librdmacm/src/librspreload.map

diff --git a/librdmacm/Makefile.am b/librdmacm/Makefile.am
index 84af01a14b4b..edfb36bb4149 100644
--- a/librdmacm/Makefile.am
+++ b/librdmacm/Makefile.am
@@ -23,7 +23,10 @@ src_librdmacm_la_LDFLAGS = -version-info 1 -export-dynamic \
 src_librdmacm_la_DEPENDENCIES =  $(srcdir)/src/librdmacm.map
 
 src_librspreload_la_SOURCES = src/preload.c src/indexer.c
-src_librspreload_la_LDFLAGS = -version-info 1 -export-dynamic
+src_librspreload_la_LDFLAGS = -version-info 1
+if HAVE_LD_VERSION_SCRIPT
+    src_librspreload_la_LDFLAGS += -Wl,--version-script=$(srcdir)/src/librspreload.map
+endif
 src_librspreload_la_LIBADD = $(top_builddir)/src/librdmacm.la
 
 bin_PROGRAMS = examples/ucmatose examples/rping examples/udaddy examples/mckey \
diff --git a/librdmacm/src/librspreload.map b/librdmacm/src/librspreload.map
new file mode 100644
index 000000000000..67ecf33b8203
--- /dev/null
+++ b/librdmacm/src/librspreload.map
@@ -0,0 +1,33 @@
+{
+        /* FIXME: It is probably not a great idea to not tag these with the
+	   proper symbol version from glibc, at least if glibc ever changes
+	   the signature this will go sideways.. */
+	global:
+		accept;
+		bind;
+		close;
+		connect;
+		dup2;
+		fcntl;
+		getpeername;
+		getsockname;
+		getsockopt;
+		listen;
+		poll;
+		read;
+		readv;
+		recv;
+		recvfrom;
+		recvmsg;
+		select;
+		send;
+		sendfile;
+		sendmsg;
+		sendto;
+		setsockopt;
+		shutdown;
+		socket;
+		write;
+		writev;
+	local: *;
+};
diff --git a/librdmacm/src/preload.c b/librdmacm/src/preload.c
index a0bc1cfbd7a5..2a90f79b226c 100644
--- a/librdmacm/src/preload.c
+++ b/librdmacm/src/preload.c
@@ -356,7 +356,7 @@ static enum fd_type fd_close(int index, int *fd)
 	return type;
 }
 
-void getenv_options(void)
+static void getenv_options(void)
 {
 	char *var;
 
@@ -521,7 +521,7 @@ err:
 /*
  * Use defaults on failure.
  */
-void set_rsocket_options(int rsocket)
+static void set_rsocket_options(int rsocket)
 {
 	if (sq_size)
 		rsetsockopt(rsocket, SOL_RDMA, RDMA_SQSIZE, &sq_size, sizeof sq_size);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 08/16] Unified CMake build system
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474409425-15769-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

This replaces the various autoconf/automake/libtool based schemes
unified cmake based scheme.

At this commit both schemes exist in the tree and can be run concurrently.
Except for the differences noted below they produce identical
'make install' and identical intput to cpp. This commit is intended
to be nearly 'no change' in terms of building.

An analysis of the post-install result shows the following differences:
 - cmake makes shlib symlinks libX.so -> libX.so.1 -> libX.so.1.0.0, while
   libtool does libX.so -> libX.so.1.0.0
 - librspreload's non-link name is lib/rsocket/librspreload.so (not .so.1)
   This correctly reflects the fact it is a soname-less LD_PRELOAD library.
   Symlinks are maintained for the other two incorrect names.
 - No static version of librspreload is produced. This library is only
   useful for LD_PRELOAD and cannot be statically linked to.
 - The provider shared library plugins and the LD_PRELOAD library
   have no SONAME. This is standard for plugin libraries.
 - The plugin shared libraries are not marked executable
 - -std=gnu99 is turned on globally
 - All shlibs have correct shared library dependencies (--as-needed and
   --no-undefined are turned on).
   Several binaries drop their pthreads dependency as they don't use it.
 - NDEBUG is controlled globally.
   Previously only libcxgb4 explicitly defined it
   Distros force this to be set during package built so this is no
   change
 - libtool *.la files are produced by cmake since libtool is not used
   and have a few minor differences:
   - Providers do not list the 'libX.so' bogus name, the .so is called
     libX-rdmav2.so
   - version information (current/age/revision) is bogus
   - The .la files are not marked executable

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 CMakeLists.txt                              | 293 ++++++++++++++++++++++++
 COPYING                                     |   6 +
 COPYING.BSD                                 |  26 +++
 COPYING.GPL2                                | 339 ++++++++++++++++++++++++++++
 README.md                                   |  97 ++++++++
 buildlib/FindLDSymVer.cmake                 |  41 ++++
 buildlib/RDMA_DoFixup.cmake                 |  21 ++
 buildlib/RDMA_EnableCStd.cmake              |  23 ++
 buildlib/config.h.in                        |  35 +++
 buildlib/fixup-include/rdma-rdma_user_rxe.h | 144 ++++++++++++
 buildlib/fixup-include/valgrind-drd.h       |   3 +
 buildlib/fixup-include/valgrind-memcheck.h  |   5 +
 buildlib/provider.map                       |   6 +
 buildlib/publish_headers.cmake              |  20 ++
 buildlib/rdma_functions.cmake               | 279 +++++++++++++++++++++++
 ibacm/CMakeLists.txt                        |  69 ++++++
 iwpmd/src/CMakeLists.txt                    |  12 +
 libcxgb3/src/CMakeLists.txt                 |   6 +
 libcxgb4/src/CMakeLists.txt                 |   8 +
 libhfi1verbs/src/CMakeLists.txt             |   4 +
 libi40iw/src/CMakeLists.txt                 |   5 +
 libibcm/examples/CMakeLists.txt             |   2 +
 libibcm/src/CMakeLists.txt                  |   9 +
 libibumad/man/CMakeLists.txt                |  42 ++++
 libibumad/src/CMakeLists.txt                |  14 ++
 libibumad/tests/CMakeLists.txt              |   5 +
 libibverbs/examples/CMakeLists.txt          |  31 +++
 libibverbs/man/CMakeLists.txt               |  83 +++++++
 libibverbs/src/CMakeLists.txt               |  36 +++
 libipathverbs/CMakeLists.txt                |   4 +
 libipathverbs/src/CMakeLists.txt            |   4 +
 libmlx4/src/CMakeLists.txt                  |   9 +
 libmlx5/src/CMakeLists.txt                  |   9 +
 libmthca/src/CMakeLists.txt                 |  10 +
 libnes/src/CMakeLists.txt                   |   4 +
 libocrdma/src/CMakeLists.txt                |   4 +
 librdmacm/examples/CMakeLists.txt           |  43 ++++
 librdmacm/man/CMakeLists.txt                |  65 ++++++
 librdmacm/src/CMakeLists.txt                |  39 ++++
 librxe/CMakeLists.txt                       |   4 +
 librxe/man/CMakeLists.txt                   |   4 +
 librxe/src/CMakeLists.txt                   |   3 +
 srp_daemon/man/CMakeLists.txt               |   4 +
 srp_daemon/srp_daemon/CMakeLists.txt        |  32 +++
 44 files changed, 1902 insertions(+)
 create mode 100644 CMakeLists.txt
 create mode 100644 COPYING
 create mode 100644 COPYING.BSD
 create mode 100644 COPYING.GPL2
 create mode 100644 README.md
 create mode 100644 buildlib/FindLDSymVer.cmake
 create mode 100644 buildlib/RDMA_DoFixup.cmake
 create mode 100644 buildlib/RDMA_EnableCStd.cmake
 create mode 100644 buildlib/config.h.in
 create mode 100644 buildlib/fixup-include/rdma-rdma_user_rxe.h
 create mode 100644 buildlib/fixup-include/valgrind-drd.h
 create mode 100644 buildlib/fixup-include/valgrind-memcheck.h
 create mode 100644 buildlib/provider.map
 create mode 100644 buildlib/publish_headers.cmake
 create mode 100644 buildlib/rdma_functions.cmake
 create mode 100644 ibacm/CMakeLists.txt
 create mode 100644 iwpmd/src/CMakeLists.txt
 create mode 100644 libcxgb3/src/CMakeLists.txt
 create mode 100644 libcxgb4/src/CMakeLists.txt
 create mode 100644 libhfi1verbs/src/CMakeLists.txt
 create mode 100644 libi40iw/src/CMakeLists.txt
 create mode 100644 libibcm/examples/CMakeLists.txt
 create mode 100644 libibcm/src/CMakeLists.txt
 create mode 100644 libibumad/man/CMakeLists.txt
 create mode 100644 libibumad/src/CMakeLists.txt
 create mode 100644 libibumad/tests/CMakeLists.txt
 create mode 100644 libibverbs/examples/CMakeLists.txt
 create mode 100644 libibverbs/man/CMakeLists.txt
 create mode 100644 libibverbs/src/CMakeLists.txt
 create mode 100644 libipathverbs/CMakeLists.txt
 create mode 100644 libipathverbs/src/CMakeLists.txt
 create mode 100644 libmlx4/src/CMakeLists.txt
 create mode 100644 libmlx5/src/CMakeLists.txt
 create mode 100644 libmthca/src/CMakeLists.txt
 create mode 100644 libnes/src/CMakeLists.txt
 create mode 100644 libocrdma/src/CMakeLists.txt
 create mode 100644 librdmacm/examples/CMakeLists.txt
 create mode 100644 librdmacm/man/CMakeLists.txt
 create mode 100644 librdmacm/src/CMakeLists.txt
 create mode 100644 librxe/CMakeLists.txt
 create mode 100644 librxe/man/CMakeLists.txt
 create mode 100644 librxe/src/CMakeLists.txt
 create mode 100644 srp_daemon/man/CMakeLists.txt
 create mode 100644 srp_daemon/srp_daemon/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 000000000000..50ae527419a1
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,293 @@
+# COPYRIGHT (c) 2016 Obsidian Research Corporation. See COPYING file
+# Run cmake as:
+#  mkdir build
+#  cmake -GNinja ..
+#  ninja
+#
+# Common options passed to cmake are:
+#  -DCMAKE_EXPORT_COMPILE_COMMANDS=1
+#      Write a compile_commands.json file for clang tooling
+#  -DENABLE_VALGRIND=1 (default disabled)
+#      Embed valgrind notations, this has a tiny negative performance impact
+#  -DENABLE_RESOLVE_NEIGH=0 (default enabled)
+#      Do not link to libnl and do not resolve neighbours internally for Ethernet,
+#      and do not build iwpmd.
+
+cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+project(RDMA C)
+
+# CMake likes to use -rdynamic too much, they fixed it in 3.4.
+if(POLICY CMP0065)
+  cmake_policy(SET CMP0065 NEW)
+else()
+  # .. but we really do want to opt out.
+  string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}")
+endif()
+
+set(PACKAGE_NAME "RDMA")
+# FIXME versioning strategy?
+set(PACKAGE_VERSION "1")
+
+#-------------------------
+# Basic standard paths
+include(GNUInstallDirs)
+# C include root
+set(BUILD_INCLUDE ${CMAKE_BINARY_DIR}/include)
+# Executables
+set(BUILD_BIN ${CMAKE_BINARY_DIR}/bin)
+# Libraries
+set(BUILD_LIB ${CMAKE_BINARY_DIR}/lib)
+
+# Location to place provider .driver files
+set(CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/libibverbs.d")
+set(CMAKE_INSTALL_INITDDIR "${CMAKE_INSTALL_SYSCONFDIR}/init.d"
+  CACHE PATH "Location for init.d files")
+set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd"
+  CACHE PATH "Location for systemd service files")
+
+set(ACM_PROVIDER_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/ibacm"
+  CACHE PATH "Location for ibacm provider plugin shared library files.")
+
+#-------------------------
+# Load CMake components
+set(BUILDLIB "${CMAKE_SOURCE_DIR}/buildlib")
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${BUILDLIB}")
+
+include(FindPkgConfig)
+include(CheckCCompilerFlag)
+include(CheckIncludeFile)
+include(CheckTypeSize)
+include(RDMA_EnableCStd)
+include(RDMA_DoFixup)
+include(publish_headers)
+include(rdma_functions)
+
+#-------------------------
+# Setup the basic C compiler
+include_directories(${BUILD_INCLUDE})
+# FIXME: Eliminate HAVE_CONFIG_H, we always have it.
+add_definitions(-DHAVE_CONFIG_H)
+
+# Require GNU99 mode
+RDMA_EnableCStd()
+
+# Extra warnings. Turn on -Wextra to keep aware of interesting developments from gcc,
+# but turn off some that are not terribly useful for this source.
+# FIXME: I wonder how many of the signed compares are bugs?
+RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WARNINGS
+  "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter")
+
+# At some point around 5.4 gcc fixed missing-field-initializers to ignore this
+# common idiom we use extensively. Since this is a useful warning for
+# developers try and leave it on if the compiler supports it.
+CHECK_C_SOURCE_COMPILES("
+ struct foo { int a; int b; };
+ int main(int argc,const char *argv[]) { struct foo tmp = {}; return tmp.a; }"
+  HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS
+  FAIL_REGEX "warning")
+if (NOT HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS)
+  RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WNO_MISSING_FIELD_INITIALIZERS "-Wno-missing-field-initializers")
+endif()
+
+# Check that the compiler supports -fno-strict-aliasing.
+# The use of this flag in the source is discouraged
+set(NO_STRICT_ALIASING_FLAGS "")
+RDMA_AddOptCFlag(NO_STRICT_ALIASING_FLAGS HAVE_NO_STRICT_ALIASING
+  "-fno-strict-aliasing")
+
+# The code does not do the racy fcntl if the various CLOEXEC's are not
+# supported so it really doesn't work right if this isn't available. Thus hard
+# require it.
+CHECK_C_SOURCE_COMPILES("
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+ #include <fcntl.h>
+ int main(int argc,const char *argv[]) {
+    open(\".\",O_RDONLY | O_CLOEXEC);
+    socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
+    return 0;
+ }" HAS_CLOEXEC)
+if (NOT HAS_CLOEXEC)
+  message(FATAL_ERROR "O_CLOEXEC/SOCK_CLOEXEC/fopen(..,\"e\") support is required but not found")
+endif()
+
+# always_inline is supported
+CHECK_C_SOURCE_COMPILES("
+ inline __attribute__((always_inline)) int foo(void) {return 0;}
+ int main(int argc,const char *argv[]) { return foo(); }"
+  HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE
+  FAIL_REGEX "warning")
+
+# Enable development support features
+# Prune unneeded shared libraries during linking
+RDMA_AddOptCFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
+RDMA_AddOptCFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
+RDMA_AddOptCFlag(CMAKE_MODULE_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed")
+
+# Ensure all shared ELFs have fully described linking
+RDMA_AddOptCFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-Wl,--no-undefined")
+RDMA_AddOptCFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-Wl,--no-undefined")
+
+# Enable gold linker - gold has different linking checks
+#RDMA_AddOptCFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
+#RDMA_AddOptCFlag(CMAKE_SHARED_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
+#RDMA_AddOptCFlag(CMAKE_MODULE_LINKER_FLAGS SUPPORTS_NO_UNDEFINED "-fuse-ld=gold")
+
+# Verify that GNU --version-script and asm(".symver") works
+find_package(LDSymVer REQUIRED)
+
+#-------------------------
+# Find libraries
+# pthread
+FIND_PACKAGE (Threads REQUIRED)
+
+# libnl
+if (NOT DEFINED ENABLE_RESOLVE_NEIGH)
+  set(ENABLE_RESOLVE_NEIGH "ON" CACHE BOOL "Enable internal resolution of neighbours for Etherent")
+endif()
+if (ENABLE_RESOLVE_NEIGH)
+  # FIXME use of pkgconfig is discouraged
+  pkg_check_modules(NL3 libnl-3.0 libnl-route-3.0)
+  if (NL3_FOUND)
+    set(NL_KIND 3)
+    set(NL_INCLUDE_DIRS ${NL3_INCLUDE_DIRS})
+    set(NL_LIBRARIES ${NL3_LIBRARIES})
+  else()
+    # FIXME: I don't know why we have this fallback, all supported distros
+    # have libnl3
+    pkg_check_modules(NL1 libnl-1)
+    if (NL1_FOUND)
+      set(NL_KIND 1)
+      set(NL_INCLUDE_DIRS ${NL1_INCLUDE_DIRS})
+      set(NL_LIBRARIES ${NL1_LIBRARIES})
+    else()
+      message(FATAL_ERROR "Cannot find libnl-3.0 or libnl-1")
+    endif()
+  endif()
+
+  include_directories(${NL_INCLUDE_DIRS})
+else()
+  set(NL_KIND 0)
+  set(NL_LIBRARIES "")
+endif()
+
+# Statically determine sizeof(long), this is largely unnecessary, no new code
+# should rely on this.
+check_type_size("long" SIZEOF_LONG BUILTIN_TYPES_ONLY LANGUAGE C)
+
+# Are our kernel headers new enough?
+# If not replace them with built-in copies so we can continue to build.
+CHECK_INCLUDE_FILE("rdma/rdma_user_rxe.h" HAVE_RDMA_USER_RXE)
+RDMA_DoFixup("${HAVE_RDMA_USER_RXE}" "rdma/rdma_user_rxe.h")
+
+#-------------------------
+# Apply fixups
+
+# FIXME: We should probably always enable memcheck.h, and only selectively
+# turn it off in the real high performance paths. There is no reason umad
+# should ever have memcheck disabled for instance.
+if (ENABLE_VALGRIND)
+  CHECK_INCLUDE_FILE("valgrind/memcheck.h" HAVE_VALGRIND_MEMCHECK)
+  CHECK_INCLUDE_FILE("valgrind/drd.h" HAVE_VALGRIND_DRD)
+else()
+  set(HAVE_VALGRIND_MEMCHECK 0)
+  set(HAVE_VALGRIND_DRD 0)
+endif()
+RDMA_DoFixup("${HAVE_VALGRIND_MEMCHECK}" "valgrind/memcheck.h")
+RDMA_DoFixup("${HAVE_VALGRIND_DRD}" "valgrind/drd.h")
+
+# Older glibc does not include librt
+CHECK_C_SOURCE_COMPILES("
+#include <time.h>
+int main(int argc,const char *argv[]) {
+   clock_gettime(CLOCK_MONOTONIC,0);
+   clock_nanosleep(CLOCK_MONOTONIC,0,0,0);
+   return 0;
+};" LIBC_HAS_LIBRT)
+if (NOT LIBC_HAS_LIBRT)
+  set(RT_LIBRARIES "rt")
+endif()
+
+#-------------------------
+# Build Prep
+# Write out a git ignore file to the build directory if it isn't the source
+# directory. For developer convenience
+if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+  file(WRITE ${CMAKE_BINARY_DIR}/.gitignore "*")
+endif()
+
+configure_file("${BUILDLIB}/config.h.in" "${BUILD_INCLUDE}/config.h" ESCAPE_QUOTES @ONLY)
+
+#-------------------------
+# Sub-directories
+# Libraries
+add_subdirectory(libibumad/src)
+add_subdirectory(libibumad/man)
+add_subdirectory(libibverbs/src)
+add_subdirectory(libibverbs/man)
+add_subdirectory(librdmacm/src)
+add_subdirectory(librdmacm/man)
+add_subdirectory(libibcm/src)
+
+# Providers
+add_subdirectory(libcxgb3/src)
+add_subdirectory(libcxgb4/src)
+add_subdirectory(libhfi1verbs/src)
+add_subdirectory(libi40iw/src)
+add_subdirectory(libipathverbs/src)
+add_subdirectory(libipathverbs/)
+add_subdirectory(libmlx4/src)
+add_subdirectory(libmlx5/src)
+add_subdirectory(libmthca/src)
+add_subdirectory(libnes/src)
+add_subdirectory(libocrdma/src)
+add_subdirectory(librxe/src)
+add_subdirectory(librxe/man)
+add_subdirectory(librxe/)
+
+# Binaries
+add_subdirectory(ibacm)
+if (NOT NL_KIND EQUAL 0)
+  add_subdirectory(iwpmd/src)
+endif()
+add_subdirectory(libibcm/examples)
+add_subdirectory(libibumad/tests)
+add_subdirectory(libibverbs/examples)
+add_subdirectory(librdmacm/examples)
+add_subdirectory(srp_daemon/srp_daemon)
+add_subdirectory(srp_daemon/man)
+
+rdma_finalize_libs()
+
+#-------------------------
+# Display a summary
+# Only report things that are non-ideal.
+message(STATUS "Missing Optional Items:")
+if (NOT HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE)
+  message(STATUS " Compiler attribute always_inline NOT supported")
+endif()
+if (NOT HAVE_VALGRIND_MEMCHECK)
+  message(STATUS " Valgrind memcheck.h NOT enabled")
+endif()
+if (NOT HAVE_VALGRIND_DRD)
+  message(STATUS " Valgrind drd.h NOT enabled")
+endif()
+if (NL_KIND EQUAL 1)
+  message(STATUS " libnl 3 NOT found (using libnl 1 compat)")
+endif()
+if (NL_KIND EQUAL 0)
+  message(STATUS " neighbour resolution NOT enabled")
+endif()
+if (NOT HAVE_RDMA_USER_RXE)
+  message(STATUS " rdma/rdma_user_rxe.h NOT found (old system kernel headers)")
+endif()
+if (NOT HAVE_C_WARNINGS)
+  message(STATUS " extended C warnings NOT supported")
+endif()
+if (NOT HAVE_NO_STRICT_ALIASING)
+  message(STATUS " -fno-strict-aliasing NOT supported")
+endif()
+if (NOT HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS)
+  message(STATUS " -Wmissing-field-initializers does NOT work")
+endif()
diff --git a/COPYING b/COPYING
new file mode 100644
index 000000000000..ac58180e900c
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,6 @@
+Unless otherwise stated this software is available to you under a choice of
+one of two licenses.  You may choose to be licensed under the terms of the the
+OpenIB.org BSD license (see COPYING.BSD) or the GNU General Public License
+(GPL) Version 2 (see COPYING.GPL2), both included in this package.
+
+Refer to individual files for information on the copyright holders.
diff --git a/COPYING.BSD b/COPYING.BSD
new file mode 100644
index 000000000000..59b3a397a13b
--- /dev/null
+++ b/COPYING.BSD
@@ -0,0 +1,26 @@
+		       OpenIB.org BSD license
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above
+    copyright notice, this list of conditions and the following
+    disclaimer in the documentation and/or other materials provided
+    with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/COPYING.GPL2 b/COPYING.GPL2
new file mode 100644
index 000000000000..d159169d1050
--- /dev/null
+++ b/COPYING.GPL2
@@ -0,0 +1,339 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/README.md b/README.md
new file mode 100644
index 000000000000..26f44c1f2d8c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,97 @@
+# RDMA Plumbing
+
+This is the userspace components for the Linux Kernel's drivers/infiniband
+subsystem. Specifically this contains the userspace libraries for the
+following device nodes:
+
+ - /dev/infiniband/uverbsX (libibverbs)
+ - /dev/infiniband/rdma_cm (librdmacm)
+ - /dev/infiniband/umadX (libumad)
+ - /dev/infiniband/ucmX (libibcm, deprecated)
+
+The userspace component of the libibverbs RDMA kernel drivers are included
+under the providers/ directory. Support for the following Kernel RDMA drivers
+is included:
+
+ - iw_cxgb3.ko
+ - iw_cxgb4.ko
+ - hfi1.ko
+ - i40iw.ko
+ - ib_qib.ko
+ - mlx4_ib.ko
+ - mlx5_ib.ko
+ - ib_mthca.ko
+ - iw_nes.ko
+ - ocrdma.ko
+ - rdma_rxe.ko
+
+Additional service daemons are provided for:
+ - srp_daemon (ib_srp.ko)
+ - iwpmd (for iwarp kernel providers)
+
+# Building
+
+This project uses a cmake based build system. Quick start:
+
+```sh
+$ mkdir build
+$ cd build
+$ cmake -GNinja ..
+$ ninja
+```
+
+*build/bin* will contain the sample programs and *build/lib* will contain the
+shared libraries.
+
+NOTE: It is not currently easy to run from the build directory, the plugins
+only load from the system path.
+
+### Debian Derived
+
+```sh
+$ apt-get install build-essential cmake gcc libnl-3-dev libnl-route-3-dev ninja-build pkg-config valgrind
+```
+
+### Fedora
+
+```sh
+$ dnf install cmake gcc libnl3-devel pkgconfig valgrind-devel ninja-build
+```
+
+NOTE: Fedora Core uses the name 'ninja-build' for the ninja command.
+
+### OpenSuSE
+
+```sh
+$ zypper install cmake gcc libnl3-devel ninja pkg-config valgrind-devel
+```
+
+## Building on CentOS 6/7
+
+Install required packages:
+
+```sh
+$ yum install cmake gcc libnl3-devel make pkgconfig valgrind-devel
+```
+
+For end users, the package can be built using GNU Make and the old cmake
+included with the distro:
+
+```sh
+$ mkdir build
+$ cd build
+$ cmake  ..
+$ make
+```
+
+Developers are suggested to install more modern tooling for the best experience.
+
+```sh
+$ yum install epel-release
+$ yum install cmake3 unzip
+$ curl -OL https://github.com/ninja-build/ninja/releases/download/v1.7.1/ninja-linux.zip
+$ unzip ninja-linux.zip
+$ install -m755 ninja /usr/local/bin/ninja
+```
+
+Use the 'cmake3' program in place of `cmake` in the above instructions.
diff --git a/buildlib/FindLDSymVer.cmake b/buildlib/FindLDSymVer.cmake
new file mode 100644
index 000000000000..c0f01a562e32
--- /dev/null
+++ b/buildlib/FindLDSymVer.cmake
@@ -0,0 +1,41 @@
+# COPYRIGHT (c) 2016 Obsidian Research Corporation. See COPYING file
+# find_package helper to detect symbol version support in the compiler and
+# linker. If supported then LDSYMVER_MODE will be set to GNU
+
+# Basic sample GNU style map file
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test.map" "
+IBVERBS_1.0 {
+        global:
+                ibv_get_device_list;
+        local: *;
+};
+
+IBVERBS_1.1 {
+        global:
+                ibv_get_device_list;
+} IBVERBS_1.0;
+")
+
+set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
+set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/test.map")
+
+# And matching source, this also checks that .symver asm works
+check_c_source_compiles("
+void ibv_get_device_list_1(void){}
+asm(\".symver ibv_get_device_list_1, ibv_get_device_list@IBVERBS_1.1\");
+void ibv_get_device_list_0(void){}
+asm(\".symver ibv_get_device_list_0, ibv_get_device_list@@IBVERBS_1.0\");
+
+int main(void){return 0;}" _LDSYMVER_SUCCESS)
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test.map")
+set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
+
+if (_LDSYMVER_SUCCESS)
+  set(LDSYMVER_MODE "GNU" CACHE INTERNAL "How to set symbol versions on shared libraries")
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+  LDSymVer
+  REQUIRED_VARS LDSYMVER_MODE
+  )
diff --git a/buildlib/RDMA_DoFixup.cmake b/buildlib/RDMA_DoFixup.cmake
new file mode 100644
index 000000000000..3ffd50aa1de4
--- /dev/null
+++ b/buildlib/RDMA_DoFixup.cmake
@@ -0,0 +1,21 @@
+# COPYRIGHT (c) 2016 Obsidian Research Corporation. See COPYING file
+
+# Execute a header fixup based on NOT_NEEDED for HEADER
+
+# The buildlib includes alternate header file shims for several scenarios, if
+# the build system detects a feature is present then it should call RDMA_DoFixup
+# with the test as true. If false then the shim header will be installed.
+
+# Typically the shim header will replace a missing header with stubs, or it
+# will augment an existing header with include_next.
+function(RDMA_DoFixup not_needed header)
+  set(DEST "${BUILD_INCLUDE}/${header}")
+  if (NOT "${not_needed}")
+    get_filename_component(DIR ${DEST} DIRECTORY)
+    file(MAKE_DIRECTORY "${DIR}")
+    string(REPLACE / - header-bl ${header})
+    execute_process(COMMAND "ln" "-Tsf" "${BUILDLIB}/fixup-include/${header-bl}" "${DEST}")
+  else()
+    file(REMOVE ${DEST})
+  endif()
+endfunction()
diff --git a/buildlib/RDMA_EnableCStd.cmake b/buildlib/RDMA_EnableCStd.cmake
new file mode 100644
index 000000000000..9cbbb881cd19
--- /dev/null
+++ b/buildlib/RDMA_EnableCStd.cmake
@@ -0,0 +1,23 @@
+# COPYRIGHT (c) 2016 Obsidian Research Corporation. See COPYING file
+
+# Test if the CC compiler supports the flag and if so add it to TO_VAR
+function(RDMA_AddOptCFlag TO_VAR CACHE_VAR FLAG)
+  CHECK_C_COMPILER_FLAG("${FLAG}" ${CACHE_VAR})
+  if (${CACHE_VAR})
+    SET(${TO_VAR} "${${TO_VAR}} ${FLAG}" PARENT_SCOPE)
+  endif()
+endfunction()
+
+# Enable the minimum required gnu99 standard in the compiler.
+function(RDMA_EnableCStd)
+  if (CMAKE_VERSION VERSION_LESS "3.1")
+    # Check for support of the usual flag
+    CHECK_C_COMPILER_FLAG("-std=gnu99" SUPPORTS_GNU99)
+    if (SUPPORTS_GNU99)
+      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99" PARENT_SCOPE)
+    endif()
+  else()
+    # Newer cmake can do this internally
+    set(CMAKE_C_STANDARD 99 PARENT_SCOPE)
+  endif()
+endfunction()
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
new file mode 100644
index 000000000000..984d51bfaa09
--- /dev/null
+++ b/buildlib/config.h.in
@@ -0,0 +1,35 @@
+// FIXME: Remove this, ibverbs is included so we don't need to detect
+#define HAVE_IBV_DOFORK_RANGE 1
+#define HAVE_IBV_DONTFORK_RANGE 1
+#define HAVE_IBV_REGISTER_DRIVER 1
+#define HAVE_IBV_READ_SYSFS_FILE 1
+
+// FIXME: Remove this, we provide the netlink kernel headers ibacm needs
+#define HAVE_NETLINK 1
+
+// FIXME: Remove this, The cmake version hard-requires symbol version support
+#define HAVE_SYMVER_SUPPORT 1
+
+// FIXME: Remove this, The cmake version hard-requires new style CLOEXEC support
+#define STREAM_CLOEXEC "e"
+
+// FIXME: Remove this, cmake always provides a valgrind/memcheck.h
+#define HAVE_VALGRIND_MEMCHECK_H 1
+#define INCLUDE_VALGRIND 1
+
+#define SYSCONFDIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@"
+
+#define IBV_CONFIG_DIR "@CONFIG_DIR@"
+
+// FIXME This has been supported in compilers forever, we should just fail to build on such old systems.
+#cmakedefine HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE 1
+
+@SIZEOF_LONG_CODE@
+
+#if @NL_KIND@ == 3
+# define HAVE_LIBNL3 1
+#elif @NL_KIND@ == 1
+# define HAVE_LIBNL1 1
+#elif @NL_KIND@ == 0
+# define NRESOLVE_NEIGH 1
+#endif
diff --git a/buildlib/fixup-include/rdma-rdma_user_rxe.h b/buildlib/fixup-include/rdma-rdma_user_rxe.h
new file mode 100644
index 000000000000..1de99cfdaf7d
--- /dev/null
+++ b/buildlib/fixup-include/rdma-rdma_user_rxe.h
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *	- Redistributions of source code must retain the above
+ *	  copyright notice, this list of conditions and the following
+ *	  disclaimer.
+ *
+ *	- Redistributions in binary form must reproduce the above
+ *	  copyright notice, this list of conditions and the following
+ *	  disclaimer in the documentation and/or other materials
+ *	  provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef RDMA_USER_RXE_H
+#define RDMA_USER_RXE_H
+
+#include <linux/types.h>
+
+union rxe_gid {
+	__u8	raw[16];
+	struct {
+		__be64	subnet_prefix;
+		__be64	interface_id;
+	} global;
+};
+
+struct rxe_global_route {
+	union rxe_gid	dgid;
+	__u32		flow_label;
+	__u8		sgid_index;
+	__u8		hop_limit;
+	__u8		traffic_class;
+};
+
+struct rxe_av {
+	__u8			port_num;
+	__u8			network_type;
+	struct rxe_global_route	grh;
+	union {
+		struct sockaddr		_sockaddr;
+		struct sockaddr_in	_sockaddr_in;
+		struct sockaddr_in6	_sockaddr_in6;
+	} sgid_addr, dgid_addr;
+};
+
+struct rxe_send_wr {
+	__u64			wr_id;
+	__u32			num_sge;
+	__u32			opcode;
+	__u32			send_flags;
+	union {
+		__be32		imm_data;
+		__u32		invalidate_rkey;
+	} ex;
+	union {
+		struct {
+			__u64	remote_addr;
+			__u32	rkey;
+		} rdma;
+		struct {
+			__u64	remote_addr;
+			__u64	compare_add;
+			__u64	swap;
+			__u32	rkey;
+		} atomic;
+		struct {
+			__u32	remote_qpn;
+			__u32	remote_qkey;
+			__u16	pkey_index;
+		} ud;
+		struct {
+			struct ib_mr *mr;
+			__u32        key;
+			int          access;
+		} reg;
+	} wr;
+};
+
+struct rxe_sge {
+	__u64	addr;
+	__u32	length;
+	__u32	lkey;
+};
+
+struct mminfo {
+	__u64			offset;
+	__u32			size;
+	__u32			pad;
+};
+
+struct rxe_dma_info {
+	__u32			length;
+	__u32			resid;
+	__u32			cur_sge;
+	__u32			num_sge;
+	__u32			sge_offset;
+	union {
+		__u8		inline_data[0];
+		struct rxe_sge	sge[0];
+	};
+};
+
+struct rxe_send_wqe {
+	struct rxe_send_wr	wr;
+	struct rxe_av		av;
+	__u32			status;
+	__u32			state;
+	__u64			iova;
+	__u32			mask;
+	__u32			first_psn;
+	__u32			last_psn;
+	__u32			ack_length;
+	__u32			ssn;
+	__u32			has_rd_atomic;
+	struct rxe_dma_info	dma;
+};
+
+struct rxe_recv_wqe {
+	__u64			wr_id;
+	__u32			num_sge;
+	__u32			padding;
+	struct rxe_dma_info	dma;
+};
+
+#endif /* RDMA_USER_RXE_H */
diff --git a/buildlib/fixup-include/valgrind-drd.h b/buildlib/fixup-include/valgrind-drd.h
new file mode 100644
index 000000000000..9e491fc68047
--- /dev/null
+++ b/buildlib/fixup-include/valgrind-drd.h
@@ -0,0 +1,3 @@
+static inline void ANNOTATE_BENIGN_RACE_SIZED(const void *mem,size_t len,const char *desc) {}
+#define ANNOTATE_BENIGN_RACE_SIZED ANNOTATE_BENIGN_RACE_SIZED
+
diff --git a/buildlib/fixup-include/valgrind-memcheck.h b/buildlib/fixup-include/valgrind-memcheck.h
new file mode 100644
index 000000000000..6457a5a0f6a1
--- /dev/null
+++ b/buildlib/fixup-include/valgrind-memcheck.h
@@ -0,0 +1,5 @@
+static inline void VALGRIND_MAKE_MEM_DEFINED(const void *mem,size_t len) {}
+#define VALGRIND_MAKE_MEM_DEFINED VALGRIND_MAKE_MEM_DEFINED
+
+static inline void VALGRIND_MAKE_MEM_UNDEFINED(const void *mem,size_t len) {}
+#define VALGRIND_MAKE_MEM_UNDEFINED VALGRIND_MAKE_MEM_UNDEFINED
diff --git a/buildlib/provider.map b/buildlib/provider.map
new file mode 100644
index 000000000000..e985a6fe97d8
--- /dev/null
+++ b/buildlib/provider.map
@@ -0,0 +1,6 @@
+/* The providers do not export any symbols at all. Instead they rely on
+   attribute(constructor) to cause their init function to run at dlopen
+   time. */
+{
+	local: *;
+};
diff --git a/buildlib/publish_headers.cmake b/buildlib/publish_headers.cmake
new file mode 100644
index 000000000000..ccd22960c141
--- /dev/null
+++ b/buildlib/publish_headers.cmake
@@ -0,0 +1,20 @@
+# COPYRIGHT (c) 2016 Obsidian Research Corporation. See COPYING file
+
+# Copy headers from the source directory to the proper place in the
+# build/include directory
+function(PUBLISH_HEADERS DEST)
+  if(NOT ARGN)
+    message(SEND_ERROR "Error: PUBLISH_HEADERS called without any files")
+    return()
+  endif()
+
+  set(DDIR "${BUILD_INCLUDE}/${DEST}")
+  file(MAKE_DIRECTORY "${DDIR}")
+
+  foreach(SFIL ${ARGN})
+    get_filename_component(FIL ${SFIL} NAME)
+    execute_process(COMMAND "ln" "-Tsf"
+      "${CMAKE_CURRENT_SOURCE_DIR}/${SFIL}" "${DDIR}/${FIL}")
+    install(FILES "${SFIL}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${DEST}/" RENAME "${FIL}")
+  endforeach()
+endfunction()
diff --git a/buildlib/rdma_functions.cmake b/buildlib/rdma_functions.cmake
new file mode 100644
index 000000000000..d82ed4757bb7
--- /dev/null
+++ b/buildlib/rdma_functions.cmake
@@ -0,0 +1,279 @@
+# COPYRIGHT (c) 2016 Obsidian Research Corporation. See COPYING file
+
+# Helper functions for use in the sub CMakeLists files to make them simpler
+# and more uniform.
+
+# Global list of pairs of (SHARED STATIC) libary target names
+set(RDMA_STATIC_LIBS "" CACHE INTERNAL "Doc" FORCE)
+
+# Install a symlink during 'make install'
+function(rdma_install_symlink LINK_CONTENT DEST)
+  # Create a link in the build tree with the right content
+  get_filename_component(FN "${DEST}" NAME)
+  execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink
+    "${LINK_CONTENT}"
+    "${CMAKE_CURRENT_BINARY_DIR}/${FN}")
+
+  # Have cmake install it. Doing it this way lets cpack work if we ever wish
+  # to use that.
+  get_filename_component(DIR "${DEST}" PATH)
+  install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${FN}"
+    DESTINATION "${DIR}")
+endfunction()
+
+# Wrapper for install() that runs the single file through configure_file first.
+# This only works with the basic single file install(FILE file ARGS..) pattern
+function(rdma_subst_install ARG1 file)
+  if (NOT "${ARG1}" STREQUAL "FILES")
+    message(FATAL_ERROR "Bad use of rdma_subst_install")
+  endif()
+  configure_file("${file}" "${CMAKE_CURRENT_BINARY_DIR}/${file}" @ONLY)
+  install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${file}" ${ARGN})
+endfunction()
+
+# Modify shared library target DEST to use VERSION_SCRIPT as the linker map file
+function(rdma_set_library_map DEST VERSION_SCRIPT)
+  if (NOT IS_ABSOLUTE ${VERSION_SCRIPT})
+    set(VERSION_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/${VERSION_SCRIPT}")
+  endif()
+  set_property(TARGET ${DEST} APPEND_STRING PROPERTY
+    LINK_FLAGS " -Wl,--version-script,${VERSION_SCRIPT}")
+
+  # NOTE: This won't work with ninja prior to cmake 3.4
+  set_property(TARGET ${DEST} APPEND_STRING PROPERTY
+    LINK_DEPENDS ${VERSION_SCRIPT})
+endfunction()
+
+# Basic function to produce a standard libary with a GNU LD version script.
+function(rdma_library DEST VERSION_SCRIPT SOVERSION VERSION)
+  # Create a static library
+  add_library(${DEST}-static STATIC ${ARGN})
+  set_target_properties(${DEST}-static PROPERTIES
+    OUTPUT_NAME ${DEST}
+    LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
+  install(TARGETS ${DEST}-static DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+
+  list(APPEND RDMA_STATIC_LIBS ${DEST} ${DEST}-static)
+  set(RDMA_STATIC_LIBS "${RDMA_STATIC_LIBS}" CACHE INTERNAL "")
+
+  # Create a shared library
+  add_library(${DEST} SHARED ${ARGN})
+  rdma_set_library_map(${DEST} ${VERSION_SCRIPT})
+  set_target_properties(${DEST} PROPERTIES
+    SOVERSION ${SOVERSION}
+    VERSION ${VERSION}
+    LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
+  install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+endfunction()
+
+# Create a provider shared library for libibverbs
+function(rdma_provider DEST)
+  # Installed driver file
+  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${DEST}.driver" "driver ${DEST}\n")
+  install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${DEST}.driver" DESTINATION "${CONFIG_DIR}")
+
+  # Uninstalled driver file
+  file(MAKE_DIRECTORY "${BUILD_LIB}/libibverbs.d/")
+  file(WRITE "${BUILD_LIB}/libibverbs.d/${DEST}.driver" "driver ${BUILD_LIB}/${DEST}\n")
+
+  # FIXME: This symlink is provided for compat with the old build, but it
+  # never should have existed in the first place, nothing should use this
+  # name, we can probably remove it.
+  rdma_install_symlink("lib${DEST}-rdmav2.so" "${CMAKE_INSTALL_LIBDIR}/lib${DEST}.so")
+
+  # Create a static provider library
+  # FIXME: This is probably pointless, the provider library has no symbols so
+  # what good is it? Presumably it should be used with -Wl,--whole-archive,
+  # but we don't have any directions on how to make static linking work..
+  add_library(${DEST} STATIC ${ARGN})
+  set_target_properties(${DEST} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
+  install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+
+  list(APPEND RDMA_STATIC_LIBS ${DEST}-rdmav2 ${DEST})
+  set(RDMA_STATIC_LIBS "${RDMA_STATIC_LIBS}" CACHE INTERNAL "")
+
+  # Create the plugin shared library
+  set(DEST ${DEST}-rdmav2)
+  add_library(${DEST} MODULE ${ARGN})
+  # Even though these are modules we still want to use Wl,--no-undefined
+  set_target_properties(${DEST} PROPERTIES LINK_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
+  rdma_set_library_map(${DEST} ${BUILDLIB}/provider.map)
+  target_link_libraries(${DEST} PRIVATE ibverbs)
+  target_link_libraries(${DEST} PRIVATE ${CMAKE_THREAD_LIBS_INIT})
+  set_target_properties(${DEST} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
+  # Provider Plugins do not use SONAME versioning, there is no reason to
+  # create the usual symlinks.
+
+  install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+endfunction()
+
+ # Create an installed executable
+function(rdma_executable EXEC)
+  add_executable(${EXEC} ${ARGN})
+  set_target_properties(${EXEC} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BUILD_BIN}")
+  install(TARGETS ${EXEC} DESTINATION "${CMAKE_INSTALL_BINDIR}")
+endfunction()
+
+ # Create an installed executable (under sbin)
+function(rdma_sbin_executable EXEC)
+  add_executable(${EXEC} ${ARGN})
+  set_target_properties(${EXEC} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BUILD_BIN}")
+  install(TARGETS ${EXEC} DESTINATION "${CMAKE_INSTALL_SBINDIR}")
+endfunction()
+
+# Create an test executable (not-installed)
+function(rdma_test_executable EXEC)
+  add_executable(${EXEC} ${ARGN})
+  set_target_properties(${EXEC} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BUILD_BIN}")
+endfunction()
+
+# Install man pages. This deduces the section from the trailing integer in the
+# filename
+function(rdma_man_pages)
+  foreach(I ${ARGN})
+    string(REGEX REPLACE "^.+[.](.+)$" "\\1" MAN_SECT ${I})
+    install(FILES ${I} DESTINATION "${CMAKE_INSTALL_MANDIR}/man${MAN_SECT}/")
+  endforeach()
+endfunction()
+
+# Create an alias for a man page, using a symlink.
+# Input is a list of pairs of names (MAN_PAGE ALIAS)
+# NOTE: The section must currently be the same for both.
+function(rdma_alias_man_pages)
+  list(LENGTH ARGN LEN)
+  math(EXPR LEN ${LEN}-1)
+  foreach(I RANGE 0 ${LEN} 2)
+    list(GET ARGN ${I} FROM)
+    math(EXPR I ${I}+1)
+    list(GET ARGN ${I} TO)
+    string(REGEX REPLACE "^.+[.](.+)$" "\\1" MAN_SECT ${FROM})
+    rdma_install_symlink("${FROM}" "${CMAKE_INSTALL_MANDIR}/man${MAN_SECT}/${TO}")
+  endforeach()
+endfunction()
+
+# For compatability write out a libtool .la file. This is only meaningful if
+# the end user is statically linking, and only if the library has dependent
+# libraries.
+
+# FIXME: it isn't clear how this is actually useful for provider libraries and
+# libibverbs itself, the user must do some trick to get the constructor to run
+# in the provider, at least how to do that should be documented someplace..
+function(rdma_make_libtool_la SHARED STATIC LIBS)
+  get_property(LIB TARGET ${STATIC} PROPERTY OUTPUT_NAME SET)
+  if (LIB)
+    get_target_property(LIB ${STATIC} OUTPUT_NAME)
+  else()
+    set(LIB ${STATIC})
+  endif()
+
+  set(BARE_LAFN "${CMAKE_STATIC_LIBRARY_PREFIX}${LIB}.la")
+  set(BARE_LIBFN "${CMAKE_STATIC_LIBRARY_PREFIX}${LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+
+  get_property(SOLIB TARGET ${SHARED} PROPERTY OUTPUT_NAME SET)
+  if (SOLIB)
+    get_target_property(SOLIB ${SHARED} OUTPUT_NAME)
+  else()
+    set(SOLIB ${SHARED})
+  endif()
+
+  set(DLNAME "${CMAKE_SHARED_LIBRARY_PREFIX}${SOLIB}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+  get_property(TMP TARGET ${SHARED} PROPERTY SOVERSION SET)
+  if (TMP)
+    get_target_property(VERSION ${SHARED} VERSION)
+    get_target_property(SOVERSION ${SHARED} SOVERSION)
+    set(NAMES "${DLNAME}.${VERSION} ${DLNAME}.${SOVERSION} ${DLNAME}")
+    set(DLNAME "${DLNAME}.${SOVERSION}")
+  else()
+    set(NAMES "${DLNAME}")
+    set(DLNAME "${CMAKE_SHARED_LIBRARY_PREFIX}${SOLIB}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+  endif()
+
+  if (LIBS)
+    list(REMOVE_DUPLICATES LIBS)
+    foreach(I ${LIBS})
+      if (I MATCHES "^-l")
+	list(APPEND DEPS "${I}")
+      else()
+	list(APPEND DEPS "-l${I}")
+      endif()
+    endforeach()
+    string(REPLACE ";" " " DEPS "${DEPS}")
+  endif()
+
+  set(LAFN "${BUILD_LIB}/${BARE_LAFN}")
+  file(WRITE ${LAFN}
+    "# ${BARE_LAFN} - a libtool library file\n"
+    "# Generated by cmake\n"
+    "#\n"
+    "# Please DO NOT delete this file!\n"
+    "# It is necessary for linking the library.\n"
+    "\n"
+    "# The name that we can dlopen(3).\n"
+    "dlname='${DLNAME}'\n"
+    "\n"
+    "# Names of this library.\n"
+    "library_names='${NAMES}'\n"
+    "\n"
+    "# The name of the static archive.\n"
+    "old_library='${BARE_LIBFN}'\n"
+    "\n"
+    "# Linker flags that can not go in dependency_libs.\n"
+    "inherited_linker_flags=''\n"
+    "\n"
+    "# Libraries that this one depends upon.\n"
+    "dependency_libs='${DEPS}'\n"
+    "\n"
+    "# Names of additional weak libraries provided by this library\n"
+    "weak_library_names=''\n"
+    "\n"
+    "# Version information for ${CMAKE_STATIC_LIBRARY_PREFIX}${LIB}.\n"
+    # We don't try very hard to emulate this, it isn't used for static linking anyhow
+    "current=${SOVERSION}\n"
+    "age=0\n"
+    "revision=0\n"
+    "\n"
+    "# Is this an already installed library?\n"
+    "installed=yes\n"
+    "\n"
+    "# Should we warn about portability when linking against -modules?\n"
+    "shouldnotlink=no\n"
+    "\n"
+    "# Files to dlopen/dlpreopen\n"
+    "dlopen=''\n"
+    "dlpreopen=''\n"
+    "\n"
+    "# Directory that this library needs to be installed in:\n"
+    "libdir='${CMAKE_INSTALL_FULL_LIBDIR}'\n"
+    )
+  install(FILES ${LAFN} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+endfunction()
+
+# Finalize the setup of the static libraries by copying the meta information
+# from the shared and setting up the libtool .la files.
+function(rdma_finalize_libs)
+  list(LENGTH RDMA_STATIC_LIBS LEN)
+  math(EXPR LEN ${LEN}-1)
+  foreach(I RANGE 0 ${LEN} 2)
+    list(GET RDMA_STATIC_LIBS ${I} SHARED)
+    math(EXPR I ${I}+1)
+    list(GET RDMA_STATIC_LIBS ${I} STATIC)
+
+    # PUBLIC libraries
+    get_property(TMP TARGET ${SHARED} PROPERTY INTERFACE_LINK_LIBRARIES SET)
+    if (TMP)
+      get_target_property(TMP ${SHARED} INTERFACE_LINK_LIBRARIES)
+      set_target_properties(${STATIC} PROPERTIES INTERFACE_LINK_LIBRARIES "${TMP}")
+      set(LIBS "${TMP}")
+    endif()
+
+    # PRIVATE libraries
+    get_property(TMP TARGET ${SHARED} PROPERTY LINK_LIBRARIES SET)
+    if (TMP)
+      get_target_property(TMP ${SHARED} LINK_LIBRARIES)
+      set_target_properties(${STATIC} PROPERTIES LINK_LIBRARIES "${TMP}")
+      list(APPEND LIBS "${TMP}")
+    endif()
+
+    rdma_make_libtool_la(${SHARED} ${STATIC} "${LIBS}")
+  endforeach()
+endfunction()
diff --git a/ibacm/CMakeLists.txt b/ibacm/CMakeLists.txt
new file mode 100644
index 000000000000..8887c13af463
--- /dev/null
+++ b/ibacm/CMakeLists.txt
@@ -0,0 +1,69 @@
+publish_headers(infiniband
+  include/infiniband/acm.h
+  include/infiniband/acm_prov.h
+  )
+
+# FIXME: To config.h
+add_definitions("-DIBACM_CONFIG_PATH=\"${CMAKE_INSTALL_FULL_SYSCONFDIR}/rdma\"")
+add_definitions("-DIBACM_LIB_PATH=\"${ACM_PROVIDER_DIR}\"")
+add_definitions("-DIBACM_BIN_PATH=\"${CMAKE_INSTALL_FULL_BINDIR}\"")
+
+# FIXME: Fixup the include scheme to not require all these -Is
+include_directories("include")
+include_directories("src")
+include_directories("linux")
+
+# NOTE: ibacm exports symbols from its own binary for use by ibacm
+rdma_sbin_executable(ibacm
+  src/acm.c
+  src/acm_util.c
+  )
+target_link_libraries(ibacm
+  ibverbs
+  ibumad
+  ${CMAKE_THREAD_LIBS_INIT}
+  ${CMAKE_DL_LIBS}
+  )
+# FIXME: We should probably list the symbols we want to export..
+set_target_properties(ibacm PROPERTIES ENABLE_EXPORTS TRUE)
+
+# This is a plugin module that dynamically links to ibacm
+add_library(ibacmp MODULE
+  prov/acmp/src/acmp.c
+  )
+rdma_set_library_map(ibacmp "prov/acmp/src/libibacmp.map")
+target_link_libraries(ibacmp
+  ibacm
+  ibverbs
+  ibumad
+  ${CMAKE_THREAD_LIBS_INIT}
+  )
+set_target_properties(ibacmp PROPERTIES
+  LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
+install(TARGETS ibacmp DESTINATION "${ACM_PROVIDER_DIR}")
+
+rdma_executable(ib_acme
+  linux/libacm_linux.c
+  src/acme.c
+  src/libacm.c
+  src/parse.c
+  )
+target_link_libraries(ib_acme
+  ibverbs
+  )
+target_compile_definitions(ib_acme PRIVATE "-DACME_PRINTS")
+
+rdma_man_pages(
+  man/ib_acme.1
+  man/ibacm.1
+  man/ibacm.7
+  man/ibacm_prov.7
+  )
+
+# FIXME: update the .init.in
+set(rdmascript "openibd")
+set(prefix "${CMAKE_INSTALL_PREFIX}")
+rdma_subst_install(FILES "ibacm.init.in"
+  DESTINATION "${CMAKE_INSTALL_INITDDIR}"
+  RENAME "ibacm"
+  PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
diff --git a/iwpmd/src/CMakeLists.txt b/iwpmd/src/CMakeLists.txt
new file mode 100644
index 000000000000..5ffc21264ae2
--- /dev/null
+++ b/iwpmd/src/CMakeLists.txt
@@ -0,0 +1,12 @@
+rdma_executable(iwpmd
+  iwarp_pm_common.c
+  iwarp_pm_helper.c
+  iwarp_pm_server.c
+  )
+target_link_libraries(iwpmd
+  ${NL_LIBRARIES}
+  ${CMAKE_THREAD_LIBS_INIT}
+  )
+# FIXME iwpmd_init init.d file
+# FIXME iwpmd.service systemd file
+# FIXME iwpmd.conf
diff --git a/libcxgb3/src/CMakeLists.txt b/libcxgb3/src/CMakeLists.txt
new file mode 100644
index 000000000000..a578105e7b28
--- /dev/null
+++ b/libcxgb3/src/CMakeLists.txt
@@ -0,0 +1,6 @@
+rdma_provider(cxgb3
+  cq.c
+  iwch.c
+  qp.c
+  verbs.c
+)
diff --git a/libcxgb4/src/CMakeLists.txt b/libcxgb4/src/CMakeLists.txt
new file mode 100644
index 000000000000..a9b6546015ef
--- /dev/null
+++ b/libcxgb4/src/CMakeLists.txt
@@ -0,0 +1,8 @@
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NO_STRICT_ALIASING_FLAGS}")
+
+rdma_provider(cxgb4
+  cq.c
+  dev.c
+  qp.c
+  verbs.c
+)
diff --git a/libhfi1verbs/src/CMakeLists.txt b/libhfi1verbs/src/CMakeLists.txt
new file mode 100644
index 000000000000..702bb5e23b30
--- /dev/null
+++ b/libhfi1verbs/src/CMakeLists.txt
@@ -0,0 +1,4 @@
+rdma_provider(hfi1verbs
+  hfiverbs.c
+  verbs.c
+  )
diff --git a/libi40iw/src/CMakeLists.txt b/libi40iw/src/CMakeLists.txt
new file mode 100644
index 000000000000..d8a3a3c2c414
--- /dev/null
+++ b/libi40iw/src/CMakeLists.txt
@@ -0,0 +1,5 @@
+rdma_provider(i40iw
+  i40iw_uk.c
+  i40iw_umain.c
+  i40iw_uverbs.c
+)
diff --git a/libibcm/examples/CMakeLists.txt b/libibcm/examples/CMakeLists.txt
new file mode 100644
index 000000000000..a90639dae768
--- /dev/null
+++ b/libibcm/examples/CMakeLists.txt
@@ -0,0 +1,2 @@
+rdma_test_executable(cmpost cmpost.c)
+target_link_libraries(cmpost ibcm rdmacm)
diff --git a/libibcm/src/CMakeLists.txt b/libibcm/src/CMakeLists.txt
new file mode 100644
index 000000000000..01f85c0ea638
--- /dev/null
+++ b/libibcm/src/CMakeLists.txt
@@ -0,0 +1,9 @@
+publish_headers(infiniband
+  ../include/infiniband/cm.h
+  ../include/infiniband/cm_abi.h
+  )
+
+rdma_library(ibcm libibcm.map 1 1.0.0
+  cm.c
+  )
+target_link_libraries(ibcm PUBLIC ibverbs)
diff --git a/libibumad/man/CMakeLists.txt b/libibumad/man/CMakeLists.txt
new file mode 100644
index 000000000000..b7a191261ec0
--- /dev/null
+++ b/libibumad/man/CMakeLists.txt
@@ -0,0 +1,42 @@
+rdma_man_pages(
+  umad_addr_dump.3
+  umad_alloc.3
+  umad_attribute_str.3
+  umad_class_str.3
+  umad_close_port.3
+  umad_debug.3
+  umad_dump.3
+  umad_free.3
+  umad_get_ca.3
+  umad_get_ca_portguids.3
+  umad_get_cas_names.3
+  umad_get_fd.3
+  umad_get_issm_path.3
+  umad_get_mad.3
+  umad_get_mad_addr.3
+  umad_get_pkey.3
+  umad_get_port.3
+  umad_init.3
+  umad_mad_status_str.3
+  umad_method_str.3
+  umad_open_port.3
+  umad_poll.3
+  umad_recv.3
+  umad_register.3
+  umad_register2.3
+  umad_register_oui.3
+  umad_send.3
+  umad_set_addr.3
+  umad_set_addr_net.3
+  umad_set_grh.3
+  umad_set_grh_net.3
+  umad_set_pkey.3
+  umad_size.3
+  umad_status.3
+  umad_unregister.3
+  )
+rdma_alias_man_pages(
+  umad_get_ca.3 umad_release_ca.3
+  umad_get_port.3 umad_release_port.3
+  umad_init.3 umad_done.3
+  )
\ No newline at end of file
diff --git a/libibumad/src/CMakeLists.txt b/libibumad/src/CMakeLists.txt
new file mode 100644
index 000000000000..b7b5d03bc53e
--- /dev/null
+++ b/libibumad/src/CMakeLists.txt
@@ -0,0 +1,14 @@
+publish_headers(infiniband
+  ../include/infiniband/umad.h
+  ../include/infiniband/umad_cm.h
+  ../include/infiniband/umad_sa.h
+  ../include/infiniband/umad_sm.h
+  ../include/infiniband/umad_str.h
+  ../include/infiniband/umad_types.h
+  )
+
+rdma_library(ibumad libibumad.map 3 3.1.0
+  sysfs.c
+  umad.c
+  umad_str.c
+  )
diff --git a/libibumad/tests/CMakeLists.txt b/libibumad/tests/CMakeLists.txt
new file mode 100644
index 000000000000..9676029c8688
--- /dev/null
+++ b/libibumad/tests/CMakeLists.txt
@@ -0,0 +1,5 @@
+rdma_test_executable(umad_reg2 umad_reg2_compat.c)
+target_link_libraries(umad_reg2 ibumad)
+
+rdma_test_executable(umad_register2 umad_register2.c)
+target_link_libraries(umad_register2 ibumad)
diff --git a/libibverbs/examples/CMakeLists.txt b/libibverbs/examples/CMakeLists.txt
new file mode 100644
index 000000000000..e9ac533a4a2b
--- /dev/null
+++ b/libibverbs/examples/CMakeLists.txt
@@ -0,0 +1,31 @@
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NO_STRICT_ALIASING_FLAGS}")
+
+# Shared example files
+add_library(ibverbs_tools STATIC
+  pingpong.c
+  )
+
+rdma_executable(ibv_asyncwatch asyncwatch.c)
+target_link_libraries(ibv_asyncwatch ibverbs)
+
+rdma_executable(ibv_devices device_list.c)
+target_link_libraries(ibv_devices ibverbs)
+
+rdma_executable(ibv_devinfo devinfo.c)
+target_link_libraries(ibv_devinfo ibverbs)
+
+# FIXME: pingpong.o should be a object library
+rdma_executable(ibv_rc_pingpong rc_pingpong.c)
+target_link_libraries(ibv_rc_pingpong ibverbs ibverbs_tools)
+
+rdma_executable(ibv_srq_pingpong srq_pingpong.c)
+target_link_libraries(ibv_srq_pingpong ibverbs ibverbs_tools)
+
+rdma_executable(ibv_uc_pingpong uc_pingpong.c)
+target_link_libraries(ibv_uc_pingpong ibverbs ibverbs_tools)
+
+rdma_executable(ibv_ud_pingpong ud_pingpong.c)
+target_link_libraries(ibv_ud_pingpong ibverbs ibverbs_tools)
+
+rdma_executable(ibv_xsrq_pingpong xsrq_pingpong.c)
+target_link_libraries(ibv_xsrq_pingpong ibverbs ibverbs_tools)
diff --git a/libibverbs/man/CMakeLists.txt b/libibverbs/man/CMakeLists.txt
new file mode 100644
index 000000000000..05313e5b99e9
--- /dev/null
+++ b/libibverbs/man/CMakeLists.txt
@@ -0,0 +1,83 @@
+rdma_man_pages(
+  ibv_alloc_mw.3
+  ibv_alloc_pd.3
+  ibv_asyncwatch.1
+  ibv_attach_mcast.3
+  ibv_bind_mw.3
+  ibv_create_ah.3
+  ibv_create_ah_from_wc.3
+  ibv_create_comp_channel.3
+  ibv_create_cq.3
+  ibv_create_cq_ex.3
+  ibv_create_flow.3
+  ibv_create_qp.3
+  ibv_create_qp_ex.3
+  ibv_create_rwq_ind_table.3
+  ibv_create_srq.3
+  ibv_create_srq_ex.3
+  ibv_create_wq.3
+  ibv_devices.1
+  ibv_devinfo.1
+  ibv_event_type_str.3
+  ibv_fork_init.3
+  ibv_get_async_event.3
+  ibv_get_cq_event.3
+  ibv_get_device_guid.3
+  ibv_get_device_list.3
+  ibv_get_device_name.3
+  ibv_get_srq_num.3
+  ibv_inc_rkey.3
+  ibv_modify_qp.3
+  ibv_modify_srq.3
+  ibv_modify_wq.3
+  ibv_open_device.3
+  ibv_open_qp.3
+  ibv_open_xrcd.3
+  ibv_poll_cq.3
+  ibv_post_recv.3
+  ibv_post_send.3
+  ibv_post_srq_recv.3
+  ibv_query_device.3
+  ibv_query_device_ex.3
+  ibv_query_gid.3
+  ibv_query_pkey.3
+  ibv_query_port.3
+  ibv_query_qp.3
+  ibv_query_rt_values_ex.3
+  ibv_query_srq.3
+  ibv_rate_to_mbps.3
+  ibv_rate_to_mult.3
+  ibv_rc_pingpong.1
+  ibv_reg_mr.3
+  ibv_req_notify_cq.3
+  ibv_rereg_mr.3
+  ibv_resize_cq.3
+  ibv_srq_pingpong.1
+  ibv_uc_pingpong.1
+  ibv_ud_pingpong.1
+  ibv_xsrq_pingpong.1
+  )
+rdma_alias_man_pages(
+  ibv_alloc_mw.3 ibv_dealloc_mw.3
+  ibv_alloc_pd.3 ibv_dealloc_pd.3
+  ibv_attach_mcast.3 ibv_detach_mcast.3
+  ibv_create_ah.3 ibv_destroy_ah.3
+  ibv_create_ah_from_wc.3 ibv_init_ah_from_wc.3
+  ibv_create_comp_channel.3 ibv_destroy_comp_channel.3
+  ibv_create_cq.3 ibv_destroy_cq.3
+  ibv_create_flow.3 ibv_destroy_flow.3
+  ibv_create_qp.3 ibv_destroy_qp.3
+  ibv_create_rwq_ind_table.3 ibv_destroy_rwq_ind_table.3
+  ibv_create_srq.3 ibv_destroy_srq.3
+  ibv_create_wq.3 ibv_destroy_wq.3
+  ibv_event_type_str.3 ibv_node_type_str.3
+  ibv_event_type_str.3 ibv_port_state_str.3
+  ibv_get_async_event.3 ibv_ack_async_event.3
+  ibv_get_cq_event.3 ibv_ack_cq_events.3
+  ibv_get_device_list.3 ibv_free_device_list.3
+  ibv_open_device.3 ibv_close_device.3
+  ibv_open_xrcd.3 ibv_close_xrcd.3
+  ibv_rate_to_mbps.3 mbps_to_ibv_rate.3
+  ibv_rate_to_mult.3 mult_to_ibv_rate.3
+  ibv_reg_mr.3 ibv_dereg_mr.3
+  )
\ No newline at end of file
diff --git a/libibverbs/src/CMakeLists.txt b/libibverbs/src/CMakeLists.txt
new file mode 100644
index 000000000000..2683f3538300
--- /dev/null
+++ b/libibverbs/src/CMakeLists.txt
@@ -0,0 +1,36 @@
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NO_STRICT_ALIASING_FLAGS}")
+
+publish_headers(infiniband
+  ../include/infiniband/arch.h
+  ../include/infiniband/driver.h
+  ../include/infiniband/kern-abi.h
+  ../include/infiniband/marshall.h
+  ../include/infiniband/opcode.h
+  ../include/infiniband/sa-kern-abi.h
+  ../include/infiniband/sa.h
+  ../include/infiniband/verbs.h
+  )
+
+if (NOT NL_KIND EQUAL 0)
+  set(NEIGH "neigh.c")
+else()
+  set(NEIGH "")
+endif()
+
+rdma_library(ibverbs libibverbs.map 1 1.0.0
+  cmd.c
+  compat-1_0.c
+  device.c
+  enum_strs.c
+  init.c
+  marshall.c
+  memory.c
+  ${NEIGH}
+  sysfs.c
+  verbs.c
+  )
+target_link_libraries(ibverbs PRIVATE
+  ${NL_LIBRARIES}
+  ${CMAKE_THREAD_LIBS_INIT}
+  ${CMAKE_DL_LIBS}
+  )
diff --git a/libipathverbs/CMakeLists.txt b/libipathverbs/CMakeLists.txt
new file mode 100644
index 000000000000..359438ef0e49
--- /dev/null
+++ b/libipathverbs/CMakeLists.txt
@@ -0,0 +1,4 @@
+install(FILES truescale.conf DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/")
+install(FILES truescale-serdes.cmds
+  DESTINATION "${CMAKE_INSTALL_SBINDIR}"
+  PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
diff --git a/libipathverbs/src/CMakeLists.txt b/libipathverbs/src/CMakeLists.txt
new file mode 100644
index 000000000000..20924fda7900
--- /dev/null
+++ b/libipathverbs/src/CMakeLists.txt
@@ -0,0 +1,4 @@
+rdma_provider(ipathverbs
+  ipathverbs.c
+  verbs.c
+  )
diff --git a/libmlx4/src/CMakeLists.txt b/libmlx4/src/CMakeLists.txt
new file mode 100644
index 000000000000..d64d817479bf
--- /dev/null
+++ b/libmlx4/src/CMakeLists.txt
@@ -0,0 +1,9 @@
+rdma_provider(mlx4
+  buf.c
+  cq.c
+  dbrec.c
+  mlx4.c
+  qp.c
+  srq.c
+  verbs.c
+)
diff --git a/libmlx5/src/CMakeLists.txt b/libmlx5/src/CMakeLists.txt
new file mode 100644
index 000000000000..a34a8063eeb2
--- /dev/null
+++ b/libmlx5/src/CMakeLists.txt
@@ -0,0 +1,9 @@
+rdma_provider(mlx5
+  buf.c
+  cq.c
+  dbrec.c
+  mlx5.c
+  qp.c
+  srq.c
+  verbs.c
+)
diff --git a/libmthca/src/CMakeLists.txt b/libmthca/src/CMakeLists.txt
new file mode 100644
index 000000000000..63d714704144
--- /dev/null
+++ b/libmthca/src/CMakeLists.txt
@@ -0,0 +1,10 @@
+rdma_provider(mthca
+  ah.c
+  buf.c
+  cq.c
+  memfree.c
+  mthca.c
+  qp.c
+  srq.c
+  verbs.c
+)
diff --git a/libnes/src/CMakeLists.txt b/libnes/src/CMakeLists.txt
new file mode 100644
index 000000000000..0c7fa8fad09f
--- /dev/null
+++ b/libnes/src/CMakeLists.txt
@@ -0,0 +1,4 @@
+rdma_provider(nes
+  nes_umain.c
+  nes_uverbs.c
+)
diff --git a/libocrdma/src/CMakeLists.txt b/libocrdma/src/CMakeLists.txt
new file mode 100644
index 000000000000..08623adb4a6f
--- /dev/null
+++ b/libocrdma/src/CMakeLists.txt
@@ -0,0 +1,4 @@
+rdma_provider(ocrdma
+  ocrdma_main.c
+  ocrdma_verbs.c
+  )
diff --git a/librdmacm/examples/CMakeLists.txt b/librdmacm/examples/CMakeLists.txt
new file mode 100644
index 000000000000..31c9606383a0
--- /dev/null
+++ b/librdmacm/examples/CMakeLists.txt
@@ -0,0 +1,43 @@
+# Shared example files
+add_library(rdmacm_tools STATIC
+  common.c
+  )
+
+rdma_executable(cmtime cmtime.c)
+target_link_libraries(cmtime rdmacm ${CMAKE_THREAD_LIBS_INIT} rdmacm_tools)
+
+rdma_executable(mckey mckey.c)
+target_link_libraries(mckey rdmacm ${CMAKE_THREAD_LIBS_INIT})
+
+rdma_executable(rcopy rcopy.c)
+target_link_libraries(rcopy rdmacm)
+
+rdma_executable(rdma_client rdma_client.c)
+target_link_libraries(rdma_client rdmacm)
+
+rdma_executable(rdma_server rdma_server.c)
+target_link_libraries(rdma_server rdmacm)
+
+rdma_executable(rdma_xclient rdma_xclient.c)
+target_link_libraries(rdma_xclient rdmacm)
+
+rdma_executable(rdma_xserver rdma_xserver.c)
+target_link_libraries(rdma_xserver rdmacm)
+
+rdma_executable(riostream riostream.c)
+target_link_libraries(riostream rdmacm rdmacm_tools)
+
+rdma_executable(rping rping.c)
+target_link_libraries(rping rdmacm ${CMAKE_THREAD_LIBS_INIT})
+
+rdma_executable(rstream rstream.c)
+target_link_libraries(rstream rdmacm rdmacm_tools)
+
+rdma_executable(ucmatose cmatose.c)
+target_link_libraries(ucmatose rdmacm rdmacm_tools)
+
+rdma_executable(udaddy udaddy.c)
+target_link_libraries(udaddy rdmacm rdmacm_tools)
+
+rdma_executable(udpong udpong.c)
+target_link_libraries(udpong rdmacm rdmacm_tools)
diff --git a/librdmacm/man/CMakeLists.txt b/librdmacm/man/CMakeLists.txt
new file mode 100644
index 000000000000..791c98265ad0
--- /dev/null
+++ b/librdmacm/man/CMakeLists.txt
@@ -0,0 +1,65 @@
+rdma_man_pages(
+  mckey.1
+  rcopy.1
+  rdma_accept.3
+  rdma_ack_cm_event.3
+  rdma_bind_addr.3
+  rdma_client.1
+  rdma_cm.7
+  rdma_connect.3
+  rdma_create_ep.3
+  rdma_create_event_channel.3
+  rdma_create_id.3
+  rdma_create_qp.3
+  rdma_create_srq.3
+  rdma_dereg_mr.3
+  rdma_destroy_ep.3
+  rdma_destroy_event_channel.3
+  rdma_destroy_id.3
+  rdma_destroy_qp.3
+  rdma_destroy_srq.3
+  rdma_disconnect.3
+  rdma_event_str.3
+  rdma_free_devices.3
+  rdma_get_cm_event.3
+  rdma_get_devices.3
+  rdma_get_dst_port.3
+  rdma_get_local_addr.3
+  rdma_get_peer_addr.3
+  rdma_get_recv_comp.3
+  rdma_get_request.3
+  rdma_get_send_comp.3
+  rdma_get_src_port.3
+  rdma_getaddrinfo.3
+  rdma_join_multicast.3
+  rdma_leave_multicast.3
+  rdma_listen.3
+  rdma_migrate_id.3
+  rdma_notify.3
+  rdma_post_read.3
+  rdma_post_readv.3
+  rdma_post_recv.3
+  rdma_post_recvv.3
+  rdma_post_send.3
+  rdma_post_sendv.3
+  rdma_post_ud_send.3
+  rdma_post_write.3
+  rdma_post_writev.3
+  rdma_reg_msgs.3
+  rdma_reg_read.3
+  rdma_reg_write.3
+  rdma_reject.3
+  rdma_resolve_addr.3
+  rdma_resolve_route.3
+  rdma_server.1
+  rdma_set_option.3
+  rdma_xclient.1
+  rdma_xserver.1
+  riostream.1
+  rping.1
+  # FIXME: rsocket has a text substitution but nothing ever filled it in.
+  rsocket.7
+  rstream.1
+  ucmatose.1
+  udaddy.1
+  )
diff --git a/librdmacm/src/CMakeLists.txt b/librdmacm/src/CMakeLists.txt
new file mode 100644
index 000000000000..5954a345184a
--- /dev/null
+++ b/librdmacm/src/CMakeLists.txt
@@ -0,0 +1,39 @@
+publish_headers(rdma
+  ../include/rdma/rdma_cma.h
+  ../include/rdma/rdma_cma_abi.h
+  ../include/rdma/rdma_verbs.h
+  ../include/rdma/rsocket.h
+  )
+publish_headers(infiniband
+  ../include/infiniband/ib.h
+  )
+
+rdma_library(rdmacm librdmacm.map 1 1.0.0
+  acm.c
+  addrinfo.c
+  cma.c
+  indexer.c
+  rsocket.c
+  )
+target_link_libraries(rdmacm PUBLIC ibverbs)
+target_link_libraries(rdmacm PRIVATE ${CMAKE_THREAD_LIBS_INIT})
+
+# The preload library is a bit special, it needs to be open coded
+# Since it is a LD_PRELOAD it has no soname, and is installed in sub dir
+add_library(rspreload SHARED
+  preload.c
+  indexer.c
+  )
+set_target_properties(rspreload PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
+rdma_set_library_map(rspreload librspreload.map)
+target_link_libraries(rspreload PRIVATE
+  rdmacm
+  ${CMAKE_THREAD_LIBS_INIT}
+  ${CMAKE_DL_LIBS}
+)
+install(TARGETS rspreload DESTINATION "${CMAKE_INSTALL_LIBDIR}/rsocket/")
+
+# These are for compat with old packaging, these name should not be used.
+# FIXME: Maybe we can get rid of them?
+rdma_install_symlink("librspreload.so" "${CMAKE_INSTALL_LIBDIR}/rsocket/librspreload.so.1")
+rdma_install_symlink("librspreload.so" "${CMAKE_INSTALL_LIBDIR}/rsocket/librspreload.so.1.0.0")
diff --git a/librxe/CMakeLists.txt b/librxe/CMakeLists.txt
new file mode 100644
index 000000000000..3652ab3d56a5
--- /dev/null
+++ b/librxe/CMakeLists.txt
@@ -0,0 +1,4 @@
+install(FILES rxe_cfg
+  DESTINATION "${CMAKE_INSTALL_BINDIR}"
+  PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
+  )
diff --git a/librxe/man/CMakeLists.txt b/librxe/man/CMakeLists.txt
new file mode 100644
index 000000000000..69e8bd8cf20c
--- /dev/null
+++ b/librxe/man/CMakeLists.txt
@@ -0,0 +1,4 @@
+rdma_man_pages(
+  rxe.7
+  rxe_cfg.8
+)
diff --git a/librxe/src/CMakeLists.txt b/librxe/src/CMakeLists.txt
new file mode 100644
index 000000000000..d8f3265176e4
--- /dev/null
+++ b/librxe/src/CMakeLists.txt
@@ -0,0 +1,3 @@
+rdma_provider(rxe
+  rxe.c
+  )
diff --git a/srp_daemon/man/CMakeLists.txt b/srp_daemon/man/CMakeLists.txt
new file mode 100644
index 000000000000..f05de60b97aa
--- /dev/null
+++ b/srp_daemon/man/CMakeLists.txt
@@ -0,0 +1,4 @@
+rdma_man_pages(
+  ibsrpdm.1
+  srp_daemon.1
+  )
diff --git a/srp_daemon/srp_daemon/CMakeLists.txt b/srp_daemon/srp_daemon/CMakeLists.txt
new file mode 100644
index 000000000000..79feaec16889
--- /dev/null
+++ b/srp_daemon/srp_daemon/CMakeLists.txt
@@ -0,0 +1,32 @@
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NO_STRICT_ALIASING_FLAGS}")
+
+rdma_sbin_executable(srp_daemon
+  srp_daemon.c
+  srp_handle_traps.c
+  srp_sync.c
+  )
+target_link_libraries(srp_daemon
+  ibverbs
+  ibumad
+  ${RT_LIBRARIES}
+  ${CMAKE_THREAD_LIBS_INIT}
+  )
+
+rdma_install_symlink(srp_daemon "${CMAKE_INSTALL_SBINDIR}/ibsrpdm")
+# FIXME: Why?
+rdma_install_symlink(srp_daemon "${CMAKE_INSTALL_SBINDIR}/run_srp_daemon")
+install(FILES srp_daemon.sh DESTINATION "${CMAKE_INSTALL_SBINDIR}")
+
+install(FILES logrotate-srp_daemon DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/logrotate.d" RENAME "srp_daemon")
+install(FILES rsyslog-srp_daemon.conf DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/rsyslog.d" RENAME "srp_daemon.conf")
+install(FILES srp_daemon.conf DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}")
+
+# FIXME: The ib init.d file should really be included in rdma-plumbing as well.
+set(RDMA_SERVICE "openibd" CACHE STRING "init.d file service name to order srpd after")
+# NOTE: These defaults are for CentOS, packagers should override.
+set(DEFAULT_START "2 3 4 5" CACHE STRING "Default-Start service data for srpd")
+set(DEFAULT_STOP "0 1 6" CACHE STRING "Default-Stop service data for srpd")
+configure_file(srpd.in "${CMAKE_CURRENT_BINARY_DIR}/srpd")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/srpd"
+  DESTINATION "${CMAKE_INSTALL_INITDDIR}"
+  PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH 09/16] Support obsolete cmake from 2013
From: Jason Gunthorpe @ 2016-09-20 22:10 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474409425-15769-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

cmake 2.8.12 is also from 2013, however .12 is broadly compatible with
versions up 3.6. However, there were significant changes between .11 and .12,
such that .11 doesn't trivially work.

For some reason Centos 7 only includes 2.8.11 (Centos 6 includes .12). Even
though cmake 3.5.x is available from EPEL, make it easy for everyone and patch
in .11 support, this can be reverted someday.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 CMakeLists.txt                | 2 +-
 buildlib/RDMA_DoFixup.cmake   | 6 +++++-
 buildlib/rdma_functions.cmake | 5 +++--
 libibcm/src/CMakeLists.txt    | 2 +-
 libibverbs/src/CMakeLists.txt | 2 +-
 librdmacm/src/CMakeLists.txt  | 6 +++---
 6 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 50ae527419a1..b8875b4853c0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@
 #      Do not link to libnl and do not resolve neighbours internally for Ethernet,
 #      and do not build iwpmd.
 
-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
 project(RDMA C)
 
 # CMake likes to use -rdynamic too much, they fixed it in 3.4.
diff --git a/buildlib/RDMA_DoFixup.cmake b/buildlib/RDMA_DoFixup.cmake
index 3ffd50aa1de4..75704ddcfe9f 100644
--- a/buildlib/RDMA_DoFixup.cmake
+++ b/buildlib/RDMA_DoFixup.cmake
@@ -11,7 +11,11 @@
 function(RDMA_DoFixup not_needed header)
   set(DEST "${BUILD_INCLUDE}/${header}")
   if (NOT "${not_needed}")
-    get_filename_component(DIR ${DEST} DIRECTORY)
+    if(CMAKE_VERSION VERSION_LESS "2.8.12")
+      get_filename_component(DIR ${DEST} PATH)
+    else()
+      get_filename_component(DIR ${DEST} DIRECTORY)
+    endif()
     file(MAKE_DIRECTORY "${DIR}")
     string(REPLACE / - header-bl ${header})
     execute_process(COMMAND "ln" "-Tsf" "${BUILDLIB}/fixup-include/${header-bl}" "${DEST}")
diff --git a/buildlib/rdma_functions.cmake b/buildlib/rdma_functions.cmake
index d82ed4757bb7..ea53f382553f 100644
--- a/buildlib/rdma_functions.cmake
+++ b/buildlib/rdma_functions.cmake
@@ -98,8 +98,8 @@ function(rdma_provider DEST)
   # Even though these are modules we still want to use Wl,--no-undefined
   set_target_properties(${DEST} PROPERTIES LINK_FLAGS ${CMAKE_SHARED_LINKER_FLAGS})
   rdma_set_library_map(${DEST} ${BUILDLIB}/provider.map)
-  target_link_libraries(${DEST} PRIVATE ibverbs)
-  target_link_libraries(${DEST} PRIVATE ${CMAKE_THREAD_LIBS_INIT})
+  target_link_libraries(${DEST} LINK_PRIVATE ibverbs)
+  target_link_libraries(${DEST} LINK_PRIVATE ${CMAKE_THREAD_LIBS_INIT})
   set_target_properties(${DEST} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
   # Provider Plugins do not use SONAME versioning, there is no reason to
   # create the usual symlinks.
@@ -259,6 +259,7 @@ function(rdma_finalize_libs)
     list(GET RDMA_STATIC_LIBS ${I} STATIC)
 
     # PUBLIC libraries
+    set(LIBS "")
     get_property(TMP TARGET ${SHARED} PROPERTY INTERFACE_LINK_LIBRARIES SET)
     if (TMP)
       get_target_property(TMP ${SHARED} INTERFACE_LINK_LIBRARIES)
diff --git a/libibcm/src/CMakeLists.txt b/libibcm/src/CMakeLists.txt
index 01f85c0ea638..2479886c6238 100644
--- a/libibcm/src/CMakeLists.txt
+++ b/libibcm/src/CMakeLists.txt
@@ -6,4 +6,4 @@ publish_headers(infiniband
 rdma_library(ibcm libibcm.map 1 1.0.0
   cm.c
   )
-target_link_libraries(ibcm PUBLIC ibverbs)
+target_link_libraries(ibcm LINK_PUBLIC ibverbs)
diff --git a/libibverbs/src/CMakeLists.txt b/libibverbs/src/CMakeLists.txt
index 2683f3538300..e1a54345c537 100644
--- a/libibverbs/src/CMakeLists.txt
+++ b/libibverbs/src/CMakeLists.txt
@@ -29,7 +29,7 @@ rdma_library(ibverbs libibverbs.map 1 1.0.0
   sysfs.c
   verbs.c
   )
-target_link_libraries(ibverbs PRIVATE
+target_link_libraries(ibverbs LINK_PRIVATE
   ${NL_LIBRARIES}
   ${CMAKE_THREAD_LIBS_INIT}
   ${CMAKE_DL_LIBS}
diff --git a/librdmacm/src/CMakeLists.txt b/librdmacm/src/CMakeLists.txt
index 5954a345184a..5324f625616d 100644
--- a/librdmacm/src/CMakeLists.txt
+++ b/librdmacm/src/CMakeLists.txt
@@ -15,8 +15,8 @@ rdma_library(rdmacm librdmacm.map 1 1.0.0
   indexer.c
   rsocket.c
   )
-target_link_libraries(rdmacm PUBLIC ibverbs)
-target_link_libraries(rdmacm PRIVATE ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(rdmacm LINK_PUBLIC ibverbs)
+target_link_libraries(rdmacm LINK_PRIVATE ${CMAKE_THREAD_LIBS_INIT})
 
 # The preload library is a bit special, it needs to be open coded
 # Since it is a LD_PRELOAD it has no soname, and is installed in sub dir
@@ -26,7 +26,7 @@ add_library(rspreload SHARED
   )
 set_target_properties(rspreload PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${BUILD_LIB}")
 rdma_set_library_map(rspreload librspreload.map)
-target_link_libraries(rspreload PRIVATE
+target_link_libraries(rspreload LINK_PRIVATE
   rdmacm
   ${CMAKE_THREAD_LIBS_INIT}
   ${CMAKE_DL_LIBS}
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox