Skip to contentSkip to conversation

libibumad: update umad_recv man page.

PATCH Superseded Ira Weiny 2 participants 6 messages Jul 3, 2012 – Jul 6, 2012 5 messages not in the archive InfiniBand

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ira Weiny

author
#0 lore raw

PATCH v2 1/1 libibumad: update umad_recv man page.

Document the umad_recv length parameter better.

Changes since V1:
add comments from Hal

---
 man/umad_recv.3 |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
man/umad_recv.3 +17 -1
index e1b2985..310d3d2 100644
@@ -27,10 +27,26 @@ A negative
 makes the function block until a packet is received. A
 .I timeout_ms\fR
 parameter of zero indicates a non blocking read.
+
+.B Note
+.I length
+is a pointer to the length of the
+.B data
+portion of the umad buffer.  This means that
+.I umad
+should point to a buffer at least umad_size() +
+.I *length
+bytes long.
+
+.B Note also
+that
+.I *length\fR
+must be >= 256 bytes.
+
 .SH "RETURN VALUE"
 .B umad_recv()
 returns non negative receiving agentid on success, and a negative value on error as follows:
- -EINVAL      invalid port handle or agentid
+ -EINVAL      invalid port handle or agentid or *length is less than the minimum
  -EIO         receive operation failed
  -EWOULDBLOCK non blocking read can't be fulfilled
 .SH "SEE ALSO"
Signature · 6 lines
1.7.1

--
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
#2 lore raw
In reply to a message not in the archive
Quoted 24 lines · Ira Weiny

Document the umad_recv length parameter better.

Changes since V1:
add comments from Hal

---
 man/umad_recv.3 |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
man/umad_recv.3 +5 -0
index e1b2985..310d3d2 100644
@@ -27,10 +27,26 @@ A negative
 makes the function block until a packet is received. A
 .I timeout_ms\fR
 parameter of zero indicates a non blocking read.
+
+.B Note
+.I length
+is a pointer to the length of the
+.B data

man/umad_recv.3 A negative · line 44

Quoted 10 lines
man/umad_recv.3 +10 -0
+portion of the umad buffer.  This means that
+.I umad
+should point to a buffer at least umad_size() +
+.I *length
+bytes long.
+
+.B Note also
+that
+.I *length\fR
+must be >= 256 bytes.

This seems somewhat redundant to me as just above it says "should point to a bugger that's at least umad_size() + *length bytes long.

Also, if this remains, should "must be" be "should be" ?

man/umad_recv.3 A negative · line 49

Quoted 6 lines
man/umad_recv.3 +2 -1
+
 .SH "RETURN VALUE"
 .B umad_recv()
 returns non negative receiving agentid on success, and a negative value on error as follows:
- -EINVAL      invalid port handle or agentid
+ -EINVAL      invalid port handle or agentid or *length is less than the minimum

Rather than just minimum, minimum support length might be clearer.

-- Hal

man/umad_recv.3 A negative · line 52

Quoted 3 lines
man/umad_recv.3 +0 -0
  -EIO         receive operation failed
  -EWOULDBLOCK non blocking read can't be fulfilled
 .SH "SEE ALSO"

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

author
#4 lore raw
In reply to a message not in the archive
Quoted 39 lines · On Fri, 06 Jul 2012 14:34:24 -0400 Hal Rosenstock…
Quoted 24 lines · Ira Weiny

Document the umad_recv length parameter better.

Changes since V1:
add comments from Hal

---
 man/umad_recv.3 |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
man/umad_recv.3 +5 -0
index e1b2985..310d3d2 100644
@@ -27,10 +27,26 @@ A negative
 makes the function block until a packet is received. A
 .I timeout_ms\fR
 parameter of zero indicates a non blocking read.
+
+.B Note
+.I length
+is a pointer to the length of the
+.B data

man/umad_recv.3 A negative · line 44

Quoted 10 lines
man/umad_recv.3 +10 -0
+portion of the umad buffer.  This means that
+.I umad
+should point to a buffer at least umad_size() +
+.I *length
+bytes long.
+
+.B Note also
+that
+.I *length\fR
+must be >= 256 bytes.

This seems somewhat redundant to me as just above it says "should point to a bugger that's at least umad_size() + *length bytes long.

Quoted 1 line

Also, if this remains, should "must be" be "should be" ?

I _guess_ it _could_ be less than 256. However the specification states:

"C13-3: The data payload (as used in Chapter 9: Transport Layer on page 233) for all MADs shall be exactly 256 bytes."

Furthermore, the kernel checks to ensure that *length is > the first (or only) packet in the MAD transaction. While some Class/Attributes may allow for less "valid" data I'm not sure the kernel distinguishes that. Therefore, I think it is safer to just specify it. Don't you think?

Ira

Quoted 16 lines

man/umad_recv.3 A negative · line 49

