linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CMA handler status code
@ 2010-07-27  4:34 Eldad Zinger
       [not found] ` <AANLkTik2eOWELUAwjL+tfjMb28L3OjWB57iMyvDpOWDm-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Eldad Zinger @ 2010-07-27  4:34 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hi everyone,
while developing SDP, I found a small problem with cma handlers:

drivers/infiniband/core/cma.c : 2204
drivers/infiniband/core/cma.c : 976

event.status = ib_event->param.sidr_rep_rcvd.status
event.status = ib_event->param.rej_rcvd.reason

event.status should be 0 for success, or negative value of generic error code.
In that code, the error code is positive and do not comply with
generic error code.

In order to make the status field available for other modules (like
SDP), that field should be format-consistent.
--
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	[flat|nested] 7+ messages in thread

* Re: CMA handler status code
       [not found] ` <AANLkTik2eOWELUAwjL+tfjMb28L3OjWB57iMyvDpOWDm-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-07-27  6:40   ` Or Gerlitz
       [not found]     ` <4C4E7F5E.6070306-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
  2010-07-27  8:11   ` Hefty, Sean
  1 sibling, 1 reply; 7+ messages in thread
From: Or Gerlitz @ 2010-07-27  6:40 UTC (permalink / raw)
  To: Eldad Zinger; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Eldad Zinger wrote:
> event.status = ib_event->param.sidr_rep_rcvd.status
> event.status = ib_event->param.rej_rcvd.reason
> event.status should be 0 for success, or negative value of generic error code.
> In that code, the error code is positive and do not comply with generic error code.

Basically, I believe that the status equals reject reason for rdma-cm reject event
is known to the kernel developers that deal with the rdma-cm. Personally, I'm fine
with it, we could document that, but currently there's no rdma-cm document under 
Documentation/infiniband which could have this.

For user space, I would add a comment in the man pages

> In order to make the status field available for other modules (like
> SDP), that field should be format-consistent.

With SDP being out of tree for about four-six years (and counting), somehow
hard to take into account claims related to it.

Ot.
--
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	[flat|nested] 7+ messages in thread

* Re: CMA handler status code
       [not found]     ` <4C4E7F5E.6070306-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
@ 2010-07-27  6:48       ` Or Gerlitz
  0 siblings, 0 replies; 7+ messages in thread
From: Or Gerlitz @ 2010-07-27  6:48 UTC (permalink / raw)
  To: Sean Hefty; +Cc: Eldad Zinger, linux-rdma-u79uwXL29TY76Z2rM5mHXA

> For user space, I would add a comment in the man pages

[PATCH] librdmacm/man: document status field semantics for rejected event

document status being the IB reject reason for RDMA_CM_EVENT_REJECTED event

Signed-off-by: Or Gerlitz <ogerlitz-smomgflXvOZWk0Htik3J/w@public.gmane.org>

diff --git a/man/rdma_get_cm_event.3 b/man/rdma_get_cm_event.3
index 79bf606..91317c4 100644
--- a/man/rdma_get_cm_event.3
+++ b/man/rdma_get_cm_event.3
@@ -126,7 +126,8 @@ Generated on the active side to notify the user that the remote server is
 not reachable or unable to respond to a connection request.
 .IP RDMA_CM_EVENT_REJECTED
 Indicates that a connection request or response was rejected by the remote
-end point.
+end point. Under Infiniband, the event status field contains the reject reason
+as provided by the IB CM.
 .IP RDMA_CM_EVENT_ESTABLISHED
 Indicates that a connection has been established with the remote end point.
 .IP RDMA_CM_EVENT_DISCONNECTED
--
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	[flat|nested] 7+ messages in thread

* RE: CMA handler status code
       [not found] ` <AANLkTik2eOWELUAwjL+tfjMb28L3OjWB57iMyvDpOWDm-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2010-07-27  6:40   ` Or Gerlitz
@ 2010-07-27  8:11   ` Hefty, Sean
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25A8D7FBFB-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Hefty, Sean @ 2010-07-27  8:11 UTC (permalink / raw)
  To: Eldad Zinger, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

> drivers/infiniband/core/cma.c : 2204
> drivers/infiniband/core/cma.c : 976
> 
> event.status = ib_event->param.sidr_rep_rcvd.status
> event.status = ib_event->param.rej_rcvd.reason

