Skip to contentSkip to conversation

libibumad: add new registration ioctl

PATCH Superseded [email protected] 2 participants 3 messages May 3, 2014 – May 6, 2014 2 messages not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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.

---
 Makefile.am               |  1 +
 include/infiniband/umad.h | 19 ++++++++++++
 man/umad_register2.3      | 77 +++++++++++++++++++++++++++++++++++++++++++++++
 src/libibumad.map         |  1 +
 src/umad.c                | 77 +++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 175 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 +19 -0
index 6af30c0..95e7a41 100644
@@ -90,6 +90,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 +198,23 @@ 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;
+#define UMAD_REG_STRUCT_V1 0
+struct umad_reg_attr {
+	uint16_t   struct_version;
+	uint8_t    mgmt_class;
+	uint8_t    mgmt_class_version;
+	uint32_t   flags;
+	uint64_t   method_mask[2];
+	uint8_t    oui[3]; /* network order */
+	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 +77 -0

77 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 +77 -0

95 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

A message that is not in the archive (sent off-list or not yet received): 1399153023-25755-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 6 lines · On Sat, May 03, 2014 at 05:37:03PM -0400…

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.

Did the kernel side get posted?

include/infiniband/umad.h int umad_register_oui(int portid, int mgmt_class, uint8_t rmpp_version, · line 211

Quoted 7 lines
include/infiniband/umad.h +7 -0
+struct umad_reg_attr {
+	uint16_t   struct_version;
+	uint8_t    mgmt_class;
+	uint8_t    mgmt_class_version;
+	uint32_t   flags;
+	uint64_t   method_mask[2];
+	uint8_t    oui[3]; /* network order */

Seems like oui should just be a uint32_t in host order, doesn't make alot of API sense to burden callers with that detail.

include/infiniband/umad.h int umad_register_oui(int portid, int mgmt_class, uint8_t rmpp_version, · line 215

Quoted 4 lines
include/infiniband/umad.h +4 -0
+	uint8_t    rmpp_version;
+};
+int umad_register2(int port_fd, struct umad_reg_attr *attr,
+		   uint32_t *agent_id);

verbs has been moving to using sizeof(struct umad_reg_attr) not a 'struct_version', it would be nice to be consistent.

Quoted 24 lines
include/infiniband/umad.h +2 -0
+
+
 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 +15 -0
new file mode 100644
index 0000000..9086bb3
+++ b/man/umad_register2.3
@@ -0,0 +1,77 @@
+.\" -*- nroff -*-
+.\"
+.TH UMAD_REGISTER2 3  "March 25, 2014" "OpenIB" "OpenIB Programmer\'s Manual"
+.SH "NAME"
+umad_register2 \- register the specified management class and version for port
+.SH "SYNOPSIS"
+.nf
+.B #include <infiniband/umad.h>
+.sp
+.BI "int umad_register2(int " "port_fd" ", struct umad_reg_attr *" "attr" ", uint32_t *" "agent_id");
+.fi
+.SH "DESCRIPTION"
+.B umad_register2()
+registers for a MAD agent using the provided registration attributes

man/umad_register2.3 line 24

Quoted 10 lines
man/umad_register2.3 new file +10 -0
+
+.I port_fd\fR
+the port on which to register the agent
+
+.I attr\fR
+The registration attributes as defined by the structure passed.  See below for
+details of this structure.  Future structures may be defined.
+
+.I agent_id\fR
+returned on success.

The man page should describe what agent_id should be used for.. (I expect it is the argument passed to umad_unregister?)

Jason
--
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

A message that is not in the archive (sent off-list or not yet received): 20140505192059.GC5743-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org

author
#4 lore raw
Quoted 10 lines · On Sat, May 03, 2014 at 05:37:03PM -0400…
Quoted 6 lines

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.

Did the kernel side get posted?

Apparently my git send-email failed??? :-/

I'll try again right now,
Ira

--
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