Quoted 7 lines
man/umad_recv.3 +2 -1
+
 .SH "RETURN VALUE"
 .B umad_recv()
 returns non negative receiving agentid on success, and a negative value on error as follows:
- -EINVAL      invalid port handle or agentid
+ -EINVAL      invalid port handle or agentid or *length is less than the minimum

Rather than just minimum, minimum support length might be clearer.

-- Hal

Quoted 3 lines
man/umad_recv.3 +0 -0
  -EIO         receive operation failed
  -EWOULDBLOCK non blocking read can't be fulfilled
 .SH "SEE ALSO"
Signature · 9 lines
Ira Weiny
Member of Technical Staff
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
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
#6 lore raw
In reply to a message not in the archive
Quoted 42 lines · Ira Weiny
Quoted 39 lines · On Fri, 06 Jul 2012 14:34:24 -0400 Hal Rosenstock…
Quoted 24 lines · Ira Weiny

Document the umad_recv length parameter better.

Changes since V1:
add comments from Hal

---
 man/umad_recv.3 |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
man/umad_recv.3 +5 -0
index e1b2985..310d3d2 100644
@@ -27,10 +27,26 @@ A negative
 makes the function block until a packet is received. A
 .I timeout_ms\fR
 parameter of zero indicates a non blocking read.
+
+.B Note
+.I length
+is a pointer to the length of the
+.B data

man/umad_recv.3 A negative · line 44

Quoted 10 lines
man/umad_recv.3 +10 -0
+portion of the umad buffer.  This means that
+.I umad
+should point to a buffer at least umad_size() +
+.I *length
+bytes long.
+
+.B Note also
+that
+.I *length\fR
+must be >= 256 bytes.

This seems somewhat redundant to me as just above it says "should point to a bugger that's at least umad_size() + *length bytes long.

Quoted 3 lines
Quoted 1 line

Also, if this remains, should "must be" be "should be" ?

I _guess_ it _could_ be less than 256.

My only point here is that if it's less than 256 + header, then the error is returned (and nothing useful can be done). To me, that makes it a should rather than a must but just make the two lines consistent. Roland does have this as a must in user_mad.txt kernel doc:
"The buffer passed to read() must be at least one struct ib_user_mad + 256 bytes."

-- Hal

Quoted 26 lines

However the specification states:

"C13-3: The data payload (as used in Chapter 9: Transport Layer on page 233) for all MADs shall be exactly 256 bytes."

Furthermore, the kernel checks to ensure that *length is > the first (or only) packet in the MAD transaction. While some Class/Attributes may allow for less "valid" data I'm not sure the kernel distinguishes that. Therefore, I think it is safer to just specify it. Don't you think?

Ira

Quoted 16 lines

man/umad_recv.3 A negative · line 49

Quoted 7 lines
man/umad_recv.3 +2 -1
+
 .SH "RETURN VALUE"
 .B umad_recv()
 returns non negative receiving agentid on success, and a negative value on error as follows:
- -EINVAL      invalid port handle or agentid
+ -EINVAL      invalid port handle or agentid or *length is less than the minimum

Rather than just minimum, minimum support length might be clearer.

-- Hal

Quoted 3 lines
man/umad_recv.3 +0 -0
  -EIO         receive operation failed
  -EWOULDBLOCK non blocking read can't be fulfilled
 .SH "SEE ALSO"

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

author
#8 lore raw
In reply to a message not in the archive
Quoted 16 lines · On Fri, 06 Jul 2012 15:32:51 -0400 Hal Rosenstock…
Quoted 15 lines · Ira Weiny
Quoted 12 lines · On Fri, 06 Jul 2012 14:34:24 -0400 Hal Rosenstock…
Quoted 11 lines · Ira Weiny

Document the umad_recv length parameter better.

Changes since V1:
add comments from Hal

---
 man/umad_recv.3 |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
man/umad_recv.3 +0 -0
index e1b2985..310d3d2 100644
@@ -27,10 +27,26 @@ A negative
 makes the function block until a packet is received. A
 .I timeout_ms\fR
 parameter of zero indicates a non blocking read.
Quoted 8 lines
Quoted 8 lines

man/umad_recv.3 A negative · line 37

Quoted 8 lines
man/umad_recv.3 +8 -0
+
+.B Note
+.I length
+is a pointer to the length of the
+.B data
+portion of the umad buffer.  This means that
+.I umad
+should point to a buffer at least umad_size() +
       ^^^^^^
       must

Oh, You mean must here?

Ira

Quoted 55 lines
Quoted 11 lines
Quoted 11 lines

man/umad_recv.3 A negative · line 44

Quoted 7 lines
man/umad_recv.3 +7 -0
+.I *length
+bytes long.
+
+.B Note also
+that
+.I *length\fR
+must be >= 256 bytes.

This seems somewhat redundant to me as just above it says "should point to a bugger that's at least umad_size() + *length bytes long.