The original intent was to expose the transport specific status values to the user, rather than trying to map them.

- Sean

--
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	[flat|nested] 7+ messages in thread

* Re: CMA handler status code
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25A8D7FBFB-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2010-07-29  6:38       ` Or Gerlitz
       [not found]         ` <4C5121D7.7070604-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Or Gerlitz @ 2010-07-29  6:38 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: Eldad Zinger, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Hefty, Sean wrote:
> The original intent was to expose the transport specific status values to the user, 
> rather than trying to map them.

yes, this makes sense, are you okay with documenting that, e.g in the spirit of the patch I sent?

Or.
--
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	[flat|nested] 7+ messages in thread

* RE: CMA handler status code
       [not found]         ` <4C5121D7.7070604-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
@ 2010-07-29 16:58           ` Hefty, Sean
  2010-07-29 21:37           ` [PATCH] librdmacm: document event status field Hefty, Sean
  1 sibling, 0 replies; 7+ messages in thread
From: Hefty, Sean @ 2010-07-29 16:58 UTC (permalink / raw)
  To: Or Gerlitz
  Cc: Eldad Zinger, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

> yes, this makes sense, are you okay with documenting that, e.g in the
> spirit of the patch I sent?

Yes - I'll update the man pages accordingly.
--
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	[flat|nested] 7+ messages in thread

* [PATCH] librdmacm: document event status field
       [not found]         ` <4C5121D7.7070604-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
  2010-07-29 16:58           ` Hefty, Sean
@ 2010-07-29 21:37           ` Hefty, Sean
  1 sibling, 0 replies; 7+ messages in thread
From: Hefty, Sean @ 2010-07-29 21:37 UTC (permalink / raw)
  To: Or Gerlitz, Eldad Zinger
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Clarify the value returned in the event status field.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 man/rdma_get_cm_event.3 |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/man/rdma_get_cm_event.3 b/man/rdma_get_cm_event.3
index 2ea1b56..b0c4970 100644
--- a/man/rdma_get_cm_event.3
+++ b/man/rdma_get_cm_event.3
@@ -41,7 +41,10 @@ Specifies the type of communication event which occurred.  See EVENT TYPES
 below.
 .IP "status" 12
 Returns any asynchronous error information associated with an event.  The
-status is zero unless the corresponding operation failed.
+status is zero if the operation was successful, otherwise the status value
+is non-zero and is either set to an errno or a transport specific value.
+For details on transport specific status values, see the event type information
+below.
 .IP "param" 12
 Provides additional details based on the type of event.  Users should
 select the conn or ud subfields based on the rdma_port_space of the
@@ -126,10 +129,15 @@ Indicates that an error has occurred trying to establish or a connection.
 May be generated on the active or passive side of a connection.
 .IP RDMA_CM_EVENT_UNREACHABLE
 Generated on the active side to notify the user that the remote server is
-not reachable or unable to respond to a connection request.
+not reachable or unable to respond to a connection request.  If this event
+is generated in response to a UD QP resolution request over InfiniBand,
+the event status field will contain an errno, if negative, or the status
+result carried in the IB CM SIDR REP message.
 .IP RDMA_CM_EVENT_REJECTED
 Indicates that a connection request or response was rejected by the remote
-end point.
+end point.  The event status field will contain the transport specific
+reject reason if available.  Under InfiniBand, this is the reject reason
+carried in the IB CM REJ message.
 .IP RDMA_CM_EVENT_ESTABLISHED
 Indicates that a connection has been established with the remote end point.
 .IP RDMA_CM_EVENT_DISCONNECTED


--
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	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-07-29 21:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27  4:34 CMA handler status code Eldad Zinger
     [not found] ` <AANLkTik2eOWELUAwjL+tfjMb28L3OjWB57iMyvDpOWDm-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-27  6:40   ` Or Gerlitz
     [not found]     ` <4C4E7F5E.6070306-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-07-27  6:48       ` Or Gerlitz
2010-07-27  8:11   ` Hefty, Sean
     [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25A8D7FBFB-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-07-29  6:38       ` Or Gerlitz
     [not found]         ` <4C5121D7.7070604-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-07-29 16:58           ` Hefty, Sean
2010-07-29 21:37           ` [PATCH] librdmacm: document event status field Hefty, Sean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).