Skip to contentSkip to conversation

libibumad: add new registration ioctl

PATCH New [email protected] 1 participant 1 message May 27, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 libibumad: add new registration ioctl

From: Ira Weiny <[email protected]>

This supports the new registration ioctl which the kernel is exporting. Specifically this adds flags to the registration operation. The first such flag is to request user space RMPP. Thus turning off kernel based RMPP coalescing.

Changes from V1:
1) update man page
2) convert oui to 32 bits and host byte order
3) Pad Kernel struct out to 64 bits for easier 32/64bit compatibility
4) update trace/debug messages
5) remove struct version from API (will use symbol versions if future versions are needed.)
6) If the kernel does not support the new ioctl and no flags are specified automatically use the old ioctl to perform the registration. Otherwise indicate that no flags are supported as per the man page.

---
 Makefile.am               |   1 +
 include/infiniband/umad.h |  18 ++++++++
 man/umad_register2.3      |  76 ++++++++++++++++++++++++++++++++++
 src/libibumad.map         |   1 +
 src/umad.c                | 102 ++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 198 insertions(+)
 create mode 100644 man/umad_register2.3
Makefile.am +1 -0
index 24b5dd8..a15ac2d 100644
@@ -16,6 +16,7 @@ man_MANS = man/umad_debug.3 man/umad_get_ca.3 \
 	   man/umad_set_addr_net.3 man/umad_set_addr.3 man/umad_set_pkey.3 \
 	   man/umad_get_pkey.3 \
 	   man/umad_register.3 man/umad_register_oui.3 man/umad_unregister.3 \
+	   man/umad_register2.3 \
 	   man/umad_send.3 man/umad_recv.3 man/umad_poll.3 \
 	   man/umad_get_issm_path.3 \
 	   man/umad_attribute_str.3 \
include/infiniband/umad.h +18 -0
index 6af30c0..ca649e3 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
+ * Copyright (c) 2014 Intel Corporation.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -90,6 +91,8 @@ typedef struct ib_user_mad {
 					      struct ib_user_mad_reg_req)
 #define IB_USER_MAD_UNREGISTER_AGENT	_IOW(IB_IOCTL_MAGIC, 2, uint32_t)
 #define IB_USER_MAD_ENABLE_PKEY		_IO(IB_IOCTL_MAGIC, 3)
+#define IB_USER_MAD_REGISTER_AGENT2     _IOWR(IB_IOCTL_MAGIC, 4, \
+					      struct ib_user_mad_reg_req2)
 
 #define UMAD_CA_NAME_LEN	20
 #define UMAD_CA_MAX_PORTS	10	/* 0 - 9 */
@@ -196,6 +199,21 @@ int umad_register_oui(int portid, int mgmt_class, uint8_t rmpp_version,
 		      uint8_t oui[3], long method_mask[16 / sizeof(long)]);
 int umad_unregister(int portid, int agentid);
 
+enum {
+	UMAD_USER_RMPP = (1 << 0)
+} umad_reg_flags;
+struct umad_reg_attr {
+	uint8_t    mgmt_class;
+	uint8_t    mgmt_class_version;
+	uint32_t   flags;
+	uint64_t   method_mask[2];
+	uint32_t   oui;
+	uint8_t    rmpp_version;
+};
+int umad_register2(int port_fd, struct umad_reg_attr *attr,
+		   uint32_t *agent_id);
+
+
 int umad_debug(int level);
 void umad_addr_dump(ib_mad_addr_t * addr);
 void umad_dump(void *umad);
man/umad_register2.3 new file +76 -0

76 lines not on this page · raw message

src/libibumad.map +1 -0
index eeb9d83..e42dc79 100644
@@ -23,6 +23,7 @@ IBUMAD_1.0 {
 		umad_poll;
 		umad_get_fd;
 		umad_register;
+		umad_register2;
 		umad_register_oui;
 		umad_unregister;
 		umad_status;
src/umad.c +102 -0

125 lines not on this page · raw message

Signature · 6 lines
1.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html