Quoted 3 lines
Quoted 1 line

Also, if this remains, should "must be" be "should be" ?

I _guess_ it _could_ be less than 256.

My only point here is that if it's less than 256 + header, then the error is returned (and nothing useful can be done). To me, that makes it a should rather than a must but just make the two lines consistent. Roland does have this as a must in user_mad.txt kernel doc:
"The buffer passed to read() must be at least one struct ib_user_mad + 256 bytes."

-- Hal

Quoted 26 lines

However the specification states:

"C13-3: The data payload (as used in Chapter 9: Transport Layer on page 233) for all MADs shall be exactly 256 bytes."

Furthermore, the kernel checks to ensure that *length is > the first (or only) packet in the MAD transaction. While some Class/Attributes may allow for less "valid" data I'm not sure the kernel distinguishes that. Therefore, I think it is safer to just specify it. Don't you think?

Ira

Quoted 16 lines

man/umad_recv.3 A negative · line 49

Quoted 7 lines
man/umad_recv.3 +2 -1
+
 .SH "RETURN VALUE"
 .B umad_recv()
 returns non negative receiving agentid on success, and a negative value on error as follows:
- -EINVAL      invalid port handle or agentid
+ -EINVAL      invalid port handle or agentid or *length is less than the minimum

Rather than just minimum, minimum support length might be clearer.

-- Hal

Quoted 3 lines
man/umad_recv.3 +0 -0
  -EIO         receive operation failed
  -EWOULDBLOCK non blocking read can't be fulfilled
 .SH "SEE ALSO"

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

Signature · 9 lines
Ira Weiny
Member of Technical Staff
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
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
#10 lore raw
In reply to a message not in the archive
Quoted 38 lines · Ira Weiny
Quoted 16 lines · On Fri, 06 Jul 2012 15:32:51 -0400 Hal Rosenstock…
Quoted 15 lines · Ira Weiny
Quoted 12 lines · On Fri, 06 Jul 2012 14:34:24 -0400 Hal Rosenstock…
Quoted 11 lines · Ira Weiny

Document the umad_recv length parameter better.

Changes since V1:
add comments from Hal

---
 man/umad_recv.3 |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
man/umad_recv.3 +0 -0
index e1b2985..310d3d2 100644
@@ -27,10 +27,26 @@ A negative
 makes the function block until a packet is received. A
 .I timeout_ms\fR
 parameter of zero indicates a non blocking read.
Quoted 8 lines
Quoted 8 lines

man/umad_recv.3 A negative · line 37

Quoted 8 lines
man/umad_recv.3 +8 -0
+
+.B Note
+.I length
+is a pointer to the length of the
+.B data
+portion of the umad buffer.  This means that
+.I umad
+should point to a buffer at least umad_size() +
       ^^^^^^
       must
Quoted 1 line

Oh, You mean must here?

Yes, if that's the direction you choose (must rather than should).

-- Hal

Quoted 60 lines

Ira

Quoted 55 lines
Quoted 11 lines
Quoted 11 lines

man/umad_recv.3 A negative · line 44

Quoted 7 lines
man/umad_recv.3 +7 -0
+.I *length
+bytes long.
+
+.B Note also
+that
+.I *length\fR
+must be >= 256 bytes.

This seems somewhat redundant to me as just above it says "should point to a bugger that's at least umad_size() + *length bytes long.

Quoted 3 lines
Quoted 1 line

Also, if this remains, should "must be" be "should be" ?

I _guess_ it _could_ be less than 256.

My only point here is that if it's less than 256 + header, then the error is returned (and nothing useful can be done). To me, that makes it a should rather than a must but just make the two lines consistent. Roland does have this as a must in user_mad.txt kernel doc:
"The buffer passed to read() must be at least one struct ib_user_mad + 256 bytes."

-- Hal

Quoted 26 lines

However the specification states:

"C13-3: The data payload (as used in Chapter 9: Transport Layer on page 233) for all MADs shall be exactly 256 bytes."

Furthermore, the kernel checks to ensure that *length is > the first (or only) packet in the MAD transaction. While some Class/Attributes may allow for less "valid" data I'm not sure the kernel distinguishes that. Therefore, I think it is safer to just specify it. Don't you think?

Ira

Quoted 16 lines

man/umad_recv.3 A negative · line 49

Quoted 7 lines
man/umad_recv.3 +2 -1
+
 .SH "RETURN VALUE"
 .B umad_recv()
 returns non negative receiving agentid on success, and a negative value on error as follows:
- -EINVAL      invalid port handle or agentid
+ -EINVAL      invalid port handle or agentid or *length is less than the minimum

Rather than just minimum, minimum support length might be clearer.

-- Hal

Quoted 3 lines
man/umad_recv.3 +0 -0
  -EIO         receive operation failed
  -EWOULDBLOCK non blocking read can't be fulfilled
 .SH "SEE ALSO"

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

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