* [PATCH v5 02/16] IB/pvrdma: Add user-level shared functions
From: Adit Ranadive @ 2016-09-24 23:21 UTC (permalink / raw)
To: dledford, linux-rdma, pv-drivers
Cc: Adit Ranadive, netdev, linux-pci, jhansen, asarwade, georgezhang,
bryantan
In-Reply-To: <cover.1474759181.git.aditr@vmware.com>
We share some common structures with the user-level driver. This patch adds
those structures and shared functions to traverse the QP/CQ rings.
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
Reviewed-by: George Zhang <georgezhang@vmware.com>
Reviewed-by: Aditya Sarwade <asarwade@vmware.com>
Reviewed-by: Bryan Tan <bryantan@vmware.com>
Signed-off-by: Adit Ranadive <aditr@vmware.com>
---
Changes v4->v5:
- Moved pvrdma_uapi.h and pvrdma_user.h into common UAPI folder.
- Renamed to pvrdma-uapi.h and pvrdma-abi.h respectively.
- Prefixed unsigned vars with __.
Changes v3->v4:
- Moved pvrdma_sge into pvrdma_uapi.h
---
include/uapi/rdma/Kbuild | 2 +
include/uapi/rdma/pvrdma-abi.h | 99 ++++++++++++++++
include/uapi/rdma/pvrdma-uapi.h | 255 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 356 insertions(+)
create mode 100644 include/uapi/rdma/pvrdma-abi.h
create mode 100644 include/uapi/rdma/pvrdma-uapi.h
diff --git a/include/uapi/rdma/Kbuild b/include/uapi/rdma/Kbuild
index 4edb0f2..fc2b285 100644
--- a/include/uapi/rdma/Kbuild
+++ b/include/uapi/rdma/Kbuild
@@ -7,3 +7,5 @@ header-y += rdma_netlink.h
header-y += rdma_user_cm.h
header-y += hfi/
header-y += rdma_user_rxe.h
+header-y += pvrdma-abi.h
+header-y += pvrdma-uapi.h
diff --git a/include/uapi/rdma/pvrdma-abi.h b/include/uapi/rdma/pvrdma-abi.h
new file mode 100644
index 0000000..6fa0ab6
--- /dev/null
+++ b/include/uapi/rdma/pvrdma-abi.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2012-2016 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER the GNU General Public License
+ * version 2 as published by the Free Software Foundation or the BSD
+ * 2-Clause License. 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 version 2 for more details at
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program available in the file COPYING in the main
+ * directory of this source tree.
+ *
+ * The BSD 2-Clause 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 HOLDER 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.
+ */
+
+#ifndef __PVRDMA_USER_H__
+#define __PVRDMA_USER_H__
+
+#include <linux/types.h>
+
+#define PVRDMA_UVERBS_ABI_VERSION 3
+#define PVRDMA_BOARD_ID 1
+#define PVRDMA_REV_ID 1
+
+struct pvrdma_alloc_ucontext_resp {
+ __u32 qp_tab_size;
+ __u32 reserved;
+};
+
+struct pvrdma_alloc_pd_resp {
+ __u32 pdn;
+ __u32 reserved;
+};
+
+struct pvrdma_create_cq {
+ __u64 buf_addr;
+ __u32 buf_size;
+ __u32 reserved;
+};
+
+struct pvrdma_create_cq_resp {
+ __u32 cqn;
+ __u32 reserved;
+};
+
+struct pvrdma_resize_cq {
+ __u64 buf_addr;
+ __u32 buf_size;
+ __u32 reserved;
+};
+
+struct pvrdma_create_srq {
+ __u64 buf_addr;
+};
+
+struct pvrdma_create_srq_resp {
+ __u32 srqn;
+ __u32 reserved;
+};
+
+struct pvrdma_create_qp {
+ __u64 rbuf_addr;
+ __u64 sbuf_addr;
+ __u32 rbuf_size;
+ __u32 sbuf_size;
+ __u64 qp_addr;
+};
+
+#endif /* __PVRDMA_USER_H__ */
diff --git a/include/uapi/rdma/pvrdma-uapi.h b/include/uapi/rdma/pvrdma-uapi.h
new file mode 100644
index 0000000..430d8a5
--- /dev/null
+++ b/include/uapi/rdma/pvrdma-uapi.h
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) 2012-2016 VMware, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER the GNU General Public License
+ * version 2 as published by the Free Software Foundation or the BSD
+ * 2-Clause License. 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 version 2 for more details at
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program available in the file COPYING in the main
+ * directory of this source tree.
+ *
+ * The BSD 2-Clause 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 HOLDER 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.
+ */
+
+#ifndef __PVRDMA_UAPI_H__
+#define __PVRDMA_UAPI_H__
+
+#include <linux/types.h>
+
+#define PVRDMA_VERSION 17
+
+#define PVRDMA_UAR_HANDLE_MASK 0x00FFFFFF /* Bottom 24 bits. */
+#define PVRDMA_UAR_QP_OFFSET 0 /* Offset of QP doorbell. */
+#define PVRDMA_UAR_QP_SEND BIT(30) /* Send bit. */
+#define PVRDMA_UAR_QP_RECV BIT(31) /* Recv bit. */
+#define PVRDMA_UAR_CQ_OFFSET 4 /* Offset of CQ doorbell. */
+#define PVRDMA_UAR_CQ_ARM_SOL BIT(29) /* Arm solicited bit. */
+#define PVRDMA_UAR_CQ_ARM BIT(30) /* Arm bit. */
+#define PVRDMA_UAR_CQ_POLL BIT(31) /* Poll bit. */
+#define PVRDMA_INVALID_IDX -1 /* Invalid index. */
+
+/* PVRDMA atomic compare and swap */
+struct pvrdma_exp_cmp_swap {
+ __u64 swap_val;
+ __u64 compare_val;
+ __u64 swap_mask;
+ __u64 compare_mask;
+};
+
+/* PVRDMA atomic fetch and add */
+struct pvrdma_exp_fetch_add {
+ __u64 add_val;
+ __u64 field_boundary;
+};
+
+/* PVRDMA address vector. */
+struct pvrdma_av {
+ __u32 port_pd;
+ __u32 sl_tclass_flowlabel;
+ __u8 dgid[16];
+ __u8 src_path_bits;
+ __u8 gid_index;
+ __u8 stat_rate;
+ __u8 hop_limit;
+ __u8 dmac[6];
+ __u8 reserved[6];
+};
+
+/* PVRDMA scatter/gather entry */
+struct pvrdma_sge {
+ __u64 addr;
+ __u32 length;
+ __u32 lkey;
+};
+
+/* PVRDMA receive queue work request */
+struct pvrdma_rq_wqe_hdr {
+ __u64 wr_id; /* wr id */
+ __u32 num_sge; /* size of s/g array */
+ __u32 total_len; /* reserved */
+};
+/* Use pvrdma_sge (ib_sge) for receive queue s/g array elements. */
+
+/* PVRDMA send queue work request */
+struct pvrdma_sq_wqe_hdr {
+ __u64 wr_id; /* wr id */
+ __u32 num_sge; /* size of s/g array */
+ __u32 total_len; /* reserved */
+ __u32 opcode; /* operation type */
+ __u32 send_flags; /* wr flags */
+ union {
+ __u32 imm_data;
+ __u32 invalidate_rkey;
+ } ex;
+ __u32 reserved;
+ union {
+ struct {
+ __u64 remote_addr;
+ __u32 rkey;
+ __u8 reserved[4];
+ } rdma;
+ struct {
+ __u64 remote_addr;
+ __u64 compare_add;
+ __u64 swap;
+ __u32 rkey;
+ __u32 reserved;
+ } atomic;
+ struct {
+ __u64 remote_addr;
+ __u32 log_arg_sz;
+ __u32 rkey;
+ union {
+ struct pvrdma_exp_cmp_swap cmp_swap;
+ struct pvrdma_exp_fetch_add fetch_add;
+ } wr_data;
+ } masked_atomics;
+ struct {
+ __u64 iova_start;
+ __u64 pl_pdir_dma;
+ __u32 page_shift;
+ __u32 page_list_len;
+ __u32 length;
+ __u32 access_flags;
+ __u32 rkey;
+ } fast_reg;
+ struct {
+ __u32 remote_qpn;
+ __u32 remote_qkey;
+ struct pvrdma_av av;
+ } ud;
+ } wr;
+};
+/* Use pvrdma_sge (ib_sge) for send queue s/g array elements. */
+
+/* Completion queue element. */
+struct pvrdma_cqe {
+ __u64 wr_id;
+ __u64 qp;
+ __u32 opcode;
+ __u32 status;
+ __u32 byte_len;
+ __u32 imm_data;
+ __u32 src_qp;
+ __u32 wc_flags;
+ __u32 vendor_err;
+ __u16 pkey_index;
+ __u16 slid;
+ __u8 sl;
+ __u8 dlid_path_bits;
+ __u8 port_num;
+ __u8 smac[6];
+ __u8 reserved2[7]; /* Pad to next power of 2 (64). */
+};
+
+struct pvrdma_ring {
+ atomic_t prod_tail; /* Producer tail. */
+ atomic_t cons_head; /* Consumer head. */
+};
+
+struct pvrdma_ring_state {
+ struct pvrdma_ring tx; /* Tx ring. */
+ struct pvrdma_ring rx; /* Rx ring. */
+};
+
+static inline int pvrdma_idx_valid(__u32 idx, __u32 max_elems)
+{
+ /* Generates fewer instructions than a less-than. */
+ return (idx & ~((max_elems << 1) - 1)) == 0;
+}
+
+static inline __s32 pvrdma_idx(atomic_t *var, __u32 max_elems)
+{
+ const unsigned int idx = atomic_read(var);
+
+ if (pvrdma_idx_valid(idx, max_elems))
+ return idx & (max_elems - 1);
+ return PVRDMA_INVALID_IDX;
+}
+
+static inline void pvrdma_idx_ring_inc(atomic_t *var, __u32 max_elems)
+{
+ __u32 idx = atomic_read(var) + 1; /* Increment. */
+
+ idx &= (max_elems << 1) - 1; /* Modulo size, flip gen. */
+ atomic_set(var, idx);
+}
+
+static inline __s32 pvrdma_idx_ring_has_space(const struct pvrdma_ring *r,
+ __u32 max_elems, __u32 *out_tail)
+{
+ const __u32 tail = atomic_read(&r->prod_tail);
+ const __u32 head = atomic_read(&r->cons_head);
+
+ if (pvrdma_idx_valid(tail, max_elems) &&
+ pvrdma_idx_valid(head, max_elems)) {
+ *out_tail = tail & (max_elems - 1);
+ return tail != (head ^ max_elems);
+ }
+ return PVRDMA_INVALID_IDX;
+}
+
+static inline __s32 pvrdma_idx_ring_has_data(const struct pvrdma_ring *r,
+ __u32 max_elems, __u32 *out_head)
+{
+ const __u32 tail = atomic_read(&r->prod_tail);
+ const __u32 head = atomic_read(&r->cons_head);
+
+ if (pvrdma_idx_valid(tail, max_elems) &&
+ pvrdma_idx_valid(head, max_elems)) {
+ *out_head = head & (max_elems - 1);
+ return tail != head;
+ }
+ return PVRDMA_INVALID_IDX;
+}
+
+static inline bool pvrdma_idx_ring_is_valid_idx(const struct pvrdma_ring *r,
+ __u32 max_elems, __u32 *idx)
+{
+ const __u32 tail = atomic_read(&r->prod_tail);
+ const __u32 head = atomic_read(&r->cons_head);
+
+ if (pvrdma_idx_valid(tail, max_elems) &&
+ pvrdma_idx_valid(head, max_elems) &&
+ pvrdma_idx_valid(*idx, max_elems)) {
+ if (tail > head && (*idx < tail && *idx >= head))
+ return true;
+ else if (head > tail && (*idx >= head || *idx < tail))
+ return true;
+ }
+ return false;
+}
+
+#endif /* __PVRDMA_UAPI_H__ */
--
2.7.4
^ permalink raw reply related
* [PATCH v5 01/16] vmxnet3: Move PCI Id to pci_ids.h
From: Adit Ranadive @ 2016-09-24 23:21 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
pv-drivers-pghWNbHTmq7QT0dZR+AlfA
Cc: Adit Ranadive, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-pci-u79uwXL29TY76Z2rM5mHXA, jhansen-pghWNbHTmq7QT0dZR+AlfA,
asarwade-pghWNbHTmq7QT0dZR+AlfA,
georgezhang-pghWNbHTmq7QT0dZR+AlfA,
bryantan-pghWNbHTmq7QT0dZR+AlfA
In-Reply-To: <cover.1474759181.git.aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
The VMXNet3 PCI Id will be shared with our paravirtual RDMA driver.
Moved it to the shared location in pci_ids.h.
Suggested-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Acked-by: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Reviewed-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Adit Ranadive <aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
---
drivers/net/vmxnet3/vmxnet3_int.h | 3 +--
include/linux/pci_ids.h | 1 +
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
index 74fc030..2bd6bf8 100644
--- a/drivers/net/vmxnet3/vmxnet3_int.h
+++ b/drivers/net/vmxnet3/vmxnet3_int.h
@@ -119,9 +119,8 @@ enum {
};
/*
- * PCI vendor and device IDs.
+ * Maximum devices supported.
*/
-#define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0
#define MAX_ETHERNET_CARDS 10
#define MAX_PCI_PASSTHRU_DEVICE 6
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c58752f..98bb455 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2251,6 +2251,7 @@
#define PCI_DEVICE_ID_RASTEL_2PORT 0x2000
#define PCI_VENDOR_ID_VMWARE 0x15ad
+#define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07b0
#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0
--
2.7.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 v5 00/16] Add Paravirtual RDMA Driver
From: Adit Ranadive @ 2016-09-24 23:21 UTC (permalink / raw)
To: dledford, linux-rdma, pv-drivers
Cc: Adit Ranadive, netdev, linux-pci, jhansen, asarwade, georgezhang,
bryantan
Hi Doug, others,
This patch series adds a driver for a paravirtual RDMA device. The device
is developed for VMware's Virtual Machines and allows existing RDMA
applications to continue to use existing Verbs API when deployed in VMs on
ESXi. We recently did a presentation in the OFA Workshop [1] regarding this
device.
Description and RDMA Support
============================
The virtual device is exposed as a dual function PCIe device. One part is
a virtual network device (VMXNet3) which provides networking properties
like MAC, IP addresses to the RDMA part of the device. The networking
properties are used to register GIDs required by RDMA applications to
communicate.
These patches add support and the all required infrastructure for letting
applications use such a device. We support the mandatory Verbs API as well
as the base memory management extensions (Local Inv, Send with Inv and Fast
Register Work Requests). We currently support both Reliable Connected and
Unreliable Datagram QPs but do not support Shared Receive Queues (SRQs).
Also, we support the following types of Work Requests:
o Send/Receive (with or without Immediate Data)
o RDMA Write (with or without Immediate Data)
o RDMA Read
o Local Invalidate
o Send with Invalidate
o Fast Register Work Requests
This version only adds support for version 1 of RoCE. We will add RoCEv2
support in a future patch. We do support registration of both MAC-based and
IP-based GIDs. I have also created a git tree for our user-level driver [2].
Testing
=======
We have tested this internally for various types of Guest OS - Red Hat,
Centos, Ubuntu 12.04/14.04/16.04, Oracle Enterprise Linux, SLES 12
using backported versions of this driver. The tests included several runs
of the performance tests (included with OFED), Intel MPI PingPong benchmark
on OpenMPI, krping for FRWRs. Mellanox has been kind enough to test the
backported version of the driver internally on their hardware using a
VMware provided ESX build. I have also applied and tested this with Doug's
k.o/for-4.9 branch (commit 64278fe). Note, that this patch series should be
applied all together. I split out the commits so that it may be easier to
review.
PVRDMA Resources
================
[1] OFA Workshop Presentation -
https://openfabrics.org/images/eventpresos/2016presentations/102parardma.pdf
[2] Libpvrdma User-level library -
http://git.openfabrics.org/?p=~aditr/libpvrdma.git;a=summary
---
Changes v4->v5:
- PATCH [02/16]
- Moved pvrdma_uapi.h and pvrdma_user.h into common UAPI folder.
- Renamed to pvrdma-uapi.h and pvrdma-abi.h respectively.
- Prefixed unsigned vars with __.
- PATCH [03/16]
- Removed __ prefix for unsigned vars.
- PATCH [04/16]
- Update include for headers moved to UAPI.
- Removed __ prefix for unsigned vars.
- PATCH [05/16]
- Update include for headers in UAPI folder.
- Removed setting any properties that are reported by device as 0.
- Simplified modify_port.
- PD should be allocated first in kernel then in device.
- Update to pvrdma_cmd_post for creating/destroying PD, Query port/device.
- PATCH [06/16]
- pvrdma_cmd_post takes the response code.
- PATCH [07/16]
- Correct var type passed to dma_alloc_coherent.
- PATCH [08/16]
- Moved the timeout to pvrdma_cmd_recv.
- Added additional response code parameter to pvrdma_cmd_post.
- PATCH [09/16]
- Updated include for headers in UAPI folder.
- Changed from EINVAL to ENOMEM if atomic add fails.
- Added error code if destroy cq command failed.
- Update to pvrdma_cmd_post for creating/destroying CQ.
- PATCH [11/16]
- Check the access flags correctly for DMA MR.
- Update to pvrdma_cmd_post for creating/destroying MRs.
- PATCH [12/16]
- Updated include for headers in UAPI folder.
- Update to pvrdma_cmd_post for creating/destroying/querying/modifying QPs.
- Use the pvrdma_sge struct when posting WRs/allocating QP memory.
- Removed two set but unused variables.
- PATCH [13/16]
- Removed two unnecessary lines.
- Updated include for headers in UAPI folder.
- Update to pvrdma_cmd_post for add/delete GIDs.
- Add error code in dev_warn if pvrdma_cmd_post failed.
- PATCH [16/16]
- Added pvrdma files to common UAPI folder.
Changes v3->v4:
- Rebased on for-4.9 branch - commit 64278fe89b729
("Merge branch 'hns-roce' into k.o/for-4.9")
- PATCH [01/16]
- New in v4 - Moved vmxnet3 id to pci_ids.h
- PATCH [02,03/16]
- pvrdma_sge was moved into pvrdma_uapi.h
- PATCH [04/16]
- Removed explicit enum values.
- PATCH [05/16]
- Renamed priviledged -> privileged.
- Added error numbers for command errors.
- Removed unnecessary goto in modify_device.
- Moved pd allocation to after command execution.
- Removed an incorrect atomic_dec.
- PATCH [06/16]
- Renamed priviledged -> privileged.
- Renamed pvrdma_flush_cqe to _pvrdma_flush_cqe since we hold a lock
to call it.
- Added wrapper functions for writing to UARs for CQ/QP.
- The conversion functions are updated as func_name(dst, src) format.
- Renamed max_gs to max_sg.
- Added work struct for net device events.
- PATCH [07/16]
- Updated conversion functions to func_name(dst, src) format.
- Removed unneeded local variables.
- PATCH [08/16]
- Removed the min check and added a BUILD_BUG_ON check for size.
- PATCH [09/16]
- Added a pvrdma_destroy_cq in the error path.
- Renamed pvrdma_flush_cqe to _pvrdma_flush_cqe since we need a lock to
be held while calling this.
- Updated to use wrapper for UAR write for CQ.
- Ensure that poll_cq does not return error values.
- PATCH [10/16]
- Removed an unnecessary comment.
- PATCH [11/16]
- Changed access flag check for DMA MR to using bit operation.
- Removed some local variables.
- PATCH [12/16]
- Removed an unnecessary switch case.
- Unified the returns in pvrdma_create_qp to use one exit point.
- Renamed pvrdma_flush_cqe to _pvrdma_flush_cqe since we need a lock to
be held when calling this.
- Updated to use wrapper for UAR write for QP.
- Updated conversion function to func_name(dst, src) format.
- Renamed max_gs to max_sg.
- Renamed cap variable to req_cap in pvrdma_set_sq/rq_size.
- Changed dev_warn to dev_warn_ratelimited in pvrdma_post_send/recv.
- Added nesting locking for flushing CQs when destroying/resetting a QP.
- Added missing ret value.
- PATCH [13/16]
- Fixed some checkpatch warnings.
- Added support for new get_dev_fw_str API.
- Added event workqueue for netdevice events.
- Restructured the pvrdma_pci_remove function a little bit.
- PATCH [14/16]
- Enforced dependency on VMXNet3 module.
Changes v2->v3:
- I reordered the patches so that the definitions of enums, structures is
before their use (suggested by Yuval Shaia) so its easier to review.
- Removed an unneccesary bool in pvrdma_cmd_post (suggested by Yuval Shaia).
- Made the use of comma at end of enums consistent across files (suggested
by Leon Romanovsky).
Changes v1->v2:
- Patch [07/15] - Addressed Yuval Shaia's comments and 32-bit build errors.
---
Adit Ranadive (16):
vmxnet3: Move PCI Id to pci_ids.h
IB/pvrdma: Add user-level shared functions
IB/pvrdma: Add virtual device RDMA structures
IB/pvrdma: Add the paravirtual RDMA device specification
IB/pvrdma: Add functions for Verbs support
IB/pvrdma: Add paravirtual rdma device
IB/pvrdma: Add helper functions
IB/pvrdma: Add device command support
IB/pvrdma: Add support for Completion Queues
IB/pvrdma: Add UAR support
IB/pvrdma: Add support for memory regions
IB/pvrdma: Add Queue Pair support
IB/pvrdma: Add the main driver module for PVRDMA
IB/pvrdma: Add Kconfig and Makefile
IB: Add PVRDMA driver
MAINTAINERS: Update for PVRDMA driver
MAINTAINERS | 9 +
drivers/infiniband/Kconfig | 1 +
drivers/infiniband/hw/Makefile | 1 +
drivers/infiniband/hw/pvrdma/Kconfig | 7 +
drivers/infiniband/hw/pvrdma/Makefile | 3 +
drivers/infiniband/hw/pvrdma/pvrdma.h | 473 +++++++++
drivers/infiniband/hw/pvrdma/pvrdma_cmd.c | 117 +++
drivers/infiniband/hw/pvrdma/pvrdma_cq.c | 426 +++++++++
drivers/infiniband/hw/pvrdma/pvrdma_defs.h | 301 ++++++
drivers/infiniband/hw/pvrdma/pvrdma_dev_api.h | 342 +++++++
drivers/infiniband/hw/pvrdma/pvrdma_doorbell.c | 127 +++
drivers/infiniband/hw/pvrdma/pvrdma_ib_verbs.h | 444 +++++++++
drivers/infiniband/hw/pvrdma/pvrdma_main.c | 1220 ++++++++++++++++++++++++
drivers/infiniband/hw/pvrdma/pvrdma_misc.c | 304 ++++++
drivers/infiniband/hw/pvrdma/pvrdma_mr.c | 334 +++++++
drivers/infiniband/hw/pvrdma/pvrdma_qp.c | 973 +++++++++++++++++++
drivers/infiniband/hw/pvrdma/pvrdma_verbs.c | 577 +++++++++++
drivers/infiniband/hw/pvrdma/pvrdma_verbs.h | 108 +++
drivers/net/vmxnet3/vmxnet3_int.h | 3 +-
include/linux/pci_ids.h | 1 +
include/uapi/rdma/Kbuild | 2 +
include/uapi/rdma/pvrdma-abi.h | 99 ++
include/uapi/rdma/pvrdma-uapi.h | 255 +++++
23 files changed, 6125 insertions(+), 2 deletions(-)
create mode 100644 drivers/infiniband/hw/pvrdma/Kconfig
create mode 100644 drivers/infiniband/hw/pvrdma/Makefile
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma.h
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_cmd.c
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_cq.c
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_defs.h
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_dev_api.h
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_doorbell.c
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_ib_verbs.h
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_main.c
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_misc.c
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_mr.c
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_qp.c
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_verbs.c
create mode 100644 drivers/infiniband/hw/pvrdma/pvrdma_verbs.h
create mode 100644 include/uapi/rdma/pvrdma-abi.h
create mode 100644 include/uapi/rdma/pvrdma-uapi.h
--
2.7.4
^ permalink raw reply
* Re: [PATCH 13/13] Remove ibsupport-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org from MAINTAINERS
From: Dalessandro, Dennis @ 2016-09-24 19:18 UTC (permalink / raw)
To: jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20160924165645.GA16206-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
On Sat, 2016-09-24 at 10:56 -0600, Jason Gunthorpe wrote:
> On Sat, Sep 24, 2016 at 01:43:25PM +0000, Dalessandro, Dennis wrote:
> > On Fri, 2016-09-23 at 13:17 -0600, Jason Gunthorpe wrote:
> > > Turns out this is not a mailing list.
> > >
> > > Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> > > ??MAINTAINERS | 1 -
> > > ??1 file changed, 1 deletion(-)
> > >
> > > diff --git a/MAINTAINERS b/MAINTAINERS
> > > index b39529feec9b..7a31376056e0 100644
> > > +++ b/MAINTAINERS
> > > @@ -69,7 +69,6 @@ F: ibacm/*
> > > ??IPATH/QIB USERSPACE PROVIDER (for ib_qib.ko)
> > > ??M: Mike Marciniszyn <mike.marciniszyn@intel.com>
> > > ??S: Supported
> > > -L: ibsupport@intel.com
> > > ??F: libipathverbs/
> > > ??
> > > ??IWARP PORT MAPPER DAEMON (for iwarp kernel providers)
> >
> > This is the right one to use, while you are at it you can tack my
> > name
> > onto here as well.
> >
> > https://github.com/01org/opa-libhfi1verbs/commit/377b68888a0b885fc2
> > a44ddf7a2ec33f2fcf217b
>
> intel-opa is the address you want for for QIB too? It is already in
> the
> HFI stanza
Actually on second thought, maybe better to use:
infinipath <infinipath@intel.com>
-Denny
> Jason
> --
> 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 13/13] Remove ibsupport-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org from MAINTAINERS
From: Jason Gunthorpe @ 2016-09-24 16:56 UTC (permalink / raw)
To: Dalessandro, Dennis; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1474724600.6625.1.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
On Sat, Sep 24, 2016 at 01:43:25PM +0000, Dalessandro, Dennis wrote:
> On Fri, 2016-09-23 at 13:17 -0600, Jason Gunthorpe wrote:
> > Turns out this is not a mailing list.
> >
> > Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> > ??MAINTAINERS | 1 -
> > ??1 file changed, 1 deletion(-)
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index b39529feec9b..7a31376056e0 100644
> > +++ b/MAINTAINERS
> > @@ -69,7 +69,6 @@ F: ibacm/*
> > ??IPATH/QIB USERSPACE PROVIDER (for ib_qib.ko)
> > ??M: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > ??S: Supported
> > -L: ibsupport-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
> > ??F: libipathverbs/
> > ??
> > ??IWARP PORT MAPPER DAEMON (for iwarp kernel providers)
>
> This is the right one to use, while you are at it you can tack my name
> onto here as well.
>
> https://github.com/01org/opa-libhfi1verbs/commit/377b68888a0b885fc2a44ddf7a2ec33f2fcf217b
intel-opa is the address you want for for QIB too? It is already in the
HFI stanza
Jason
--
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] rdma_rxe: Fix kernel crash when IPV6 disabled.
From: Parav Pandit @ 2016-09-24 15:24 UTC (permalink / raw)
To: monis-VPRAkNaXOzVWk0Htik3J/w, dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w, Parav Pandit
This patch fixes below kernel crash when CONFIG_IPV6 is disabled by
avoiding ip6 socket initialization.
Additionally it has below minor related cleanup around recv_sockets elements.
1. Avoid extern for structure which is locally used in file
2. Define recv_sockets as static as its used by single file
3. Follow reverse deallocation order than allocation order for
recv_sockets elements
kernel: [ 348.527616] general protection fault: 0000 [#1] SMP
kernel: [ 348.528052] Modules linked in: rdma_rxe(+) udp_tunnel ib_core binfmt_misc dm_mirror dm_region_hash dm_log dm_mod mousedev psmouse sg pcspkr evdev floppy button acpi_cpufreq ext4(E) crc16(E) jbd2(E) mbcache(E) sd_mod(E) ata_piix(E) libata(E) scsi_mod(E)
kernel: [ 348.528052] CPU: 0 PID: 2561 Comm: modprobe Tainted: G E 4.8.0-rc6+ #8
kernel: [ 348.528052] task: ffff880037af1d80 task.stack: ffff88003df50000
kernel: [ 348.528052] RIP: 0010:[<ffffffffa03212bd>] [<ffffffffa03212bd>] setup_udp_tunnel_sock+0xd/0x70 [udp_tunnel]
kernel: [ 348.528052] RSP: 0018:ffff88003df53c38 EFLAGS: 00010202
kernel: [ 348.528052] RAX: 840fc28949c08548 RBX: 0000000000000000 RCX: 00000000685eba97
kernel: [ 348.528052] RDX: ffff88003df53c68 RSI: ffffffff81197185 RDI: ffffffff81acc800
kernel: [ 348.528052] RBP: ffff88003df53c38 R08: 000000000001b1c0 R09: ffffffff812ef300
kernel: [ 348.528052] R10: ffff88003e21b1c0 R11: ffffea0000f36000 R12: ffffffffa033e000
kernel: [ 348.528052] R13: ffffffffa0339c10 R14: ffff88003d17b240 R15: ffffffffa0339bc0
kernel: [ 348.528052] FS: 00007f910f913740(0000) GS:ffff88003e200000(0000) knlGS:0000000000000000
kernel: [ 348.528052] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: [ 348.528052] CR2: 00007f910eac0000 CR3: 0000000037a07000 CR4: 00000000001406f0
kernel: [ 348.528052] Stack:
kernel: [ 348.528052] ffff88003df53ca0 ffffffffa0331fbb ffffffff81197185 0000000a00000000
kernel: [ 348.528052] 0000000000000000 000000080000b712 0000000000000000 ffffffffa0335701
kernel: [ 348.528052] ffffffffa0332320 0000000000000000 ffff88003d17b240 ffffffffa0339bc0
kernel: [ 348.528052] Call Trace:
kernel: [ 348.528052] [<ffffffffa0331fbb>] rxe_setup_udp_tunnel.constprop.14+0x6b/0xc0 [rdma_rxe]
kernel: [ 348.528052] [<ffffffff81197185>] ? kmem_cache_create+0x85/0x1c0
kernel: [ 348.528052] [<ffffffffa0332320>] ? net_to_rxe+0x80/0x80 [rdma_rxe]
kernel: [ 348.528052] [<ffffffffa03326de>] rxe_net_init+0x1e/0xe0 [rdma_rxe]
kernel: [ 348.528052] [<ffffffffa033e027>] rxe_module_init+0x27/0x57 [rdma_rxe]
kernel: [ 348.528052] [<ffffffff8100214d>] do_one_initcall+0x3d/0x160
kernel: [ 348.528052] [<ffffffff811b4145>] ? __vunmap+0x85/0xd0
kernel: [ 348.528052] [<ffffffff811b41fe>] ? vfree+0x2e/0x70
kernel: [ 348.528052] [<ffffffff8116ce63>] do_init_module+0x60/0x1e0
kernel: [ 348.528052] [<ffffffff810ec622>] load_module+0x1dc2/0x2650
kernel: [ 348.528052] [<ffffffff810e9970>] ? __symbol_put+0x40/0x40
kernel: [ 348.528052] [<ffffffff810ecfae>] SYSC_init_module+0xfe/0x110
kernel: [ 348.528052] [<ffffffff810ed07e>] SyS_init_module+0xe/0x10
kernel: [ 348.528052] [<ffffffff81502df2>] entry_SYSCALL_64_fastpath+0x1a/0xa4
kernel: [ 348.528052] Code: ca 0e 10 e1 48 89 df e8 32 22 10 e1 5b 5d c3 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 8b 46 20 55 48 89 e5 <80> a0 d0 02 00 00 ef 80 80 d3 02 00 00 01 48 8b 0a 48 89 88 28
kernel: [ 348.528052] RIP [<ffffffffa03212bd>] setup_udp_tunnel_sock+0xd/0x70 [udp_tunnel]
kernel: [ 348.528052] RSP <ffff88003df53c38>
kernel: [ 348.772092] ---[ end trace 432dfe51deb7b58e ]---
Signed-off-by: Parav Pandit <pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/sw/rxe/rxe_net.c | 20 +++++++++-----------
drivers/infiniband/sw/rxe/rxe_net.h | 2 --
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
index 0b8d2ea..dc9851f 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.c
+++ b/drivers/infiniband/sw/rxe/rxe_net.c
@@ -48,6 +48,8 @@
static LIST_HEAD(rxe_dev_list);
static spinlock_t dev_list_lock; /* spinlock for device list */
+static struct rxe_recv_sockets recv_sockets;
+
struct rxe_dev *net_to_rxe(struct net_device *ndev)
{
struct rxe_dev *rxe;
@@ -81,9 +83,6 @@ struct rxe_dev *get_rxe_by_name(const char* name)
return found;
}
-
-struct rxe_recv_sockets recv_sockets;
-
static __be64 rxe_mac_to_eui64(struct net_device *ndev)
{
unsigned char *mac_addr = ndev->dev_addr;
@@ -277,7 +276,8 @@ static struct socket *rxe_setup_udp_tunnel(struct net *net, __be16 port,
static void rxe_release_udp_tunnel(struct socket *sk)
{
- udp_tunnel_sock_release(sk);
+ if (sk)
+ udp_tunnel_sock_release(sk);
}
static void prepare_udp_hdr(struct sk_buff *skb, __be16 src_port,
@@ -668,6 +668,7 @@ int rxe_net_init(void)
spin_lock_init(&dev_list_lock);
+#if IS_ENABLED(CONFIG_IPV6)
recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
htons(ROCE_V2_UDP_DPORT), true);
if (IS_ERR(recv_sockets.sk6)) {
@@ -675,7 +676,7 @@ int rxe_net_init(void)
pr_err("rxe: Failed to create IPv6 UDP tunnel\n");
return -1;
}
-
+#endif
recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net,
htons(ROCE_V2_UDP_DPORT), false);
if (IS_ERR(recv_sockets.sk4)) {
@@ -688,8 +689,8 @@ int rxe_net_init(void)
err = register_netdevice_notifier(&rxe_net_notifier);
if (err) {
- rxe_release_udp_tunnel(recv_sockets.sk6);
rxe_release_udp_tunnel(recv_sockets.sk4);
+ rxe_release_udp_tunnel(recv_sockets.sk6);
pr_err("rxe: Failed to rigister netdev notifier\n");
}
@@ -698,11 +699,8 @@ int rxe_net_init(void)
void rxe_net_exit(void)
{
- if (recv_sockets.sk6)
- rxe_release_udp_tunnel(recv_sockets.sk6);
-
- if (recv_sockets.sk4)
- rxe_release_udp_tunnel(recv_sockets.sk4);
+ rxe_release_udp_tunnel(recv_sockets.sk4);
+ rxe_release_udp_tunnel(recv_sockets.sk6);
unregister_netdevice_notifier(&rxe_net_notifier);
}
diff --git a/drivers/infiniband/sw/rxe/rxe_net.h b/drivers/infiniband/sw/rxe/rxe_net.h
index 7b06f76..106c586 100644
--- a/drivers/infiniband/sw/rxe/rxe_net.h
+++ b/drivers/infiniband/sw/rxe/rxe_net.h
@@ -43,8 +43,6 @@ struct rxe_recv_sockets {
struct socket *sk6;
};
-extern struct rxe_recv_sockets recv_sockets;
-
struct rxe_dev *rxe_net_add(struct net_device *ndev);
int rxe_net_init(void);
--
2.7.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
* Re: [PATCH 13/13] Remove ibsupport-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org from MAINTAINERS
From: Dalessandro, Dennis @ 2016-09-24 13:43 UTC (permalink / raw)
To: jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1474658228-5390-14-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 961 bytes --]
On Fri, 2016-09-23 at 13:17 -0600, Jason Gunthorpe wrote:
> Turns out this is not a mailing list.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
> Â MAINTAINERS | 1 -
> Â 1 file changed, 1 deletion(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b39529feec9b..7a31376056e0 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -69,7 +69,6 @@ F: ibacm/*
> Â IPATH/QIB USERSPACE PROVIDER (for ib_qib.ko)
> Â M: Mike Marciniszyn <mike.marciniszyn@intel.com>
> Â S: Supported
> -L: ibsupport@intel.com
> Â F: libipathverbs/
> Â
> Â IWARP PORT MAPPER DAEMON (for iwarp kernel providers)
This is the right one to use, while you are at it you can tack my name
onto here as well.
https://github.com/01org/opa-libhfi1verbs/commit/377b68888a0b885fc2a44d
df7a2ec33f2fcf217b
N§²æìr¸yúèØb²X¬¶Ç§vØ^)Þº{.nÇ+·¥{±Ù{ayº\x1dÊÚë,j\a¢f£¢·h»öì\x17/oSc¾Ú³9uÀ¦æåÈ&jw¨®\x03(éÝ¢j"ú\x1a¶^[m§ÿïêäz¹Þàþf£¢·h§~m
^ permalink raw reply
* RE RE
From: Mr.Campbell Neiman @ 2016-09-24 6:04 UTC (permalink / raw)
This message is the last notification about U USD14.5 million bearing our
Name as Beneficiary, all effort to reach you have not be successful,
Please if you Receive this message kindly respond back stating your Desire
to make the claim, Reconfirm your full name and age Mr. Mr.Campbell Neiman
--
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] ibacm: move Documentation to Documentation/
From: Hefty, Sean @ 2016-09-24 1:23 UTC (permalink / raw)
To: Christoph Hellwig,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1474677279-30407-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
> And drop various bits that aren't relevant for our unified tree
> (Windows support, build instructions, etc).
>
> Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Thanks!
--
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] ibacm: move Documentation to Documentation/
From: Christoph Hellwig @ 2016-09-24 0:34 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
And drop various bits that aren't relevant for our unified tree
(Windows support, build instructions, etc).
Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
Documentation/ibacm.md | 109 ++++++++++++++++++++++++++++++++++++++
ibacm/acm_notes.txt | 141 -------------------------------------------------
2 files changed, 109 insertions(+), 141 deletions(-)
create mode 100644 Documentation/ibacm.md
delete mode 100644 ibacm/acm_notes.txt
diff --git a/Documentation/ibacm.md b/Documentation/ibacm.md
new file mode 100644
index 0000000..8ed293d
--- /dev/null
+++ b/Documentation/ibacm.md
@@ -0,0 +1,109 @@
+# The Assistant for InfiniBand Communication Management (IB ACM)
+
+The IB ACM library implements and provides a framework for name, address, and
+route resolution services over InfiniBand. The IB ACM provides information
+needed to establish a connection, but does not implement the CM protocol.
+
+IB ACM services are used by librdmacm to implement the rdma_resolve_addr,
+rdma_resolve_route, and rdma_getaddrinfo routines.
+
+The IB ACM is focused on being scalable and efficient. The current
+implementation limits network traffic, SA interactions, and centralized
+services. ACM supports multiple resolution protocols in order to handle
+different fabric topologies.
+
+This release is limited in its handling of dynamic changes.
+
+The IB ACM package is comprised of two components: the ibacm service
+and a test/configuration utility - ib_acme.
+
+# Details
+
+### ib_acme
+
+The ib_acme program serves a dual role. It acts as a utility to test
+ibacm operation and help verify if the ibacm service and selected
+protocol is usable for a given cluster configuration. Additionally,
+it automatically generates ibacm configuration files to assist with
+or eliminate manual setup.
+
+
+### acm configuration files
+
+The ibacm service relies on two configuration files.
+
+The acm_addr.cfg file contains name and address mappings for each IB
+<device, port, pkey> endpoint. Although the names in the acm_addr.cfg
+file can be anything, ib_acme maps the host name and IP addresses to
+the IB endpoints.
+
+The acm_opts.cfg file provides a set of configurable options for the
+ibacm service, such as timeout, number of retries, logging level, etc.
+ib_acme generates the acm_opts.cfg file using static information. A
+future enhancement would adjust options based on the current system
+and cluster size.
+
+### ibacm
+
+The ibacm service is responsible for resolving names and addresses to
+InfiniBand path information and caching such data. It is implemented as a
+daemon that execute with administrative privileges.
+
+The ibacm implements a client interface over TCP sockets, which is
+abstracted by the librdmacm library. One or more back-end protocols are
+used by the ibacm service to satisfy user requests. Although the
+ibacm supports standard SA path record queries on the back-end, it
+provides an experimental multicast resolution protocol in hope of
+achieving greater scalability. The latter is not usable on all fabric
+topologies, specifically ones that may not have reversible paths.
+Users should use the ib_acme utility to verify that multicast protocol
+is usable before running other applications.
+
+Conceptually, the ibacm service implements an ARP like protocol and either
+uses IB multicast records to construct path record data or queries the
+SA directly, depending on the selected route protocol. By default, the
+ibacm services uses and caches SA path record queries.
+
+Specifically, all IB endpoints join a number of multicast groups.
+Multicast groups differ based on rates, mtu, sl, etc., and are prioritized.
+All participating endpoints must be able to communicate on the lowest
+priority multicast group. The ibacm assigns one or more names/addresses
+to each IB endpoint using the acm_addr.cfg file. Clients provide source
+and destination names or addresses as input to the service, and receive
+as output path record data.
+
+The service maps a client's source name/address to a local IB endpoint.
+If a client does not provide a source address, then the ibacm service
+will select one based on the destination and local routing tables. If the
+destination name/address is not cached locally, it sends a multicast
+request out on the lowest priority multicast group on the local endpoint.
+The request carries a list of multicast groups that the sender can use.
+The recipient of the request selects the highest priority multicast group
+that it can use as well and returns that information directly to the sender.
+The request data is cached by all endpoints that receive the multicast
+request message. The source endpoint also caches the response and uses
+the multicast group that was selected to construct or obtain path record
+data, which is returned to the client.
+
+The current implementation of the IB ACM has several additional restrictions:
+- The ibacm is limited in its handling of dynamic changes;
+ the ibacm should be stopped and restarted if a cluster is reconfigured.
+- Support for IPv6 has not been verified.
+- The number of addresses that can be assigned to a single endpoint is
+ limited to 4.
+- The number of multicast groups that an endpoint can support is limited to 2.
+
+The ibacm contains several internal caches. These include caches for
+GID and LID destination addresses. These caches can be optionally
+preloaded. ibacm supports the OpenSM dump_pr plugin "full" PathRecord
+format which is used to preload these caches. The file format is specified
+in the ibacm_opts.cfg file via the route_preload setting which should
+be set to opensm_full_v1 for this file format. Default format is
+none which does not preload these caches. See dump_pr.notes.txt in dump_pr
+for more information on the opensm_full_v1 file format and how to configure
+OpenSM to generate this file.
+
+Additionally, the name, IPv4, and IPv6 caches can be be preloaded by using
+the addr_preload option. The default is none which does not preload these
+caches. To preload these caches, set this option to acm_hosts and
+configure the addr_data_file appropriately.
diff --git a/ibacm/acm_notes.txt b/ibacm/acm_notes.txt
deleted file mode 100644
index c975555..0000000
--- a/ibacm/acm_notes.txt
+++ /dev/null
@@ -1,141 +0,0 @@
-Assistant for InfiniBand Communication Management (IB ACM)
-
-Note: The IB ACM should be considered experimental.
-
-
-Overview
---------
-The IB ACM package implements and provides a framework for experimental name,
-address, and route resolution services over InfiniBand. It is intended to
-address connection setup scalability issues running MPI applications on
-large clusters. The IB ACM provides information needed to establish a
-connection, but does not implement the CM protocol.
-
-The librdmacm can invoke IB ACM services when built using the --with-ib_acm
-option. The IB ACM services tie in under the rdma_resolve_addr,
-rdma_resolve_route, and rdma_getaddrinfo routines. For maximum benefit,
-the rdma_getaddrinfo routine should be used, however existing applications
-should still see significant connection scaling benefits using the calls
-available in librdmacm 1.0.11 and previous releases.
-
-The IB ACM is focused on being scalable and efficient. The current
-implementation limits network traffic, SA interactions, and centralized
-services. ACM supports multiple resolution protocols in order to handle
-different fabric topologies.
-
-This release is limited in its handling of dynamic changes.
-
-The IB ACM package is comprised of two components: the ibacm service
-and a test/configuration utility - ib_acme. Both are userspace components
-and are available for Linux and Windows. Additional details are given below.
-
-
-Quick Start Guide
------------------
-1. Prerequisites: libibverbs and libibumad must be installed.
- The IB stack should be running with IPoIB configured.
- These steps assume that the user has administrative privileges.
-2. Install the IB ACM package
- This installs ibacm, and ib_acme.
-3. Run ib_acme -A -O
- This will generate IB ACM address and options configuration files.
- (acm_addr.cfg and acm_opts.cfg)
-4. Run ibacm -D
- This will run ibacm as service/daemon.
- Because ibacm uses the libibumad interfaces, it should be run with
- administrative privileges.
-5. Optionally, run ib_acme -s <source_ip> -d <dest_ip> -v
- This will verify that the ibacm service is running.
-5. Install librdmacm.
- The librdmacm will automatically use the ibacm service.
- On failures, the librdmacm will fall back to normal resolution.
-
-
-Details
--------
-ib_acme:
-The ib_acme program serves a dual role. It acts as a utility to test
-ibacm operation and help verify if the ibacm service and selected
-protocol is usable for a given cluster configuration. Additionally,
-it automatically generates ibacm configuration files to assist with
-or eliminate manual setup.
-
-
-acm configuration files:
-The ibacm service relies on two configuration files.
-
-The acm_addr.cfg file contains name and address mappings for each IB
-<device, port, pkey> endpoint. Although the names in the acm_addr.cfg
-file can be anything, ib_acme maps the host name and IP addresses to
-the IB endpoints.
-
-The acm_opts.cfg file provides a set of configurable options for the
-ibacm service, such as timeout, number of retries, logging level, etc.
-ib_acme generates the acm_opts.cfg file using static information. A
-future enhancement would adjust options based on the current system
-and cluster size.
-
-
-ibacm:
-The ibacm service is responsible for resolving names and addresses to
-InfiniBand path information and caching such data. It is implemented as a
-daemon that execute with administrative privileges.
-
-The ibacm implements a client interface over TCP sockets, which is
-abstracted by the librdmacm library. One or more back-end protocols are
-used by the ibacm service to satisfy user requests. Although the
-ibacm supports standard SA path record queries on the back-end, it
-provides an experimental multicast resolution protocol in hope of
-achieving greater scalability. The latter is not usable on all fabric
-topologies, specifically ones that may not have reversible paths.
-Users should use the ib_acme utility to verify that multicast protocol
-is usable before running other applications.
-
-Conceptually, the ibacm service implements an ARP like protocol and either
-uses IB multicast records to construct path record data or queries the
-SA directly, depending on the selected route protocol. By default, the
-ibacm services uses and caches SA path record queries.
-
-Specifically, all IB endpoints join a number of multicast groups.
-Multicast groups differ based on rates, mtu, sl, etc., and are prioritized.
-All participating endpoints must be able to communicate on the lowest
-priority multicast group. The ibacm assigns one or more names/addresses
-to each IB endpoint using the acm_addr.cfg file. Clients provide source
-and destination names or addresses as input to the service, and receive
-as output path record data.
-
-The service maps a client's source name/address to a local IB endpoint.
-If a client does not provide a source address, then the ibacm service
-will select one based on the destination and local routing tables. If the
-destination name/address is not cached locally, it sends a multicast
-request out on the lowest priority multicast group on the local endpoint.
-The request carries a list of multicast groups that the sender can use.
-The recipient of the request selects the highest priority multicast group
-that it can use as well and returns that information directly to the sender.
-The request data is cached by all endpoints that receive the multicast
-request message. The source endpoint also caches the response and uses
-the multicast group that was selected to construct or obtain path record
-data, which is returned to the client.
-
-The current implementation of the IB ACM has several additional restrictions:
-- The ibacm is limited in its handling of dynamic changes;
- the ibacm should be stopped and restarted if a cluster is reconfigured.
-- Support for IPv6 has not been verified.
-- The number of addresses that can be assigned to a single endpoint is
- limited to 4.
-- The number of multicast groups that an endpoint can support is limited to 2.
-
-The ibacm contains several internal caches. These include caches for
-GID and LID destination addresses. These caches can be optionally
-preloaded. ibacm supports the OpenSM dump_pr plugin "full" PathRecord
-format which is used to preload these caches. The file format is specified
-in the ibacm_opts.cfg file via the route_preload setting which should
-be set to opensm_full_v1 for this file format. Default format is
-none which does not preload these caches. See dump_pr.notes.txt in dump_pr
-for more information on the opensm_full_v1 file format and how to configure
-OpenSM to generate this file.
-
-Additionally, the name, IPv4, and IPv6 caches can be be preloaded by using
-the addr_preload option. The default is none which does not preload these
-caches. To preload these caches, set this option to acm_hosts and
-configure the addr_data_file appropriately.
--
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
* RE: [PATCH 05/13] Have cmake run man pages through text substitution
From: Hefty, Sean @ 2016-09-23 21:49 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20160923213819.GC8490@obsidianresearch.com>
> We do this in libfabric. I believe we use Jekyll. Since someone else
> set that up, I was happy and didn't really care which conversion tool
> was used. :)
Or maybe Jekyll does the html, and pandoc does the nroff...
--
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 05/13] Have cmake run man pages through text substitution
From: Hefty, Sean @ 2016-09-23 21:48 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20160923213819.GC8490-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> We could begin by requiring all new man pages to be in markdown
> format. Do you do this in libfabric? What conversion tool do you like?
We do this in libfabric. I believe we use Jekyll. Since someone else set that up, I was happy and didn't really care which conversion tool was used. :)
--
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 05/13] Have cmake run man pages through text substitution
From: Jason Gunthorpe @ 2016-09-23 21:38 UTC (permalink / raw)
To: Hefty, Sean; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1828884A29C6694DAF28B7E6B8A82373AB08E9D8-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
On Fri, Sep 23, 2016 at 09:23:42PM +0000, Hefty, Sean wrote:
> > rsocket.7 had an errant text substitution that never worked, it is
> > a good idea to have the man pages use the correct paths, so let
> > us have cmake run them through.
> >
> > Any man page ending in '.in' will be substituted automatically.
> >
> > Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
>
> Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> FWIW, I'm in favor of replacing the man pages with markdown and then
> generating the man pages from that. I volunteer someone else to do
> that work.
I concur, and someone else should do the work ..
We could begin by requiring all new man pages to be in markdown
format. Do you do this in libfabric? What conversion tool do you like?
I've used rst for this in the past with reasonable results..
Jason
--
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 05/13] Have cmake run man pages through text substitution
From: Hefty, Sean @ 2016-09-23 21:23 UTC (permalink / raw)
To: Jason Gunthorpe,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <1474658228-5390-6-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> rsocket.7 had an errant text substitution that never worked, it is
> a good idea to have the man pages use the correct paths, so let
> us have cmake run them through.
>
> Any man page ending in '.in' will be substituted automatically.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
FWIW, I'm in favor of replacing the man pages with markdown and then generating the man pages from that. I volunteer someone else to do that work.
--
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 06/13] Consolidate definitions for paths into config.h
From: Hefty, Sean @ 2016-09-23 21:22 UTC (permalink / raw)
To: Jason Gunthorpe,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Nikolova, Tatyana E, Bart Van Assche
In-Reply-To: <1474658228-5390-7-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> config.h is the only place we pass through cmake substitution,
> so it is the only place that can define the various filesystem
> paths.
>
> This patch handles the C code portions that use paths.
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
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: [RFC PATCH 10/11] IB/srpt: Increase lid and sm_lid to 32 bits
From: Bart Van Assche @ 2016-09-23 21:01 UTC (permalink / raw)
To: ira.weiny-ral2JQCrhuEAvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Dasaratharaman Chandramouli, Don Hiatt
In-Reply-To: <1474652674-13110-11-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
On 09/23/2016 10:44 AM, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> srpt contains lid and sm_lid fields which are 16 bits in
> length, increase them to 32 bits.
Reviewed-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
--
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 13/13] Remove ibsupport-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org from MAINTAINERS
From: Jason Gunthorpe @ 2016-09-23 19:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Turns out this is not a mailing list.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
MAINTAINERS | 1 -
1 file changed, 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index b39529feec9b..7a31376056e0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -69,7 +69,6 @@ F: ibacm/*
IPATH/QIB USERSPACE PROVIDER (for ib_qib.ko)
M: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
S: Supported
-L: ibsupport-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
F: libipathverbs/
IWARP PORT MAPPER DAEMON (for iwarp kernel providers)
--
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 12/13] Document a versioning strategy and use it
From: Jason Gunthorpe @ 2016-09-23 19:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Sean Hefty, Hal Rosenstock, Doug Ledford, Yishai Hadas
In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
This is particularly important for the three shared libraries, and
we haven't been doing it right historically, perhaps due to libtool
braindamage.
The names of the shlibs are updated to:
libibcm 1.0.11
libibumad 3.1.11
libibverbs 1.3.11
librdmacm 1.1.11
The SONAME remains the same.
The overall package release is set to 11 due to libibumad having got up
to a .10 release.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 5 +-
Documentation/versioning.md | 108 ++++++++++++++++++++++++++++++++++++++++++
libibcm/src/CMakeLists.txt | 4 +-
libibcm/src/libibcm.map | 1 +
libibumad/src/CMakeLists.txt | 4 +-
libibumad/src/libibumad.map | 1 +
libibverbs/src/CMakeLists.txt | 4 +-
libibverbs/src/libibverbs.map | 1 +
librdmacm/src/CMakeLists.txt | 4 +-
librdmacm/src/librdmacm.map | 1 +
10 files changed, 127 insertions(+), 6 deletions(-)
create mode 100644 Documentation/versioning.md
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 805b25bb8669..8d58db0b9c07 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,8 +32,9 @@ else()
endif()
set(PACKAGE_NAME "RDMA")
-# FIXME versioning strategy?
-set(PACKAGE_VERSION "1")
+
+# See Documentation/versioning.md
+set(PACKAGE_VERSION "11")
#-------------------------
# Basic standard paths
diff --git a/Documentation/versioning.md b/Documentation/versioning.md
new file mode 100644
index 000000000000..0cc542aa6b79
--- /dev/null
+++ b/Documentation/versioning.md
@@ -0,0 +1,108 @@
+# Overall Package Version
+
+This version number is set in the top level CMakeLists.txt:
+
+```sh
+set(PACKAGE_VERSION "11")
+````
+
+For upstream releases this is a single integer showing the release
+ordering. We do not attempt to encode any 'ABI' information in this version.
+
+Branched stabled releases can append an additional counter eg `11.2`.
+
+Unofficial releases should include a distributor tag, eg '11.vendor2'.
+
+When the PACKAGE_VERSION is changed, the packaging files should be updated:
+
+```diff
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 389feee1e0f9..63854fe8f07f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -26,7 +26,7 @@ project(RDMA C)
+ set(PACKAGE_NAME "RDMA")
+
+ # See Documentation/versioning.md
+-set(PACKAGE_VERSION "11")
++set(PACKAGE_VERSION "12")
+
+ #-------------------------
+ # Basic standard paths
+```
+
+# Shared Library Versions
+
+The shared libraries use the typical semantic versioning scheme, eg
+*libibumad* has a version like `3.1.11`.
+
+The version number is broken up into three fields:
+- '3' is called the SONAME and is embedded into the ELF:
+ ```sh
+ $ readelf -ds build/lib/libibumad.so.3.1.11
+ 0x000000000000000e (SONAME) Library soname: [libibumad.so.3]
+ ```
+
+ We do not expect this value to ever change for our libraries. It indicates
+ the overall ABI, changing it means the library will not dynamically to old
+ programs link anymore.
+
+- '1' is called the ABI level and is used within the ELF as the last component
+ symbol version tag. This version must be changed every time a new symbol
+ is introduced. It allows the user to see what version of the ABI the
+ library provides.
+
+- '11' is the overall release number and is copied from `PACKAGE_VERSION` This
+ version increases with every package release, even if the library code did
+ not change. It allows the user to see what upstream source was used to build
+ the library.
+
+This version is encoded into the filename `build/lib/libibumad.so.3.1.11` and
+a symlink from `libibumad.so.3` to `build/lib/libibumad.so.3.1.11` is created.
+
+## Shared Library Symbol Versions
+
+Symbol versions are a linker technique that lets the library author provide
+two symbols with different ABIs that have the same API name. The linker
+differentiates the two cases internally. This allows the library author to
+change the ABI that the API uses. This project typically does not make use of
+this feature.
+
+As a secondary feature, the symbol version is also used by package managers
+like RPM to manage the ABI level. To make this work properly the ABI level
+must be correctly encoded into the symbol version.
+
+## Adding a new symbol
+
+First, increase the ABI level of the library. It is safe to re-use the ABI
+level for multiple new functions within a single release, but once a release
+is tagged the ABI level becomes *immutable*. The maintainer can provide
+guidence on what ABI level to use for each series.
+
+```diff
+ rdma_library(ibumad libibumad.map
+ # See Documentation/versioning.md
+- 3 3.1.${PACKAGE_VERSION}
++ 3 3.2.${PACKAGE_VERSION}
+```
+
+Next, add your new symbol to the symbol version file:
+
+```diff
++ IBUMAD_3.2 {
++ global:
++ umad_new_symbol;
++ } IBUMAD_1.0;
+```
+
+NOTE: Once a release is made the stanzas in the map file are *immutable* and
+cannot be changed. Do not add your new symbol to old stanzas.
+
+The new symbol should appear in the ELF:
+
+```sh
+$ readelf -s build/lib/libibumad.so.3.1.11
+ 35: 00000000000031e0 450 FUNC GLOBAL DEFAULT 12 umad_new_symbol@@IBUMAD_3.2
+```
+
+Finally update the `debian/libibumad3.symbols` file.
diff --git a/libibcm/src/CMakeLists.txt b/libibcm/src/CMakeLists.txt
index 2479886c6238..66b3362ec7a0 100644
--- a/libibcm/src/CMakeLists.txt
+++ b/libibcm/src/CMakeLists.txt
@@ -3,7 +3,9 @@ publish_headers(infiniband
../include/infiniband/cm_abi.h
)
-rdma_library(ibcm libibcm.map 1 1.0.0
+rdma_library(ibcm libibcm.map
+ # See Documentation/versioning.md
+ 1 1.0.${PACKAGE_VERSION}
cm.c
)
target_link_libraries(ibcm LINK_PUBLIC ibverbs)
diff --git a/libibcm/src/libibcm.map b/libibcm/src/libibcm.map
index 3d83e481a6bb..c94e420a6cc8 100644
--- a/libibcm/src/libibcm.map
+++ b/libibcm/src/libibcm.map
@@ -1,3 +1,4 @@
+/* Do not change this file without reading Documentation/versioning.md */
IBCM_1.0 {
global:
ib_cm_open_device;
diff --git a/libibumad/src/CMakeLists.txt b/libibumad/src/CMakeLists.txt
index b7b5d03bc53e..fbd15893d973 100644
--- a/libibumad/src/CMakeLists.txt
+++ b/libibumad/src/CMakeLists.txt
@@ -7,7 +7,9 @@ publish_headers(infiniband
../include/infiniband/umad_types.h
)
-rdma_library(ibumad libibumad.map 3 3.1.0
+rdma_library(ibumad libibumad.map
+ # See Documentation/versioning.md
+ 3 3.1.${PACKAGE_VERSION}
sysfs.c
umad.c
umad_str.c
diff --git a/libibumad/src/libibumad.map b/libibumad/src/libibumad.map
index e42dc799d69e..8bf474e26ae2 100644
--- a/libibumad/src/libibumad.map
+++ b/libibumad/src/libibumad.map
@@ -1,3 +1,4 @@
+/* Do not change this file without reading Documentation/versioning.md */
IBUMAD_1.0 {
global:
umad_init;
diff --git a/libibverbs/src/CMakeLists.txt b/libibverbs/src/CMakeLists.txt
index e1a54345c537..6989f7730c5e 100644
--- a/libibverbs/src/CMakeLists.txt
+++ b/libibverbs/src/CMakeLists.txt
@@ -17,7 +17,9 @@ else()
set(NEIGH "")
endif()
-rdma_library(ibverbs libibverbs.map 1 1.0.0
+rdma_library(ibverbs libibverbs.map
+ # See Documentation/versioning.md
+ 1 1.3.${PACKAGE_VERSION}
cmd.c
compat-1_0.c
device.c
diff --git a/libibverbs/src/libibverbs.map b/libibverbs/src/libibverbs.map
index 46744e551068..33cd6b63917b 100644
--- a/libibverbs/src/libibverbs.map
+++ b/libibverbs/src/libibverbs.map
@@ -1,3 +1,4 @@
+/* Do not change this file without reading Documentation/versioning.md */
IBVERBS_1.0 {
global:
ibv_get_device_list;
diff --git a/librdmacm/src/CMakeLists.txt b/librdmacm/src/CMakeLists.txt
index 5324f625616d..0a60786c5f7a 100644
--- a/librdmacm/src/CMakeLists.txt
+++ b/librdmacm/src/CMakeLists.txt
@@ -8,7 +8,9 @@ publish_headers(infiniband
../include/infiniband/ib.h
)
-rdma_library(rdmacm librdmacm.map 1 1.0.0
+rdma_library(rdmacm librdmacm.map
+ # See Documentation/versioning.md
+ 1 1.1.${PACKAGE_VERSION}
acm.c
addrinfo.c
cma.c
diff --git a/librdmacm/src/librdmacm.map b/librdmacm/src/librdmacm.map
index ffbd199d3119..65c049211c65 100644
--- a/librdmacm/src/librdmacm.map
+++ b/librdmacm/src/librdmacm.map
@@ -1,3 +1,4 @@
+/* Do not change this file without reading Documentation/versioning.md */
RDMACM_1.0 {
global:
rdma_create_event_channel;
--
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 11/13] srp_daemon: Add the debian initscripts as an option
From: Jason Gunthorpe @ 2016-09-23 19:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Bart Van Assche
In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Necessary to reproduce the Debian packaging.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 3 ++
srp_daemon/srp_daemon/CMakeLists.txt | 29 ++++++++----
srp_daemon/srptools.default | 14 ++++++
srp_daemon/srptools.init | 89 ++++++++++++++++++++++++++++++++++++
4 files changed, 126 insertions(+), 9 deletions(-)
create mode 100644 srp_daemon/srptools.default
create mode 100644 srp_daemon/srptools.init
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ae236f88f67..805b25bb8669 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -69,6 +69,9 @@ else()
set(CMAKE_INSTALL_FULL_RUNDIR "${CMAKE_INSTALL_RUNDIR}")
endif()
+set(DISTRO_FLAVOUR "None" CACHE
+ STRING "Flavour of distribution to install for. This primarily impacts the init.d scripts installed.")
+
#-------------------------
# Load CMake components
set(BUILDLIB "${CMAKE_SOURCE_DIR}/buildlib")
diff --git a/srp_daemon/srp_daemon/CMakeLists.txt b/srp_daemon/srp_daemon/CMakeLists.txt
index fe6b41811b92..4ad4edaf8c33 100644
--- a/srp_daemon/srp_daemon/CMakeLists.txt
+++ b/srp_daemon/srp_daemon/CMakeLists.txt
@@ -23,12 +23,23 @@ install(FILES logrotate-srp_daemon DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/logr
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-core 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(SRP_DEFAULT_START "2 3 4 5" CACHE STRING "Default-Start service data for srpd")
-set(SRP_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)
+if ("${DISTRO_FLAVOUR}" STREQUAL "Debian")
+ # Debian version of the initscript system
+ install(FILES "srptools.init"
+ DESTINATION "${CMAKE_INSTALL_INITDDIR}"
+ RENAME "srptools"
+ PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+ install(FILES "srptools.default"
+ DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/default/"
+ RENAME "srptools")
+else()
+ # FIXME: The ib init.d file should really be included in rdma-core 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(SRP_DEFAULT_START "2 3 4 5" CACHE STRING "Default-Start service data for srpd")
+ set(SRP_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)
+endif()
diff --git a/srp_daemon/srptools.default b/srp_daemon/srptools.default
new file mode 100644
index 000000000000..81e84f4a5cba
--- /dev/null
+++ b/srp_daemon/srptools.default
@@ -0,0 +1,14 @@
+#How often should srpdeamon rescan the fabric (seconds)
+RETRIES=60
+
+#Where should srp-deamon log to
+LOG=/var/log/srp_daemon.log
+
+# What ports should srp-deamon be started on.
+# Format is CA:port
+# ALL or NONE will run on all ports on none
+# respectively
+
+PORTS=NONE
+#PORTS=ALL
+#PORTS="mthca0:1 mlx4_0:2"
diff --git a/srp_daemon/srptools.init b/srp_daemon/srptools.init
new file mode 100644
index 000000000000..2c1a140ccbc3
--- /dev/null
+++ b/srp_daemon/srptools.init
@@ -0,0 +1,89 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides: srptools
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Discovers SRP scsi targets.
+# Description: Discovers SRP scsi over infiniband targets.
+### END INIT INFO
+
+[ -x /usr/sbin/srp_daemon ] || exit 0
+
+IBDIR=/sys/class/infiniband
+
+PORTS=""
+RETRIES=""
+LOG=""
+
+[ -f /etc/default/srptools ] && . /etc/default/srptools
+
+start_daemon () {
+
+if [ "$PORTS" = "NONE" ] ; then
+echo "srptools disabled."
+exit 0
+fi
+
+
+if [ "$PORTS" = "ALL" ] ; then
+ for HCA_ID in `/bin/ls -1 ${IBDIR}`
+ do
+ for PORT in `/bin/ls -1 ${IBDIR}/${HCA_ID}/ports/`
+ do
+ run_daemon
+ done
+ done
+fi
+
+
+for ADAPTER in $PORTS ; do
+ HCA_ID=`echo $ADAPTER | awk -F: '{print $1}'`
+ PORT=`echo $ADAPTER | awk -F: '{print $2}'`
+ run_daemon
+done
+}
+
+
+run_daemon() {
+# SRP deamon wedges if we start it on a port which is not up
+
+ STATUS=`/usr/sbin/ibstat $HCA_ID $PORT | grep "State:"`
+
+ if [ "$STATUS" = "State: Active" ] ; then
+ echo "Starting srp on $HCA_ID $PORT"
+
+# srp does not background itself; using the start-stop-daemon background function
+# causes us to lose stdout, which is where it logs to
+ nohup start-stop-daemon --start --quiet -m --pidfile /var/run/srp_daemon.${HCA_ID}.${PORT} \
+ --exec /usr/sbin/srp_daemon -- -e -c -n -i ${HCA_ID} -p ${PORT} -R ${RETRIES} >> $LOG 2>&1 &
+ RETVAL=$?
+ fi
+}
+
+stop_daemon () {
+ for HCA_ID in `/bin/ls -1 ${IBDIR}`
+ do
+ for PORT in `/bin/ls -1 ${IBDIR}/${HCA_ID}/ports/`
+ do
+ start-stop-daemon --stop --quiet --oknodo -m --pidfile /var/run/srp_daemon.${HCA_ID}.${PORT}
+ RETVAL=$?
+ done
+ done
+}
+
+
+case "$1" in
+
+start)
+start_daemon
+;;
+stop)
+stop_daemon
+;;
+restart | reload | force-reload )
+stop_daemon
+start_daemon
+;;
+esac
--
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 10/13] ipathverbs: Move truescale-serdes.cmds to /usr/libexec/
From: Jason Gunthorpe @ 2016-09-23 19:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Mike Marciniszyn
In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
This is the FHS defined place for non-user runnable helper
programs.
Debian forbids the use of /usr/libexec/ so we provide
substitution support to let cmake customize this.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
libipathverbs/CMakeLists.txt | 6 ++++--
libipathverbs/dracut_install | 2 +-
libipathverbs/truescale.conf | 1 -
libipathverbs/truescale.conf.in | 1 +
4 files changed, 6 insertions(+), 4 deletions(-)
delete mode 100644 libipathverbs/truescale.conf
create mode 100644 libipathverbs/truescale.conf.in
diff --git a/libipathverbs/CMakeLists.txt b/libipathverbs/CMakeLists.txt
index 359438ef0e49..bde405d0d776 100644
--- a/libipathverbs/CMakeLists.txt
+++ b/libipathverbs/CMakeLists.txt
@@ -1,4 +1,6 @@
-install(FILES truescale.conf DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/")
+rdma_subst_install(FILES "truescale.conf.in"
+ DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/modprobe.d/"
+ RENAME "truescale.conf")
install(FILES truescale-serdes.cmds
- DESTINATION "${CMAKE_INSTALL_SBINDIR}"
+ DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}"
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
diff --git a/libipathverbs/dracut_install b/libipathverbs/dracut_install
index 131adfa036b8..a7ef490ea40f 100644
--- a/libipathverbs/dracut_install
+++ b/libipathverbs/dracut_install
@@ -1,7 +1,7 @@
#!/bin/bash
inst /etc/modprobe.d/truescale.conf
-inst /usr/sbin/truescale-serdes.cmds
+inst /usr/libexec/truescale-serdes.cmds
# All files needed by truescale-serdes.cmds need to be present here
inst /sbin/lspci
diff --git a/libipathverbs/truescale.conf b/libipathverbs/truescale.conf
deleted file mode 100644
index 8ed227c91f86..000000000000
diff --git a/libipathverbs/truescale.conf.in b/libipathverbs/truescale.conf.in
new file mode 100644
index 000000000000..e2827d956015
--- /dev/null
+++ b/libipathverbs/truescale.conf.in
@@ -0,0 +1 @@
+install ib_qib modprobe -i ib_qib $CMDLINE_OPTS && @CMAKE_INSTALL_FULL_LIBEXECDIR@/truescale-serdes.cmds start
--
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/13] verbs: Move the providers into /usr/lib.../libibverbs by default
From: Jason Gunthorpe @ 2016-09-23 19:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Doug Ledford, Yishai Hadas
In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
The Debian packaging has always used this path, provide
official support for this configuration so Debian does not
rely on the absolute path in the .driver file, which breaks biarch.
Since there is no reason for the providers to be in the system
library search path (they export no symbols, and have no soname)
make this the default configuration.
The old behaviour can be restored by using:
cmake -DVERBS_PROVIDER_DIR=''
This continues to support out-of-tree drivers by searching both
the provider path and the system library path if an unqualified
name is given in the .driver file.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 6 +++++
buildlib/config.h.in | 2 ++
buildlib/rdma_functions.cmake | 16 ++++++++-----
libibverbs/src/init.c | 55 ++++++++++++++++++++++++++++++-------------
4 files changed, 57 insertions(+), 22 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 713788f188e3..7ae236f88f67 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,8 @@
# and do not build iwpmd.
# -DENABLE_STATIC=1 (default disabled)
# Produce static libraries along with the usual shared libraries.
+# -DVERBS_PROVIDER_DIR='' (default /usr/lib.../libibverbs)
+# Use the historical search path for providers, in the standard system library.
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
project(RDMA C)
@@ -53,6 +55,10 @@ set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd"
set(ACM_PROVIDER_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/ibacm"
CACHE PATH "Location for ibacm provider plugin shared library files.")
+# Location to find the provider plugin shared library files
+set(VERBS_PROVIDER_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/libibverbs"
+ CACHE PATH "Location for provider plugin shared library files. If set to empty the system search path is used.")
+
# Allow the 'run' dir to be configurable, this historically has been /var/run, but
# some systems now use /run/
set(CMAKE_INSTALL_RUNDIR "var/run"
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
index 78994a39d7ad..8ae2a4e536c0 100644
--- a/buildlib/config.h.in
+++ b/buildlib/config.h.in
@@ -31,6 +31,8 @@
#define IBACM_PORT_FILE "@CMAKE_INSTALL_FULL_RUNDIR@/ibacm.port"
#define IBACM_LOG_FILE "@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/ibacm.log"
+#define VERBS_PROVIDER_DIR "@VERBS_PROVIDER_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
diff --git a/buildlib/rdma_functions.cmake b/buildlib/rdma_functions.cmake
index 260dd18d78df..06ccd518c81d 100644
--- a/buildlib/rdma_functions.cmake
+++ b/buildlib/rdma_functions.cmake
@@ -78,11 +78,6 @@ function(rdma_provider DEST)
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,
@@ -108,7 +103,16 @@ function(rdma_provider DEST)
# Provider Plugins do not use SONAME versioning, there is no reason to
# create the usual symlinks.
- install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+ if (VERBS_PROVIDER_DIR)
+ install(TARGETS ${DEST} DESTINATION "${VERBS_PROVIDER_DIR}")
+ else()
+ install(TARGETS ${DEST} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+
+ # 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")
+ endif()
endfunction()
# Create an installed executable
diff --git a/libibverbs/src/init.c b/libibverbs/src/init.c
index bca0e02d11e1..7ae0fc87d332 100644
--- a/libibverbs/src/init.c
+++ b/libibverbs/src/init.c
@@ -190,33 +190,56 @@ void verbs_register_driver(const char *name, verbs_driver_init_func init_func)
register_driver(name, NULL, init_func);
}
+#define __IBV_QUOTE(x) #x
+#define IBV_QUOTE(x) __IBV_QUOTE(x)
+#define DLOPEN_TRAILER "-" IBV_QUOTE(IBV_DEVICE_LIBRARY_EXTENSION) ".so"
+
static void load_driver(const char *name)
{
char *so_name;
void *dlhandle;
-#define __IBV_QUOTE(x) #x
-#define IBV_QUOTE(x) __IBV_QUOTE(x)
-
- if (asprintf(&so_name,
- name[0] == '/' ?
- "%s-" IBV_QUOTE(IBV_DEVICE_LIBRARY_EXTENSION) ".so" :
- "lib%s-" IBV_QUOTE(IBV_DEVICE_LIBRARY_EXTENSION) ".so",
- name) < 0) {
- fprintf(stderr, PFX "Warning: couldn't load driver '%s'.\n",
- name);
+ /* If the name is an absolute path then open that path after appending
+ the trailer suffix */
+ if (name[0] == '/') {
+ if (asprintf(&so_name, "%s" DLOPEN_TRAILER, name) < 0)
+ goto out_asprintf;
+ dlhandle = dlopen(so_name, RTLD_NOW);
+ if (!dlhandle)
+ goto out_dlopen;
+ free(so_name);
return;
}
- dlhandle = dlopen(so_name, RTLD_NOW);
- if (!dlhandle) {
- fprintf(stderr, PFX "Warning: couldn't load driver '%s': %s\n",
- name, dlerror());
- goto out;
+ /* If configured with a provider plugin path then try that next */
+ if (sizeof(VERBS_PROVIDER_DIR) >= 1) {
+ if (asprintf(&so_name, VERBS_PROVIDER_DIR "/lib%s" DLOPEN_TRAILER, name) <
+ 0)
+ goto out_asprintf;
+ dlhandle = dlopen(so_name, RTLD_NOW);
+ free(so_name);
+ if (dlhandle)
+ return;
}
-out:
+ /* Otherwise use the system libary search path. This is the historical
+ behavior of libibverbs */
+ if (asprintf(&so_name, "lib%s" DLOPEN_TRAILER, name) < 0)
+ goto out_asprintf;
+ dlhandle = dlopen(so_name, RTLD_NOW);
+ if (!dlhandle)
+ goto out_dlopen;
+ free(so_name);
+ return;
+
+out_asprintf:
+ fprintf(stderr, PFX "Warning: couldn't load driver '%s'.\n", name);
+ return;
+out_dlopen:
+ fprintf(stderr, PFX "Warning: couldn't load driver '%s': %s\n", so_name,
+ dlerror());
free(so_name);
+ return;
}
static void load_drivers(void)
--
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/13] srp_daemon: Move lock file into /var/run/
From: Jason Gunthorpe @ 2016-09-23 19:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Bart Van Assche
In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
'/var/tmp' is an inappropriate places for lock files of this nature,
they belong in /var/run. /var/lock does not seem suitable because
this lock is not against a basic device node.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
buildlib/config.h.in | 1 +
srp_daemon/srp_daemon/srp_daemon.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
index bbc279d3c9c3..78994a39d7ad 100644
--- a/buildlib/config.h.in
+++ b/buildlib/config.h.in
@@ -22,6 +22,7 @@
#define IWPM_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/iwpmd.conf"
#define SRP_DEAMON_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf"
+#define SRP_DEAMON_LOCK_PREFIX "@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon"
#define ACM_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma"
#define IBACM_LIB_PATH "@ACM_PROVIDER_DIR@"
diff --git a/srp_daemon/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon/srp_daemon.c
index 70764e00f851..f16674dbfafa 100644
--- a/srp_daemon/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon/srp_daemon.c
@@ -131,7 +131,7 @@ static int check_process_uniqueness(struct config_t *conf)
char path[256];
int fd;
- snprintf(path, sizeof(path), "/var/tmp/srp_daemon_%s_%d",
+ snprintf(path, sizeof(path), SRP_DEAMON_LOCK_PREFIX "_%s_%d",
conf->dev_name, conf->port_num);
if ((fd = open(path, O_CREAT|O_RDWR,
--
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/13] Pass ancillary files that use paths through cmake substitution
From: Jason Gunthorpe @ 2016-09-23 19:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Sean Hefty, Tatyana Nikolova, Bart Van Assche
In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
This removes hardwired paths from the documentation and broadly
makes the documentation and scripts match what the C code is now
doing.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
ibacm/CMakeLists.txt | 2 +-
ibacm/ibacm.init.in | 2 +-
ibacm/man/{ibacm_prov.7 => ibacm_prov.7.in} | 4 ++--
iwpmd/CMakeLists.txt | 4 ++--
iwpmd/{iwpmd.1 => iwpmd.1.in} | 2 +-
iwpmd/{iwpmd.conf.5 => iwpmd.conf.5.in} | 2 +-
srp_daemon/man/CMakeLists.txt | 2 +-
srp_daemon/man/{srp_daemon.1 => srp_daemon.1.in} | 8 ++++----
srp_daemon/srp_daemon/CMakeLists.txt | 4 +++-
srp_daemon/srp_daemon/{srp_daemon.sh => srp_daemon.sh.in} | 4 ++--
srp_daemon/srp_daemon/srpd.in | 6 +++---
11 files changed, 21 insertions(+), 19 deletions(-)
rename ibacm/man/{ibacm_prov.7 => ibacm_prov.7.in} (95%)
rename iwpmd/{iwpmd.1 => iwpmd.1.in} (98%)
rename iwpmd/{iwpmd.conf.5 => iwpmd.conf.5.in} (92%)
rename srp_daemon/man/{srp_daemon.1 => srp_daemon.1.in} (90%)
rename srp_daemon/srp_daemon/{srp_daemon.sh => srp_daemon.sh.in} (95%)
diff --git a/ibacm/CMakeLists.txt b/ibacm/CMakeLists.txt
index 857a6e82320a..376a3a89ddae 100644
--- a/ibacm/CMakeLists.txt
+++ b/ibacm/CMakeLists.txt
@@ -52,7 +52,7 @@ rdma_man_pages(
man/ib_acme.1
man/ibacm.1
man/ibacm.7
- man/ibacm_prov.7
+ man/ibacm_prov.7.in
)
# FIXME: update the .init.in
diff --git a/ibacm/ibacm.init.in b/ibacm/ibacm.init.in
index aea262b6768a..0fb0011f3953 100644
--- a/ibacm/ibacm.init.in
+++ b/ibacm/ibacm.init.in
@@ -19,7 +19,7 @@
# host route lookups.
### END INIT INFO
-pidfile=/var/run/ibacm.pid
+pidfile=@CMAKE_INSTALL_FULL_RUNDIR@/ibacm.pid
subsys=/var/lock/subsys/ibacm
daemon() { /sbin/daemon ${1+"$@"}; }
diff --git a/ibacm/man/ibacm_prov.7 b/ibacm/man/ibacm_prov.7.in
similarity index 95%
rename from ibacm/man/ibacm_prov.7
rename to ibacm/man/ibacm_prov.7.in
index d04617e837c8..9e79d58f639e 100644
--- a/ibacm/man/ibacm_prov.7
+++ b/ibacm/man/ibacm_prov.7.in
@@ -12,7 +12,7 @@ To add a provider to the ibacm core service, the provider must
.TP
1. be implemented as a shared library;
.TP
-2. be installed under a configured directory, eg., /usr/lib64/ibacm/;
+2. be installed under a configured directory, eg., @ACM_PROVIDER_DIR@;
.TP
3 export a function provider_query() that returns a pointer to its provider info
and version info.
@@ -66,7 +66,7 @@ Non-related sections should be ignored.
.P
Some helper functions are also exported by the ibacm core. For example, the
acm_log define (or the acm_write() function) can be used to log messages into
-ibacm's log file (default /var/log/ibacm.log). For details, refer to
+ibacm's log file (default @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/ibacm.log). For details, refer to
the acm_prov.h file.
.SH "NOTES"
A provider should always set the version in its provider info structure as the
diff --git a/iwpmd/CMakeLists.txt b/iwpmd/CMakeLists.txt
index 21208dd5b82a..89a715128076 100644
--- a/iwpmd/CMakeLists.txt
+++ b/iwpmd/CMakeLists.txt
@@ -1,4 +1,4 @@
rdma_man_pages(
- iwpmd.1
- iwpmd.conf.5
+ iwpmd.1.in
+ iwpmd.conf.5.in
)
diff --git a/iwpmd/iwpmd.1 b/iwpmd/iwpmd.1.in
similarity index 98%
rename from iwpmd/iwpmd.1
rename to iwpmd/iwpmd.1.in
index a4948c509f3b..88eece7f6522 100644
--- a/iwpmd/iwpmd.1
+++ b/iwpmd/iwpmd.1.in
@@ -51,6 +51,6 @@ to the system message log.
.P
SIGTERM/SIGHUP will force iwpmd to exit.
.SH "FILES"
-/etc/iwpmd.conf
+@CMAKE_INSTALL_FULL_SYSCONFDIR@/iwpmd.conf
.SH "SEE ALSO"
rdma_cm(7)
diff --git a/iwpmd/iwpmd.conf.5 b/iwpmd/iwpmd.conf.5.in
similarity index 92%
rename from iwpmd/iwpmd.conf.5
rename to iwpmd/iwpmd.conf.5.in
index 9dfe137d3fab..1baae82b76da 100644
--- a/iwpmd/iwpmd.conf.5
+++ b/iwpmd/iwpmd.conf.5.in
@@ -15,6 +15,6 @@ to communicate with the kernel port map client. The default is 400MB.
.SH "EXAMPLES"
nl_sock_rbuf_size=419430400
.SH "FILES"
-/etc/iwpmd.conf
+@CMAKE_INSTALL_FULL_SYSCONFDIR@/iwpmd.conf
.SH "SEE ALSO"
iwpmd(1)
diff --git a/srp_daemon/man/CMakeLists.txt b/srp_daemon/man/CMakeLists.txt
index f05de60b97aa..cd644a6bd836 100644
--- a/srp_daemon/man/CMakeLists.txt
+++ b/srp_daemon/man/CMakeLists.txt
@@ -1,4 +1,4 @@
rdma_man_pages(
ibsrpdm.1
- srp_daemon.1
+ srp_daemon.1.in
)
diff --git a/srp_daemon/man/srp_daemon.1 b/srp_daemon/man/srp_daemon.1.in
similarity index 90%
rename from srp_daemon/man/srp_daemon.1
rename to srp_daemon/man/srp_daemon.1.in
index 6117e3679a25..6ee114284780 100644
--- a/srp_daemon/man/srp_daemon.1
+++ b/srp_daemon/man/srp_daemon.1.in
@@ -15,7 +15,7 @@ Each srp_daemon instance operates on one local port. Upon boot it performs a ful
When a new machine joins the fabric, srp_daemon checks if it is a target. When there is a change of capabilities, srp_daemon checks if the machine has turned into a target. When there is an SA change or a timeout expiration, srp_daemon performs a full rescan of the fabric.
-For each target srp_daemon finds, it checks if it should connect to this target according to its rules (default rules file is /etc/srp_daemon.conf) and if it is already connected to the local port. If it should connect to this target and if it is not connected yet, srp_daemon can either print the target details or connect to it.
+For each target srp_daemon finds, it checks if it should connect to this target according to its rules (default rules file is @CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf) and if it is already connected to the local port. If it should connect to this target and if it is not connected yet, srp_daemon can either print the target details or connect to it.
.SH OPTIONS
@@ -57,7 +57,7 @@ Retries to connect to existing target after \fIretry-Timeout\fR seconds. If -R i
.TP
\fB\-f\fR \fIrules-File\fR
Decide to which targets to connect according to the rules in \fIrules-File\fR.
-If \fB\-f\fR is not specified, uses the default rules file /etc/srp_daemon.conf.
+If \fB\-f\fR is not specified, uses the default rules file @CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf.
Each line in the \fIrules-File\fR is a rule which can be either an allow connection or a disallow connection according to
the first character in the line (a or d accordingly). The rest of the line is values for id_ext, ioc_guid, dgid,
service_id. Please take a look at the example section for an example of the file. srp_daemon decide whether to allow or disallow each target according to first rule that match the target. If no rule matches the target, the target is allowed and will be connected. In an allow rule it is possible to set attributes for the connection to the target. Supported attributes are max_cmd_per_lun and max_sect.
@@ -72,7 +72,7 @@ Perform \fIretries\fR retries on each send to MAD (default: 3 retries).
New format - use also initiator_ext in the connection command.
.SH FILES
-/etc/srp_daemon.conf -
+@CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf -
Default rules configuration file that indicates to which targets to connect. Can be overridden using the \fB\-f\fR \fIrules-File\fR option.
Each line in this file is a rule which can be either an allow connection or a disallow connection according to
the first character in the line (a or d accordingly). The rest of the line is values for id_ext, ioc_guid, dgid,
@@ -86,7 +86,7 @@ srp_daemon -o -c -a (Prints the connection commands for the targets in the
srp_daemon -e -f rules.txt (Connects to the targets allowed in the rules file rules.txt)
.nf
-An example for a rules configuration file (such as /etc/srp_daemon.conf)
+An example for a rules configuration file (such as @CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf)
------------------------------------------------------------------------
# Rules file example
# This is a comment
diff --git a/srp_daemon/srp_daemon/CMakeLists.txt b/srp_daemon/srp_daemon/CMakeLists.txt
index 84d74044186a..fe6b41811b92 100644
--- a/srp_daemon/srp_daemon/CMakeLists.txt
+++ b/srp_daemon/srp_daemon/CMakeLists.txt
@@ -15,7 +15,9 @@ target_link_libraries(srp_daemon
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}")
+rdma_subst_install(FILES "srp_daemon.sh.in"
+ DESTINATION "${CMAKE_INSTALL_SBINDIR}"
+ RENAME "srp_daemon.sh")
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")
diff --git a/srp_daemon/srp_daemon/srp_daemon.sh b/srp_daemon/srp_daemon/srp_daemon.sh.in
similarity index 95%
rename from srp_daemon/srp_daemon/srp_daemon.sh
rename to srp_daemon/srp_daemon/srp_daemon.sh.in
index 3981a0d4b586..cb0b81efe6e6 100755
--- a/srp_daemon/srp_daemon/srp_daemon.sh
+++ b/srp_daemon/srp_daemon/srp_daemon.sh.in
@@ -30,12 +30,12 @@
shopt -s nullglob
-prog=/usr/sbin/srp_daemon
+prog=@CMAKE_INSTALL_FULL_SBINDIR@/srp_daemon
params=$@
ibdir="/sys/class/infiniband"
rescan_interval=60
pids=""
-pidfile=/var/run/srp_daemon.sh.pid
+pidfile=@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon.sh.pid
mypid=$$
trap_handler()
diff --git a/srp_daemon/srp_daemon/srpd.in b/srp_daemon/srp_daemon/srpd.in
index 10692e7e0f05..d77579170a3b 100755
--- a/srp_daemon/srp_daemon/srpd.in
+++ b/srp_daemon/srp_daemon/srpd.in
@@ -4,7 +4,7 @@
#
# chkconfig: - 25 75
# description: Starts/Stops InfiniBand SRP client service
-# config: /etc/srp_daemon.conf
+# config: @CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf
#
### BEGIN INIT INFO
# Provides: srpd
@@ -32,8 +32,8 @@ fi
if [ -f $RDMA_CONFIG ]; then
. $RDMA_CONFIG
fi
-pidfile=/var/run/srp_daemon.sh.pid
-prog=/usr/sbin/srp_daemon.sh
+pidfile=@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon.sh.pid
+prog=@CMAKE_INSTALL_FULL_SBINDIR@/srp_daemon.sh
checkpid() {
[ -e "/proc/$1" ]
--
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/13] Consolidate definitions for paths into config.h
From: Jason Gunthorpe @ 2016-09-23 19:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Sean Hefty, Tatyana Nikolova, Bart Van Assche
In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
config.h is the only place we pass through cmake substitution,
so it is the only place that can define the various filesystem
paths.
This patch handles the C code portions that use paths.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
CMakeLists.txt | 10 ++++++++++
buildlib/config.h.in | 13 +++++++++++--
ibacm/CMakeLists.txt | 5 -----
ibacm/linux/osd.h | 2 +-
ibacm/src/acm.c | 6 +++---
ibacm/src/acme.c | 10 +++++-----
ibacm/src/libacm.c | 2 +-
iwpmd/src/iwarp_pm.h | 1 -
iwpmd/src/iwarp_pm_server.c | 1 +
librdmacm/src/acm.c | 2 +-
librdmacm/src/cma.h | 9 ---------
srp_daemon/srp_daemon/srp_daemon.c | 4 ++--
12 files changed, 35 insertions(+), 30 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9b9e34e5cd9d..713788f188e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,16 @@ set(CMAKE_INSTALL_SYSTEMD_SERVICEDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd"
set(ACM_PROVIDER_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/ibacm"
CACHE PATH "Location for ibacm provider plugin shared library files.")
+# Allow the 'run' dir to be configurable, this historically has been /var/run, but
+# some systems now use /run/
+set(CMAKE_INSTALL_RUNDIR "var/run"
+ CACHE PATH "Location for runtime information, typically /var/run, or /run")
+if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_RUNDIR})
+ set(CMAKE_INSTALL_FULL_RUNDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_RUNDIR}")
+else()
+ set(CMAKE_INSTALL_FULL_RUNDIR "${CMAKE_INSTALL_RUNDIR}")
+endif()
+
#-------------------------
# Load CMake components
set(BUILDLIB "${CMAKE_SOURCE_DIR}/buildlib")
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
index 984d51bfaa09..bbc279d3c9c3 100644
--- a/buildlib/config.h.in
+++ b/buildlib/config.h.in
@@ -17,9 +17,18 @@
#define HAVE_VALGRIND_MEMCHECK_H 1
#define INCLUDE_VALGRIND 1
-#define SYSCONFDIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@"
-
#define IBV_CONFIG_DIR "@CONFIG_DIR@"
+#define RS_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma/rsocket"
+#define IWPM_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/iwpmd.conf"
+
+#define SRP_DEAMON_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf"
+
+#define ACM_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma"
+#define IBACM_LIB_PATH "@ACM_PROVIDER_DIR@"
+#define IBACM_BIN_PATH "@CMAKE_INSTALL_FULL_BINDIR@"
+#define IBACM_PID_FILE "@CMAKE_INSTALL_FULL_RUNDIR@/ibacm.pid"
+#define IBACM_PORT_FILE "@CMAKE_INSTALL_FULL_RUNDIR@/ibacm.port"
+#define IBACM_LOG_FILE "@CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/ibacm.log"
// 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
diff --git a/ibacm/CMakeLists.txt b/ibacm/CMakeLists.txt
index 8887c13af463..857a6e82320a 100644
--- a/ibacm/CMakeLists.txt
+++ b/ibacm/CMakeLists.txt
@@ -3,11 +3,6 @@ publish_headers(infiniband
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")
diff --git a/ibacm/linux/osd.h b/ibacm/linux/osd.h
index 5ca4c6f554c5..83d31b3589c5 100644
--- a/ibacm/linux/osd.h
+++ b/ibacm/linux/osd.h
@@ -31,6 +31,7 @@
#if !defined(OSD_H)
#define OSD_H
+#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -46,7 +47,6 @@
#include <sys/time.h>
#include <netinet/in.h>
-#define ACM_CONF_DIR IBACM_CONFIG_PATH
#define ACM_ADDR_FILE "ibacm_addr.cfg"
#define ACM_OPTS_FILE "ibacm_opts.cfg"
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index ab1269f71d02..4650421b81b7 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -226,9 +226,9 @@ static struct sa_data {
static char *acme = IBACM_BIN_PATH "/ib_acme -A";
static char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE;
static char *addr_file = ACM_CONF_DIR "/" ACM_ADDR_FILE;
-static char log_file[128] = "/var/log/ibacm.log";
+static char log_file[128] = IBACM_LOG_FILE;
static int log_level = 0;
-static char lock_file[128] = "/var/run/ibacm.pid";
+static char lock_file[128] = IBACM_PID_FILE;
static short server_port = 6125;
static int support_ips_in_addr_cfg = 0;
static char prov_lib_path[256] = IBACM_LIB_PATH;
@@ -578,7 +578,7 @@ static void acm_init_server(void)
atomic_init(&client_array[i].refcnt);
}
- if (!(f = fopen("/var/run/ibacm.port", "w"))) {
+ if (!(f = fopen(IBACM_PORT_FILE, "w"))) {
acm_log(0, "notice - cannot publish ibacm port number\n");
return;
}
diff --git a/ibacm/src/acme.c b/ibacm/src/acme.c
index f1b0d010625e..4d9003047506 100644
--- a/ibacm/src/acme.c
+++ b/ibacm/src/acme.c
@@ -130,9 +130,9 @@ static void gen_opts_temp(FILE *f)
fprintf(f, "# Examples:\n");
fprintf(f, "# log_file stdout\n");
fprintf(f, "# log_file stderr\n");
- fprintf(f, "# log_file /var/log/ibacm.log\n");
+ fprintf(f, "# log_file %s\n", IBACM_LOG_FILE);
fprintf(f, "\n");
- fprintf(f, "log_file /var/log/ibacm.log\n");
+ fprintf(f, "log_file %s\n", IBACM_LOG_FILE);
fprintf(f, "\n");
fprintf(f, "# log_level:\n");
fprintf(f, "# Indicates the amount of detailed data written to the log file. Log levels\n");
@@ -147,7 +147,7 @@ static void gen_opts_temp(FILE *f)
fprintf(f, "# Specifies the location of the ACM lock file used to ensure that only a\n");
fprintf(f, "# single instance of ACM is running.\n");
fprintf(f, "\n");
- fprintf(f, "lock_file /var/run/ibacm.pid\n");
+ fprintf(f, "lock_file %s\n", IBACM_PID_FILE);
fprintf(f, "\n");
fprintf(f, "# addr_prot:\n");
fprintf(f, "# Default resolution protocol to resolve IP addresses into IB GIDs.\n");
@@ -276,7 +276,7 @@ static void gen_opts_temp(FILE *f)
fprintf(f, "# the ACM cache. This option is only valid if route_preload\n");
fprintf(f, "# indicates that routing data should be read from a file.\n");
fprintf(f, "# Default is %s/ibacm_route.data\n", ACM_CONF_DIR);
- fprintf(f, "# route_data_file /etc/rdma/ibacm_route.data\n");
+ fprintf(f, "# route_data_file %s/ibacm_route.data\n", ACM_CONF_DIR);
fprintf(f, "\n");
fprintf(f, "# addr_preload:\n");
fprintf(f, "# Specifies if the ACM address cache should be preloaded, or built on demand.\n");
@@ -292,7 +292,7 @@ static void gen_opts_temp(FILE *f)
fprintf(f, "# the ACM cache. This option is only valid if addr_preload\n");
fprintf(f, "# indicates that address data should be read from a file.\n");
fprintf(f, "# Default is %s/ibacm_hosts.data\n", ACM_CONF_DIR);
- fprintf(f, "# addr_data_file /etc/rdma/ibacm_hosts.data\n");
+ fprintf(f, "# addr_data_file %s/ibacm_hosts.data\n", ACM_CONF_DIR);
fprintf(f, "\n");
fprintf(f, "# support_ips_in_addr_cfg:\n");
fprintf(f, "# If 1 continue to read IP addresses from ibacm_addr.cfg\n");
diff --git a/ibacm/src/libacm.c b/ibacm/src/libacm.c
index 95e562deb031..3ad1db1d307b 100644
--- a/ibacm/src/libacm.c
+++ b/ibacm/src/libacm.c
@@ -48,7 +48,7 @@ static void acm_set_server_port(void)
{
FILE *f;
- if ((f = fopen("/var/run/ibacm.port", "r"))) {
+ if ((f = fopen(IBACM_PORT_FILE, "r"))) {
if (fscanf(f, "%hu", (unsigned short *) &server_port) != 1)
printf("Failed to read server port\n");
fclose(f);
diff --git a/iwpmd/src/iwarp_pm.h b/iwpmd/src/iwarp_pm.h
index bcf88ca30433..5b7c6136f386 100644
--- a/iwpmd/src/iwarp_pm.h
+++ b/iwpmd/src/iwarp_pm.h
@@ -85,7 +85,6 @@
#define IWPM_IFNAME_SIZE 16
#define IWPM_IPADDR_SIZE 16
-#define IWPM_CONFIG_FILE "/etc/iwpmd.conf"
#define IWPM_PARAM_NUM 1
#define IWPM_PARAM_NAME_LEN 64
diff --git a/iwpmd/src/iwarp_pm_server.c b/iwpmd/src/iwarp_pm_server.c
index e1c2a9c660bb..39e0aa2c3a36 100644
--- a/iwpmd/src/iwarp_pm_server.c
+++ b/iwpmd/src/iwarp_pm_server.c
@@ -31,6 +31,7 @@
*
*/
+#include "config.h"
#include "iwarp_pm.h"
const char iwpm_ulib_name [] = "iWarpPortMapperUser";
diff --git a/librdmacm/src/acm.c b/librdmacm/src/acm.c
index f0da01e6d286..75d9d8cf487e 100644
--- a/librdmacm/src/acm.c
+++ b/librdmacm/src/acm.c
@@ -120,7 +120,7 @@ static int ucma_set_server_port(void)
{
FILE *f;
- if ((f = fopen("/var/run/ibacm.port", "r" STREAM_CLOEXEC))) {
+ if ((f = fopen(IBACM_PORT_FILE, "r" STREAM_CLOEXEC))) {
fscanf(f, "%" SCNu16, &server_port);
fclose(f);
}
diff --git a/librdmacm/src/cma.h b/librdmacm/src/cma.h
index 98eba8dc21e1..091d104655c5 100644
--- a/librdmacm/src/cma.h
+++ b/librdmacm/src/cma.h
@@ -179,13 +179,4 @@ struct ib_connect_hdr {
#define cma_dst_ip6 dst_addr[0]
};
-#ifndef SYSCONFDIR
-#define SYSCONFDIR "/etc"
-#endif
-#ifndef RDMADIR
-#define RDMADIR "rdma"
-#endif
-#define RDMA_CONF_DIR SYSCONFDIR "/" RDMADIR
-#define RS_CONF_DIR RDMA_CONF_DIR "/rsocket"
-
#endif /* CMA_H */
diff --git a/srp_daemon/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon/srp_daemon.c
index dfc976b8f6db..70764e00f851 100644
--- a/srp_daemon/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon/srp_daemon.c
@@ -226,7 +226,7 @@ static void usage(const char *argv0)
fprintf(stderr, "-R <rescan time> perform complete Rescan every <rescan time> seconds\n");
fprintf(stderr, "-T <retry timeout> Retries to connect to existing target after Timeout of <retry timeout> seconds\n");
fprintf(stderr, "-l <tl_retry timeout> Transport retry count before failing IO. should be in range [2..7], (default 2)\n");
- fprintf(stderr, "-f <rules file> use rules File to set to which target(s) to connect (default: /etc/srp_daemon.conf\n");
+ fprintf(stderr, "-f <rules file> use rules File to set to which target(s) to connect (default: " SRP_DEAMON_CONFIG_FILE ")\n");
fprintf(stderr, "-t <timeout> Timeout for mad response in milliseconds\n");
fprintf(stderr, "-r <retries> number of send Retries for each mad\n");
fprintf(stderr, "-n New connection command format - use also initiator extension\n");
@@ -1622,7 +1622,7 @@ static int get_config(struct config_t *conf, int argc, char *argv[])
conf->retry_timeout = 20;
conf->add_target_file = NULL;
conf->print_initiator_ext = 0;
- conf->rules_file = "/etc/srp_daemon.conf";
+ conf->rules_file = SRP_DEAMON_CONFIG_FILE;
conf->rules = NULL;
conf->tl_retry_count = 0;
--
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/13] Have cmake run man pages through text substitution
From: Jason Gunthorpe @ 2016-09-23 19:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: Sean Hefty
In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
rsocket.7 had an errant text substitution that never worked, it is
a good idea to have the man pages use the correct paths, so let
us have cmake run them through.
Any man page ending in '.in' will be substituted automatically.
Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
buildlib/rdma_functions.cmake | 13 +++++++++++--
librdmacm/man/CMakeLists.txt | 2 +-
librdmacm/man/{rsocket.7 => rsocket.7.in} | 4 ++--
3 files changed, 14 insertions(+), 5 deletions(-)
rename librdmacm/man/{rsocket.7 => rsocket.7.in} (97%)
diff --git a/buildlib/rdma_functions.cmake b/buildlib/rdma_functions.cmake
index a4ecd7d4f2fe..260dd18d78df 100644
--- a/buildlib/rdma_functions.cmake
+++ b/buildlib/rdma_functions.cmake
@@ -135,8 +135,17 @@ endfunction()
# 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}/")
+ if ("${I}" MATCHES "\\.in$")
+ string(REGEX REPLACE "^.+[.](.+)\\.in$" "\\1" MAN_SECT "${I}")
+ string(REGEX REPLACE "^(.+)\\.in$" "\\1" BASE_NAME "${I}")
+ get_filename_component(BASE_NAME "${BASE_NAME}" NAME)
+ rdma_subst_install(FILES "${I}"
+ DESTINATION "${CMAKE_INSTALL_MANDIR}/man${MAN_SECT}/"
+ RENAME "${BASE_NAME}")
+ else()
+ string(REGEX REPLACE "^.+[.](.+)$" "\\1" MAN_SECT "${I}")
+ install(FILES "${I}" DESTINATION "${CMAKE_INSTALL_MANDIR}/man${MAN_SECT}/")
+ endif()
endforeach()
endfunction()
diff --git a/librdmacm/man/CMakeLists.txt b/librdmacm/man/CMakeLists.txt
index 791c98265ad0..d6cc106751a4 100644
--- a/librdmacm/man/CMakeLists.txt
+++ b/librdmacm/man/CMakeLists.txt
@@ -58,7 +58,7 @@ rdma_man_pages(
riostream.1
rping.1
# FIXME: rsocket has a text substitution but nothing ever filled it in.
- rsocket.7
+ rsocket.7.in
rstream.1
ucmatose.1
udaddy.1
diff --git a/librdmacm/man/rsocket.7 b/librdmacm/man/rsocket.7.in
similarity index 97%
rename from librdmacm/man/rsocket.7
rename to librdmacm/man/rsocket.7.in
index dfb9804d849a..6adf156f4062 100644
--- a/librdmacm/man/rsocket.7
+++ b/librdmacm/man/rsocket.7.in
@@ -129,7 +129,7 @@ fork off a process to handle the new connection.
.P
rsockets uses configuration files that give an administrator control
over the default settings used by rsockets. Use files under
-%sysconfig%/rdma/rsocket as shown:
+@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma/rsocket as shown:
.P
.P
mem_default - default size of receive buffer(s)
@@ -149,7 +149,7 @@ polling_time - default number of microseconds to poll for data before waiting
All configuration files should contain a single integer value. Values may
be set by issuing a command similar to the following example.
.P
-echo 1000000 > /etc/rdma/rsocket/mem_default
+echo 1000000 > @CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma/rsocket/mem_default
.P
If configuration files are not available, rsockets uses internal defaults.
Applications can override default values programmatically through the
--
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
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox