diff mbox

libibumad: document the setting of errno for umad_send and umad_recv

Message ID 20130329112119.1bb9ee1f7e687fc40c7a841d@intel.com (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Ira Weiny March 29, 2013, 6:21 p.m. UTC
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 man/umad_recv.3 |    3 ++-
 man/umad_send.3 |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Or Gerlitz April 2, 2013, 9:19 a.m. UTC | #1
Hi Hal, Ira,

Just wondered why are you setting errno in the mad libraries? so far we 
managed to avoid doing so in libibverbs, librdmacm, libmlx4 ones.

Or.
--
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
Hefty, Sean April 2, 2013, 2:41 p.m. UTC | #2
> Just wondered why are you setting errno in the mad libraries? so far we
> managed to avoid doing so in libibverbs, librdmacm, libmlx4 ones.

The librdmacm does set errno
--
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
Ira Weiny April 2, 2013, 3:10 p.m. UTC | #3
> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-
> 
> Hi Hal, Ira,
> 
> Just wondered why are you setting errno in the mad libraries? so far we
> managed to avoid doing so in libibverbs, librdmacm, libmlx4 ones.

Turns out umad has been doing so since ~2007.  I don't know if any users are depending on it but that is the current interface so I think it should be documented.

For libibmad there is just no other way to get errors to the users without doing so.  I don't like it but after a long discussion between Jason, Brandon, and myself this was the only path to take.  With libibmad I don't think the impact is quite as bad as I don't think there are as many users.

Ira

> 
> Or.
> --
> 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
--
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
Or Gerlitz April 2, 2013, 7:17 p.m. UTC | #4
On Tue, Apr 2, 2013 at 5:41 PM, Hefty, Sean <sean.hefty@intel.com> wrote:
>> Just wondered why are you setting errno in the mad libraries? so far we
>> managed to avoid doing so in libibverbs, librdmacm, libmlx4 ones.
>
> The librdmacm does set errno

except for one place, libibverbs doesn't
--
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
Hal Rosenstock April 4, 2013, 11:21 a.m. UTC | #5
On 3/29/2013 2:21 PM, Ira Weiny wrote:
> 
> 
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Thanks. Applied.

-- Hal
--
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
diff mbox

Patch

diff --git a/man/umad_recv.3 b/man/umad_recv.3
index e233411..56e4ca7 100644
--- a/man/umad_recv.3
+++ b/man/umad_recv.3
@@ -55,7 +55,8 @@  be returned.
 
 .SH "RETURN VALUE"
 .B umad_recv()
-returns non negative receiving agentid on success, and a negative value on error as follows:
+on success return the agentid; on error, errno is set and a negative value is
+returned as follows:
  -EINVAL      invalid port handle or agentid or *length is less than the minimum supported
  -EIO         receive operation failed
  -EWOULDBLOCK non blocking read can't be fulfilled
diff --git a/man/umad_send.3 b/man/umad_send.3
index feb33af..b85bc56 100644
--- a/man/umad_send.3
+++ b/man/umad_send.3
@@ -39,7 +39,8 @@  makes kernel wait forever for the reply.
 indicates the number of times the MAD will be retried before giving up.
 .SH "RETURN VALUE"
 .B umad_send()
-returns 0 on success, and a negative value on error as follows:
+returns 0 on success; on error, errno is set and a negative value is returned
+as follows:
  -EINVAL invalid port handle or agentid
  -EIO    send operation failed
 .SH "AUTHOR"